使用 zonecfg 命令创建名为 new-zone 的新区域配置。使用第二个 –z 选项确定要克隆的区域。
# zonecfg -z new-zone create -a archive -z archived-zone
# zoneadm list -cv
您可以选择使用归档文件中的软件还是使用 IPS 系统信息库的软件来安装区域。
# zoneadm -z new-zone install -a archive -z archived-zone
# zoneadm -z new-zone install
# zoneadm -z new-zone boot
本示例将创建名为 test-net 的 example-net 克隆。下列所示的 zonecfg 命令不需要第二个 –z 选项来定义要克隆的区域,因为 example-net-recovery.uar 归档文件只有一个可部署系统。
# 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 boot示例 2-10 从统一归档文件安装现有区域配置
本示例将使用现有的区域配置安装名为 web-server 的区域。
# 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 boot示例 2-11 使用多个可部署系统从统一归档文件配置区域
如果多个可部署系统已包含在统一归档文件当中,请使用 zonecfg 中的 –z 选项来指定要使用的可部署系统。您只能使用一个可部署系统。
# 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
您现在可以安装和引导克隆区域。
示例 2-12 从具有多个可部署系统的统一归档文件中安装区域如果多个可部署系统已包含在统一归档文件当中,请使用 zoneadm 中的 –z 选项指定要从中安装的可部署系统。
# zoneadm -z test-dev install -a /var/tmp/zonearchive.uar -z example-dev