Using Unified Archives for System Recovery and Cloning in Oracle Solaris 11.2

Exit Print View

Updated: July 2014
 
 

Example XML Manifests for Archive Recovery

Example XML Manifests

This chapter includes example manifests for archive deployment. For further information about installation manifests, refer to Customizing an XML AI Manifest File in Installing Oracle Solaris 11.2 Systems . Also refer to the aimanifest(1M) man page.

Example A-1  Manifest to Deploy a Global Zone From a Clone Archive

In this example, the referenced clone archive contains a single global zone that can be used to deploy a global zone.

<!DOCTYPE auto_install SYSTEM "file:///usr/share/install/ai.dtd.1">
<auto_install>
  <ai_instance name="archive0">
    <target name="desired">
      <logical>
        <zpool name="rpool" is_root="true">
        </zpool>
      </logical>
    </target>
    <software type="ARCHIVE">
      <source>
        <file uri="http://example-ai.example.com/datapool/global.uar">
        </file>
      </source>
      <software_data action="install">
         <name>global</name>
      </software_data>
    </software>
  </ai_instance>
</auto_install>
Example A-2  Manifest to Deploy a Non-Global Zone From a Clone Archive

The following example shows a manifest deploying a non-global zone from a cloned archive.

<!DOCTYPE auto_install SYSTEM "file:///usr/share/install/ai.dtd.1">
<auto_install>
  <ai_instance name="zone_default">
    <target>
      <logical>
        <zpool name="rpool">
        </zpool>
      </logical>
    </target>
    <software type="ARCHIVE">
      <source>
        <file uri="http:///example-ai.example.com/archives/zone-01.uar"/>
      </source>
      <software_data action="install">
        <name>zone-01</name>
      </software_data>
    </software>
  </ai_instance>
</auto_install>
Example A-3  Manifest to Deploy a System Using a System Recovery Archive

The following example manifest demonstrates deploying a system using a system recovery archive.

<!DOCTYPE auto_install SYSTEM "file:///usr/share/install/ai.dtd.1">
<auto_install>
  <ai_instance name="archive0">
    <target name="desired">
      <logical>
        <zpool name="rpool" is_root="true">
        </zpool>
      </logical>
    </target>
    <software type="ARCHIVE">
      <source>
        <file uri="http://example-ai.example.com/recovery.uar">
        </file>
      </source>
      <software_data action="install">
         <name>*</name>
      </software_data>
    </software>
  </ai_instance>
</auto_install>
Example A-4  Manifest to Deploy an AI Client From a Non-global Zone Archive

To transform a non-global zone to a global zone requires additional data such as drivers, platform software and so on. The IPS publishers that contain this information must be reachable from the AI client during the deployment. In this example, an AI client called test2 will be configured using information from the archive named /tmp/myarchive.uar and from packages from http://pkg.oracle.com/solaris/release/. The location of the IPS repository is defined in a second software declaration of type IPS.

<!DOCTYPE auto_install SYSTEM "file:///usr/share/install/ai.dtd.1">
<auto_install>
  <ai_instance name="default">
   <target>
      <logical>
        <zpool name="rpool" is_root="true">
          <filesystem name="export" mountpoint="/export"/>
          <filesystem name="export/home"/>
        </zpool>
      </logical>
    </target>  ...
    <software type="ARCHIVE">
      <source>
        <file uri="/tmp/myarchive.uar">
        </file>
      </source>
      <software_data action="install">
         <name>test2</name>
      </software_data>
    </software>      
    <software type="IPS">
      <source>
        <publisher name "solaris">
          <origin name="http://pkg.oracle.com/solaris/release/">
        </file>
      </source>
    </software>
  </ai_instance>
</auto_install>
Example A-5  Manifest to Deploy a Global Zone and Configure a Zone From the Same Archive

In addition to deploying a zone, you can also configure an additional zone from an archive by adding the following line to the manifest:

<!DOCTYPE auto_install SYSTEM "file:///usr/share/install/ai.dtd.1">
<auto_install>
  <ai_instance name="zone1">
    <target>
      <logical>
        <zpool name="rpool" is_root="true">
        </zpool>
      </logical>
    </target>
    <software type="ARCHIVE">
      <source>
        <file uri="http://myserver.com/archives/mysystem-clone.uar">
        </file>
      </source>
      <software_data action="install">
        <name>zone1</name>
      </software_data>
    </software>
    <configuration type="zone" name="zone1" source="archive:myzone"
      archive="http://myserver.com/archives/mysystem-clone.uar"/>
  </ai_instance>
</auto_install>

This will configure zone1 based on the myzone instance in the mysystem-clone.uar file. Be default, zone1 will be installed from the IPS repository on first reboot, after the global zone has been installed. If you wish to use the archive to install the zone as well, use the following command:

# installadm create-manifest -n <service> -f <zone1-manifest-path> -m zone1 -c zonename="zone1"