Go to main content

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

Exit Print View

Updated: October 2017
 
 

Example XML Manifests for Archive Deployment

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.3 Systems. Also refer to the aimanifest(1M) man page. These sample manifests are provided:

Example XML Manifests

Example 17  AI 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 18  AI 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 19  AI 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 20  AI 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. The IPS entry has to follow the ARCHIVE entry or the install will fail. The archive will not be deployed on the system if the package install happens first, so the ARCHIVE entry must be first.

<!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 21  AI 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"
Example 22  AI Manifest to Deploy a Kernel Zone with Non-root Pools

This manifest requires that devices with id's 0 and 1 exist in the zone's configuration.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE auto_install SYSTEM " file:///usr/share/install/ai.dtd.1">
<auto_install>
  <ai_instance name="default">
    <target name="origin">
      <disk in_zpool="rpool" in_vdev="rpool-none" whole_disk="true">
        <disk_name name="c1d0" name_type="ctd"/>
      </disk>
      <disk in_zpool="tank" in_vdev="tank-none" whole_disk="true">
        <disk_name name="c1d1" name_type="ctd"/>
      </disk>
      <logical noswap="false" nodump="false">
        <zpool name="rpool" action="create" is_root="true" mountpoint="/rpool">
          <vdev name="rpool-none" redundancy="none"/>
        </zpool>
        <zpool name="tank" action="create" is_root="false"
            mountpoint="/tank">
          <vdev name="tank-none" redundancy="none"/>
        </zpool>
      </logical>
    </target>
    <software type="ARCHIVE">
      <source>
        <file uri="file:///archives/clone.uar"/>
      </source>
      <software_data action="install">
        <name>*</name>
      </software_data>
    </software>
  </ai_instance>
</auto_install>