在 Oracle Solaris 11.2 中使用统一归档文件进行系统恢复和克隆

退出打印视图

更新时间: 2014 年 7 月
 
 

如何从统一归档文件部署区域

  1. 成为管理员。

    有关更多信息,请参见在 Oracle Solaris 11.2 中确保用户和进程的安全 中的使用所指定的管理权限

  2. 如果还没有现有的区域配置,请从现有的归档文件创建区域配置。
    1. 使用归档文件克隆区域配置。

      使用 zonecfg 命令创建名为 new-zone 的新区域配置。使用第二个 –z 选项确定要克隆的区域。

      # zonecfg -z new-zone create -a archive -z archived-zone
    2. (u53ef选) 验证是否已创建区域配置。
      # zoneadm list -cv
  3. 安装区域。

    您可以选择使用归档文件中的软件还是使用 IPS 系统信息库的软件来安装区域。

    1. 使用归档文件安装区域。
      # zoneadm -z new-zone install -a archive -z archived-zone
    2. 使用 IPS 系统信息库安装区域。
    # zoneadm -z new-zone install
  4. 引导区域。
    # zoneadm -z new-zone boot
示例 2-9  配置和部署区域

本示例将创建名为 test-netexample-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