For more information, see Using Your Assigned Administrative Rights in Securing Users and Processes in Oracle Solaris 11.2 .
Create a new zone configuration called new-zone using the zonecfg command. Use the second –z option to identify the zone to be cloned.
# zonecfg -z new-zone create -a archive -z archived-zone
# zoneadm list -cv
You can choose to install the zone using the software in an archive or using the software from the IPS repository.
# zoneadm -z new-zone install -a archive -z archived-zone
# zoneadm -z new-zone install
# zoneadm -z new-zone boot
This example creates a clone of example-net named test-net. The zonecfg command shown below does not require a second –z option to define the zone to cloned since the example-net-recovery.uar archive only has one deployable system.
# archiveadm info /var/tmp/example-net-recovery.uar Archive Information Creation Time: 2014-03-03T19:10:53Z Source Host: example Architecture: i386 Operating System: Oracle Solaris 11.2 X86 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/exmaple-dev solaris excl - test-net configured /zones/test-net solaris excl # zoneadm -z test-net install -a /var/tmp/example-net-recovery.uar Progress being logged to /var/log/zones/zoneadm.20131010T175728Z.test-net.install Image: Preparing at /zones/test-net/root. AI Manifest: /tmp/manifest.xml.caa4I2 SC Profile: /usr/share/auto_install/sc_profiles/enable_sci.xml Zonename: test-net Installation: Starting ... . . Installation: Succeeded Note: Man pages can be obtained by installing pkg:/system/manual done. Done: Installation completed in 393.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 /zones/test-net/root/var/log/zones/zoneadm.20131010T175728Z.test-net.install # zoneadm -z test-dev bootExample 2-10 Installing an Existing Zone Configuration From a Unified Archive
This example installs a zone called web-server using an existing zone configuration.
# archiveadm info /var/tmp/example-dev-recovery.uar Archive Information Creation Time: 2014-03-03T19:10:53Z Source Host: example Architecture: i386 Operating System: Oracle Solaris 11.2 X86 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 Progress being logged to /var/log/zones/zoneadm.20140307T211655Z.web-server.install Installing: This may take several minutes... Install Log: /system/volatile/install.8799/install_log AI Manifest: /tmp/manifest.web-server.qCaakr.xml Zonename: web-server Installation: Starting ... . . Updating non-global zone: Zone updated. Result: Attach Succeeded. 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.20140307T211655Z.web-server.install # zoneadm -z web-server bootExample 2-11 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: 2014-03-03T17:04:11Z Source Host: example Architecture: i386 Operating System: Oracle Solaris 11.2 X86 Deployable Systems: global,example-dev,example-net # zonecfg -z test-dev create -a /var/tmp/zonearchive.uar -z example-dev
You can now install and boot the cloned zone.
Example 2-12 Installing Zones From a Unified Archive With Multiple Deployable SystemsIf 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