Example XML policy

This section shows an example XML policy for the resource group WebServerGroup that is depicted in Figure 1. The resource group comprises the three move groups "apache1", "local_mount", and "ha-ip-adress", and the harvested file system resource "harvestedFS".
Figure 1. WebServerGroup resource group
WebServerGroup resource group
<?xml version="1.0" encoding="UTF-8"?>
<AutomationPolicy productID="SAM" version="3.2.2"
    xmlns="http://www.ibm.com/TSA/Policy.xsd" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.ibm.com/TSA/Policy.xsd SAMPolicy.xsd ">
    <PolicyInformation>
        <PolicyName>WebServer-Policy</PolicyName>
        <AutomationDomainName>clustername</AutomationDomainName>
        <PolicyToken>1.0.0</PolicyToken>
        <PolicyDescription>this is the policy for the WebServer
        </PolicyDescription>
        <PolicyAuthor>authorname</PolicyAuthor>
    </PolicyInformation>

    <ConstituentResource name="apache1" class="IBM.Application" node="node1" />
    <ConstituentResource name="apache1" class="IBM.Application" node="node2" />

    <ConstituentResource name="local_mount" class="IBM.AgFileSystem" node="node1" >
      <ClassAttributesReference>
        <IBM.AgFileSystemAttributes name="FileSystem1"/>
      </ClassAttributesReference>
    </ConstituentResource>
    <ConstituentResource name="local_mount" class="IBM.AgFileSystem" node="node2" />

    <ConstituentResource name="ha-ip-address" class="IBM.ServiceIP" node="node1" />
    <ConstituentResource name="ha-ip-address" class="IBM.ServiceIP" node="node2" />

    <IBM.ApplicationAttributes name="Application1">
        <StartCommand>/PATH-TO-SCRIPT/apache start</StartCommand>
        <StopCommand>/PATH-TO-SCRIPT/apache stop</StopCommand>
        <MonitorCommand>/PATH-TO-SCRIPT/apache status</MonitorCommand>
        <UserName>root</UserName>
        <MonitorCommandPeriod>5</MonitorCommandPeriod>
        <MonitorCommandTimeout>4</MonitorCommandTimeout>
        <StartCommandTimeout>10</StartCommandTimeout>
        <StopCommandTimeout>10</StopCommandTimeout>
        <RunCommandsSync>1</RunCommandsSync>
    </IBM.ApplicationAttributes>

    <IBM.AgFileSystemAttributes name="FileSystem1">
        <DeviceName>/dev/DEVICE1</DeviceName>
        <MountPoint>/MOUNTPOINT1</MountPoint>
        <Vfs>ext3</Vfs>
        <ProtectionMode>1</ProtectionMode>
    </IBM.AgFileSystemAttributes>

    <IBM.AgFileSystemAttributes name="FileSystem2">
        <DeviceName>/dev/DEVICE2</DeviceName>
        <MountPoint>/MOUNTPOINT2</MountPoint>
        <Vfs>ext3</Vfs>
        <ProtectionMode>1</ProtectionMode>
    </IBM.AgFileSystemAttributes>

    <IBM.ServiceIPAttributes name="ServiceIP1">
        <IPAddress>10.10.10.15</IPAddress>
        <NetMask>255.255.255.0</NetMask>
        <ProtectionMode>1</ProtectionMode>
    </IBM.ServiceIPAttributes>

    <MoveGroup name="apache1" class="IBM.Application">
        <ClassAttributesReference>
            <IBM.ApplicationAttributes name="Application1"/>
        </ClassAttributesReference>
        <Members>
            <ConstituentResource name="apache1" class="IBM.Application" node="node1" />
            <ConstituentResource name="apache1" class="IBM.Application" node="node2" />
        </Members>
    </MoveGroup>

    <MoveGroup name="local_mount" class="IBM.AgFileSystem">
        <ClassAttributesReference>
            <IBM.AgFileSystemAttributes name="FileSystem2"/>
        </ClassAttributesReference>
        <Members>
            <ConstituentResource name="local_mount" class="IBM.AgFileSystem" node="node1" />
            <ConstituentResource name="local_mount" class="IBM.AgFileSystem" node="node2" />
        </Members>
    </MoveGroup>

    <MoveGroup name="ha-ip-address" class="IBM.ServiceIP">
        <ClassAttributesReference>
            <IBM.ServiceIPAttributes name="ServiceIP1"/>
        </ClassAttributesReference>
        <Members>
            <ConstituentResource name="ha-ip-address" class="IBM.ServiceIP" node="node1" />
            <ConstituentResource name="ha-ip-address" class="IBM.ServiceIP" node="node2" />
        </Members>
    </MoveGroup>

    <ResourceGroup class="IBM.ResourceGroup" name="WebServerGroup">
        <DesiredState>Online</DesiredState>
        <InfoLink>www.apache.com</InfoLink>
        <Members>
            <MoveGroup name="apache1" class="IBM.Application"/>
            <MoveGroup name="local_mount" class="IBM.AgFileSystem"/>
            <MoveGroup name="ha-ip-address" class="IBM.ServiceIP"/>
            <ResourceReference name="harvestedFS"/>
        </Members>
    </ResourceGroup>

    <Relationship name="apache1DependsOnLocal_mount">
        <Source>
            <MoveGroup name="apache1" class="IBM.Application"/>
        </Source>
        <Target>
            <MoveGroup name="local_mount" class="IBM.AgFileSystem"/>
        </Target>
        <Type>DependsOn</Type>
        <Condition>None</Condition>
    </Relationship>

    <Relationship name="apache1DependsOnHa-ip-address">
        <Source>
            <MoveGroup name="apache1" class="IBM.Application"/>
        </Source>
        <Target>
            <MoveGroup name="ha-ip-address" class="IBM.ServiceIP"/>
        </Target>
        <Type>DependsOn</Type>
        <Condition>None</Condition>
    </Relationship>

    <ResourceReference name="harvestedFS">
        <ReferencedResource>
            <Class>IBM.AgFileSystem</Class>
            <Name>23f45d546</Name>
            <Node></Node>
        </ReferencedResource>
    </ResourceReference>

</AutomationPolicy>