Tuesday, July 17, 2012

AI derived manifests

Beyond the default AI setup are custom AI installations.
For custom AI installations, one of the most difficult part is about manifests.

Derived manifests take into account client hardware specifics.
Essentially they are scripts that dynamically generate a "real" manifest.
They start by loading a base (static) manifest, a default or a customized one.
According to client-specific environment variables, other clauses are dynamically inserted.
An example of the overall strategy is as follows:
   
Copy an existing manifest as a starting point:
 
# cd /export/auto_install/solaris11-i386/auto_install
# cp -p manifest/{default,base}.xml
# ln -s {manifest/,}base.xml

     
Manually customize as much as needed and as much as possible:
 
# vi base.xml
# egrep 'ai_instance name|origin' base.xml

  <ai_instance name="base" auto_reboot="true">
          <origin name="http://s11-depot-01"/>
  
Within a derived manifest, address what couldn't be set by the previous steps:
 
# cd /export/auto_install/files
# vi derived.sh
# chmod a+x derived.sh

   
Associate the derived manifest with an installation service:
 
# installadm create-manifest
  -n solaris11-i386
  -m derived
  -f /export/auto_install/files/derived.sh
  -d
   

Verify:
 
# installadm list -m
Service Name    Manifest      Status
------------    --------      ------
default-i386    orig_default  Default
solaris11-i386  derived       Default
 
# installadm list -m -n solaris11-i386
Manifest      Status    Criteria
--------      ------    --------
derived       Default   None
orig_default  Inactive  None