Go to main content

Customizing Automated Installations With Manifests and Profiles

Exit Print View

Updated: November 2020
 
 

Creating a Script

To create scripts, use any scripting language that is supported by the image, such as ksh93 and python.

A helpful approach is to use a ksh script template that is provided in the AI server.

aiserver$ cp /usr/share/auto_install/manifest/default.ksh.tmpl /var/tmp/ai-script

To configure manifest parameters, you would add aimanifest subcommands statements to new script.

The aimanifest command must be available on the system where you run the script. If the command is not available, install the auto-install-common package. For more details, see the aimanifest(8) man page.

Finally, you would associate the script with an install service and optionally establish criteria for its use.

aiserver$ installadm create-manifest -n solaris11_4-i386 -f /var/tmp/ai-script \
-m x86manifest

Note - You can also use the script to create a configuration profile to apply during installation. For an example, see Adding a System Configuration Profile.

aimanifest Subcommands

The aimanifest command supports the following subcommands.

aimanifest load file

Loads an existing XML manifest file. That file's contents would replace the contents of AIM_MANIFEST.

The first aimanifest command statement on the script must be to load the AIM_MANIFEST file, whether a fully developed manifest or an empty file containing only the bare minimum required elements. Subsequent aimanifest commands that modify the manifest use the DTD to determine where to add elements in the developing manifest.

aimanifest add path

Adds new elements to the base manifest. The variable path refers to a node in an XML hierarchy of elements and attributes.

aimanifest set path

Changes the value of an element or attribute in the manifest.

aimanifest get path

Retrieves the value of each element or attribute which matches path. If an element or attribute has no defined value, an empty string ("") is displayed

The following example returns the action of the software_data element that contains the package name pkg:/entire.

$ /usr/bin/aimanifest get software_data[name=\"pkg:/entire\"]@action
aimanifest delete path

Deletes all nodes or attributes which match path. If a path specifies nodes, delete the subtree rooted at each node which matches path. If a path matches attributes, delete all attributes which match path; do not delete any nodes.

A derived manifest should also contain tests that would stop the install operation when errors are encountered. The template script already contains this test.

Retrieving Client Attributes

In the derived manifests script, the aimanifest subcommands work with defined environment variables that represent client attributes. These variables are listed in the following table:

Table 1  AI Client Attribute Environment Variables
Environment Variable Name
Description
SI_ARCH
The architecture of the AI client to be installed. Equivalent to the output of uname -p.
SI_CONFIG_PROFILE_DIR
The directory where user supplied system configuration profiles may be stored and used by the install service.
SI_CPU
The ISA or processor type of the AI client to be installed. Equivalent of the output of uname -p.
SI_DISKNAME_#
A flat set of variables representing the names of the disks found on the AI client. There will exist SI_NUMDISKS number of SI_DISKNAME_# variables, where the # is replaced by an integer starting at 1, up to SI_NUMDISKS. This set of variables correlates with the set of variables described by SI_DISKSIZE_#.
SI_DISKSIZE_#
A flat set of variables representing the disk sizes of the disks found on the AI client. There will exist SI_NUMDISKS number of SI_DISKSIZE_#variables, where the # is replaced by an integer starting at 1, up to SI_NUMDISKS. This set of variables correlates with the set of variables described by SI_DISKNAME_#. The sizes are integer numbers of megabytes.
SI_HOSTADDRESS
The IP address of the AI client as set in the install environment.
SI_HOSTNAME
The host name of the AI client as set in the install environment.
SI_INSTALL_PROFILE_DIR
The directory where user supplied system configuration profiles for the install environment may be stored and used by the install service.
SI_INSTALL_SERVICE
The name of the install service used to obtain the manifest script. This environment variable has a value only for network boots, not for media boots.
SI_KARCH
The kernel architecture of the AI client. Equivalent to the output of uname -m.
SI_MEMSIZE
The amount of physical memory on the AI client. The size is an integer number of megabytes.
SI_NATISA
The native instruction set architecture of the AI client. Equivalent to the output of isainfo -n.
SI_NETWORK
The network number of the AI client. The network number is (IP_ADDR & netmask).
SI_NUMDISKS
The number of disks on the AI client.
SI_PLATFORM (or SI_MODEL)
The platform of the AI client. Equivalent to the output of uname -i for x86 systems and prtconf -b for SPARC systems.
SI_SYSPKG
The release of the Oracle Solaris incorporation package on the AI client (currently named entire). If the AI client's entire package is pkg://solaris/entire@0.5.11,5.11-0.175.0.0.0.2.0:20111020T143822Z, the value of SI_SYSPKG would be pkg:/entire@0.5.11-0.175.0. For an update release or SRU, if the AI client's entire pkg is pkg://solaris/entire@0.5.11,5.11-0.175.1.19.0.6.0:20140508T221351Z, the value of SI_SYSPKG would be pkg:/entire@0.5.11-0.175.1.

For examples of derived manifests scripts, see Examples of Derived Manifests Scripts.