Go to main content

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

Exit Print View

Updated: September 2020
 
 

How to Deploy a Zone From a Unified Archive

Zone deployment has two phases: zone creation using the zonecfg command and zone installation using the zoneadm install command. You can use Unified Archives on either operation or on both operations.

For more information about zones, see Creating and Using Oracle Solaris Zones.

Before You Begin

You must be an administrator with the correct rights profiles to perform this task. See Using Rights Profiles with Unified Archives.

  1. Create the zone from an existing archive.
    $ zonecfg -z new-zone create -a archive [-z archived-zone]

    If the archive contains multiple deployable systems, the second –z option specifies the zone in the archive that you want to use.

  2. Install the zone.
    • To install the zone by using the same archive, type:
      $ zoneadm -z new-zone install -a archive [-z archived-zone]

      If the archive contains multiple deployable systems, the second –z option specifes the zone in the archive that you want to use.

    • To install the zone by using the IPS repository, type:
      $ zoneadm -z new-zone install
  3. Boot the zone.
    $ zoneadm -z new-zone boot
Example 16  Configuring and Deploying a Zone

This example creates a clone of example-net named test-net. The archive only has one deployable system. Thus, a second –z option to define the zone to clone is not required.

$ archiveadm info /var/tmp/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

$ zonecfg -z test-net create -a /var/tmp/example-net-recovery.uar
$ zoneadm list -cv 
  ID NAME             STATUS      PATH                         BRAND      IP
   0 global           running     /                            solaris    shared
   - example-net      installed   /zones/example-net           solaris    excl
   - example-dev      installed   /zones/example-dev           solaris    excl
   - test-net         configured  /zones/test-net              solaris    excl

$ zoneadm -z test-net install -a /var/tmp/example-net-recovery.uar
The following ZFS file system(s) have been created:
    rpool/VARSHARE/zones/test-net
Progress being logged to /var/log/zones/zoneadm.20160224T001725Z.test-net.install
       Image: Preparing at /system/zones/test-net/root.

 Install Log: /system/volatile/install.7980/install_log
 AI Manifest: /tmp/manifest.test-net.X7SKlb.xml
  SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml
    Zonename: example-dev
Installation: Starting ...
  .
        Done: Installation completed in 777.186 seconds.
  Next Steps: Boot the zone, then log into the zone console (zlogin -C)
              to complete the configuration process.
Log saved in non-global zone as /system/zones/test-net/root/var/log/zones/zoneadm.20160224T001725Z.test-net.install

$ zoneadm -z test-dev boot
Example 17  Installing an Existing Zone Configuration From a Unified Archive

This example installs a zone called web-server while using an existing zone configuration.

$ archiveadm info /var/tmp/example-dev-recovery.uar 
Archive Information
          Creation Time:  2016-02-03T19:10:53Z
            Source Host:  example
           Architecture:  sparc
       Operating System:  Oracle Solaris 11.3 SPARC
     Deployable Systems:  example-dev 
$ zoneadm list -cv 
  ID NAME             STATUS      PATH                         BRAND      IP
   0 global           running     /                            solaris    shared
   - example-net      installed   /zones/example-net           solaris    excl
   - example-dev      installed   /zones/example-dev           solaris    excl
   - web-server       configured  /zones/web-server            solaris    excl
$ zoneadm -z web-server install -a /data/archives/example-dev-recovery.uar 
The following ZFS file system(s) have been created:
    rpool/VARSHARE/zones/web-server
Progress being logged to /var/log/zones/zoneadm.20160224T001725Z.web-server.install
  .
       Done: Installation completed in 140.828 seconds.
 Next Steps: Boot the zone, then log into the zone console (zlogin -C)
             to complete the configuration process. 
Log saved in non-global zone as 
    /system/zones/web-server/root/var/log/zones/zoneadm.20160224T001725Z.web-server.install

# zoneadm -z web-server boot
Example 18  Configuring Zones From a Unified Archive With Multiple Deployable Systems

If multiple deployable systems are contained in a Unified Archive, use the –z option in zonecfg to specify which deployable system to use. You can use only one deployable system.

$ archiveadm info /var/tmp/zonearchive.uar 
Archive Information
          Creation Time:  2016-02-02T17:04:11Z
            Source Host:  example
           Architecture:  sparc
       Operating System:  Oracle Solaris 11.3 SPARC
     Deployable Systems:  global,example-net,example-dev
$ zonecfg -z test-dev create -a /var/tmp/zonearchive.uar -z example-dev

You can now install and boot the cloned zone.

Example 19  Installing Zones From a Unified Archive With Multiple Deployable Systems

If multiple deployable systems are contained in a Unified Archive, use the –z option in zoneadm to specify the deployable system to install from.

$ zoneadm -z test-dev install -a /var/tmp/zonearchive.uar -z example-dev