Go to main content

Using Unified Archives for System Recovery and Cloning in Oracle® Solaris 11.4

Exit Print View

Updated: September 2020
 
 

Creating a Unified Archive

To create an archive, you issue the archiveadm create command on the system you want to archive. The following options are useful when creating archives.

  • –D to exclude specified datasets

  • –e to exclude bootable media

  • –r to create a recovery archive

  • –z to include specified zones

  • –Z to exclude specified zones

  • –dehydrate to create a dehydrated clone archive.

    The archiveadm rehydrate command rehydrates a dehydrated clone archive.

  • –root-only to create an archive that excludes all non-root pool data.

For a full list of all of the options see the archiveadm(8) man page.

About Reverted Files in an Archive

During the archiving process, the contents of several files and directories are automatically reverted to their package defaults. Their contents are specific to the system and should not be propagated to other systems. Thus their information is removed when you create an archive.

Revert tag attributes identify these files:

  • system:clone identifies files that are excluded in clone archives.

  • system:dev-init identifies files that are excluded in either clone or recovery archives.

If you need to restore the reverted files after archive deployment, create copies of these files. You restore them manually or create an IPS package that includes those files. Additionally for AI deployments, you can create a first-boot script.

For more information, refer to the following sources:

To identify reverted files for a clone archive, type the following:

$ pkg contents -o path,revert-tag -a revert-tag=system:dev-init \
   -a revert-tag=system:clone

To identify reverted files for a recovery archive, type the following:

$ pkg contents -o path,revert-tag -a revert-tag=system:dev-init

About Unified Archives and Zones

Unified Archives can be used to archive zones in a system except for two cases that are unsupported.

  • Zones that use shared storage

  • Embedded zones in kernel zones

The process fails if you attempt to archive a system that contains either zones on shared storage or kernel zones that host other zones. You would need to create separate archives for each of those zones. See How to Archive a System That Contains Zones on Shared Storage for instructions.

Examples: Creating Clone Archives

This section provides examples of different ways to create clone archives. Some examples include how to display archive information.


Note -  The examples assume that the administrator has the correct privileges to perform these actions. See Using Rights Profiles with Unified Archives.
Example 1  Creating a Clone Archive That Includes All Zones

This example shows how to archive the entire contents of a system into production1.uar.

$ archiveadm create /var/tmp/production1.uar

Logging to /system/volatile/archive_log.11248

  0% : Beginning archive creation.
  5% : Initializing Unified Archive creation resources...
  5% : Unified Archive initialized: /var/tmp/production1.uar
  6% : Executing dataset discovery...
 10% : Dataset discovery complete
 11% : Executing staging capacity check...
 12% : Staging capacity check complete
 15% : Creating zone media: UnifiedArchive [xxx]
 52% : CreateZoneMedia: UnifiedArchive [xxx] complete
 55% : Preparing archive image...
 73% : Archive image preparation complete
 75% : Beginning archive stream creation...
 92% : Archive stream creation complete
 93% : Beginning archive descriptor creation...
 94% : Archive descriptor creation complete
 95% : Beginning final archive assembly...
100% : Archive assembly complete

$ archiveadm info /var/tmp/production1.uar
Archive Information
          Creation Time:  2016-02-02T20:37:16Z
            Source Host:  example
           Architecture:  sparc
       Operating System:  Oracle Solaris 11.3 SPARC
  Dehydrated Publishers:
     Deployable Systems:  global,example-net,example-dev
Example 2  Creating a Clone Archive of Selected Zones Only

This example shows how to create a clone archive of two zones, example-net and example-dev, into /var/tmp/zonearchive.uar.

$ archiveadm create -z example-net,example-dev /var/tmp/zonearchive.uar

Logging to /system/volatile/archive_log.10236

  0% : Beginning archive creation
 .
100% : Archive assembly complete

$ archiveadm info /var/tmp/zonearchive.uar
Archive Information
          Creation Time:  2016-03-02T09:37:10Z
            Source Host:  example
           Architecture:  sparc
       Operating System:  Oracle Solaris 11.3 SPARC
  Dehydrated Publishers:
     Deployable Systems:  example-net,example-dev
Example 3  Creating a Clone Archive That Excludes ZFS Datasets

This example demonstrates how to exclude a ZFS dataset from a clone archive. Datasets must be identified by a path that is accessible from the system where the archiveadm command is executed.

