Creating AE Template File
You can find information related to the virtual image template that is the input to the AE script.
The virtual image template file is the input provided to the Activation Engine script. It is an XML file, with a specific structure that must be followed for the Activation Engine to work accurately. Each template file consists of two major portions, template settings and template data.
Schema
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="template">
<xs:complexType>
<xs:sequence>
<xs:element name="settings">
<xs:complexType>
<xs:sequence>
<xs:element name="logDirectory" type="xs:string" minOccurs="0"/>
<xs:element name="scriptsDirectory" type="xs:string"/>
<xs:element name="extensions" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element name="extendedTemplate" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rules">
<xs:complexType>
<xs:sequence>
<xs:element name="section" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="ruleSet" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" processContents="lax" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="script" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
/usr/sbin/ae
with -check
flag
and pass the template parameter.Document Type Description
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT template (settings, rules)>
<!ATTLIST template
name CDATA #REQUIRED>
<!ELEMENT settings (logDirectory?, scriptsDirectory, extensions?)>
<!ELEMENT logDirectory EMPTY>
<!ELEMENT scriptsDirectory EMPTY>
<!ELEMENT extensions (extendedTemplate+)>
<!ELEMENT extendedTemplate EMPTY>
<!ELEMENT rules (section+)>
<!ELEMENT section (ruleSet+)>
<!ATTLIST section
name CDATA #REQUIRED
script CDATA #REQUIRED>
<!ELEMENT ruleSet ANY>
Example
ae_template.xml
file
is as follows:<?xml version="1.0" encoding="UTF-8"?>
<template name="Default Activation Engine template">
<settings>
<!-- created automatically if it doesn't exist -->
<logDirectory>/var/adm/ras/nim/ae/</logDirectory>
<!-- / is assumed to be / of optical media -->
<scriptsDirectory>/ae/scripts/</scriptsDirectory>
<extensions>
<extendedTemplate>/ae/user_template1.xml</extendedTemplate>
<extendedTemplate>/ae/user_template2.xml</extendedTemplate>
</extensions>
</settings>
<rules>
<section name="network" script="ae_network.sh">
<ruleSet>
<address>9.3.148.163</address>
<mask>255.255.254.0</mask>
<gateway>9.3.148.0</gateway>
<routes>default:0:9.3.149.1</routes>
</ruleSet>
</section>
<section name="accounts" script="ae_accounts.sh">
<ruleSet>
<username>scott</username>
<groups>admin,sys,system</groups>
<admin>true</admin>
<home>/home/bear</home>
</ruleSet>
<ruleSet>
<username>eric</username>
<groups>cron,security</groups>
<rlogin>true</rlogin>
<home>/home/misty</home>
</ruleSet>
</section>
<section name="filesystems" script="ae_filesystems.sh">
<ruleSet>
<mountpoint>/usr/blah</mountpoint>
<type>jfs2</type>
<size>3834383</size>
<efs>yes</efs>
<vix>no</vix>
</ruleSet>
<ruleSet>
<mountpoint>/usr/bleh</mountpoint>
<type>jfs</type>
<size>9595999</size>
<efs>no</efs>
<volume_id>Bleh</volume_id>
</ruleSet>
</section>
</rules>
</template>
Template settings
logDirectory
: Is a directory with the script logs. Each script has a separate log file. For example, if a script was calledae_network_extension.sh
then its log file isae_network_extension.log
and is placed in the directory specified bylogDirectory
rule. If thelogDirectory
does not exist when Activation Engine starts execution, run the mkdir command to create the directory.scriptsDirectory
: Is a directory that defines the location of the scripts. The script contains information about how each rule in the template must be linked to a particular script, and the script must be run to apply the rule. The default scripts provided areae_network.sh
,ae_accounts.sh
andae_filesystems.sh
. These scripts contains basic functionality and must be extended for more advanced uses. The root of the path specified inscriptsDirectory
element is assumed to be the root of the mounted optical media containing the template.extensions
: Is a list of all user created virtual image templates that must be processed by the Activation Engine. Specify the templates that must be processed in order and with full file path. This list is not required if there are no user extensions to the process.
Sections and rulesets
The rules of a virtual image template file are an important part where all system customization parameters exist. It is subdivided into sections which are categories of rules. For example, there is a separate section for network, user accounts, and file systems. Sections are abstract separators for various groupings of system parameters. They link scripts to RuleSets. Each section has a script field where the code for customizing configuration is defined and has the rules provided in the section RuleSets.
RuleSets are subdivisions of sections. It contains a group of parameters that must be passed for a single execution of the Section script. Each RuleSet implies another different execution of the script that is linked. In one section if you want to execute the script more than once, we must have more than one RuleSet in the file system section.