Excluded datasets are not propagated to kernel zones which are being archived. If you need to exclude a dataset in a kernel zone, you must create the archive from the kernel zone.

$ archiveadm create -D tank/scratch /var/tmp/noscratch.uar

Logging to /system/volatile/archive_log.11248

  0% : Beginning archive creation
 .
100% : Archive creation complete
Example 4  Creating a Clone Archive Without Bootable Media

By default, bootable media is created for each OS release in an archive. This media is embedded in the archive and used to boot and install kernel zones for each global zone in the archive. This process uses the pkg://solaris/install-image/solaris-auto-install package. If the package is not available, or if you want to make smaller archives, create a clone archive without bootable media by using the –e option.

$ archiveadm create -e /var/tmp/production2.uar

Logging to /system/volatile/archive_log.3093

  0% : Beginning archive creation...
 .
100% : Archive assembly complete
Example 5  Creating a Clone Archive without Content from Any Publishers

This example shows how to create a dehydrated clone archive where information from any publishers is removed.

$ archiveadm create --dehydrate /var/tmp/production3.uar

Logging to /system/volatile/archive_log.808

  0% : Beginning media creation...
 .
100% : Archive assembly complete

$ archiveadm info /var/tmp/production3.uar
Archive Information
          Creation Time:  2016-10-03T23:45:40Z
            Source Host:  example
           Architecture:  sparc
       Operating System:  Oracle Solaris 11.3 SPARC
  Dehydrated Publishers:  database, solarisExcluded publishers
     Deployable Systems:  global,example-net,example-dev
Example 6  Creating a Partially Dehydrated Clone Archive

Instead of removing all publisher information, use the –publisher option to specify which publisher to remove, and thus create a partially dehydrated archive. Add each publisher in a comma-separated list.

This example removes only the solaris publisher from the archive.

$ archiveadm create --dehydrate --publisher solaris /var/tmp/production4.uar

Logging to /system/volatile/archive_log.808

  0% : Beginning media creation...
 .
100% : Archive assembly complete
Example 7  Rehydrating a Clone Archive

Rehydrating an archive effectively means re-creating a dehydrated archive but with all of the removed publisher information restored. At this time, selective rehydration is not supported. You must supply the rehydrated archive with a new name.

$ archiveadm rehydrate production4.uar production4-rehydrate.uar

Logging to /system/volatile/archive_log.5282

  0% : Beginning rehydration...
 .
100% : Archive assembly complete

Examples: Creating Recovery Archives

This section provides examples of different ways to create recovery archives:

Example 8  Creating a Recovery Archive of the Global Zone

This example shows how to create a recovery archive comprising only the global zone.

$ archiveadm create -r -z global /var/tmp/globalrecovery.uar

Logging to /system/volatile/archive_log.7230

  0% : Beginning archive creation...
 .
100% : Archive assembly complete

# archiveadm info -v globalrecovery.uar
Archive Information
          Creation Time:  2016-02-22T22:51:43Z
            Source Host:  example
           Architecture:  sparc
       Operating System:  Oracle Solaris 11.3 SPARC
  Dehydrated Publishers:
       Recovery Archive:  Yes
           ...

Deployable Systems: 
          'global'
           ...
Example 9  Creating A Recovery Archive of a Zone

This example shows how to create a recovery archive of the zone example-net. Note that only one zone is allowed for creation of a recovery archive.

$ archiveadm create -r -z example-net /var/tmp/example-net-recovery.uar

Logging to /system/volatile/archive_log.6587

  0% : Beginning archive creation...
 .
100% : Archive assembly complete
$ archiveadm info -v example-net-recovery.uar
Archive Information
          Creation Time:  2016-02-23T23:51:27Z
            Source Host:  example
           Architecture:  sparc
       Operating System:  Oracle Solaris 11.3 SPARC
       Recovery Archive:  Yes
           ...

Deployable Systems: 
     'example-net'
           ...
Example 10  Creating a Recovery Archive That Excludes a ZFS Dataset

As with clone archives, you can exclude datasets from an recovery archive. This example shows how to create a recovery archive excluding the ZFS dataset rpool/scratch. The exclusion of a dataset is recursive, so all descendant datasets are also excluded.

$ archiveadm create -r -D rpool/scratch /var/tmp/noscratch-recovery.uar

Logging to /system/volatile/archive_log.6587

  0% : Beginning archive creation...
 .
100% : Archive creation complete