Operating Environment Software Instruction Manual

// in case of failure.
eval(customRule1($logicalSubnet, $subnet, $pVO));
/* --------------- CUSTOM LOGIC ------------------ */
then
/* --------------- CUSTOM LOGIC ------------------ */
// Since this is a custom rule/criteria construct HPIO message
// using ALLOCATION_CRITERIA_CUSTOM bundle key and providing
// allocation failure message (string) to be displayed. In case
// this rule fails. NOTE same information should be used while
// calling doesNotMatch in the custom function below.
$pVO.match($subnet, HPIOMessage.get(HPIOBundleKey.ALLOCATION_CRITERIA_CUSTOM, Failure message));
/* --------------- CUSTOM LOGIC ------------------ */
end
/*
* The function is responsible to do criteria check and return
* true/false based on the requested resource and the available
* resources.
* Initialize result map with doesNotMatch to start with, if this
* function returns success (true) then rule result map will be
* changed to match.
*
*/
function boolean customRule1(
LogicalSubnet logicalSubnet,
Subnet subnet,
PolicyExecutionVO pVO) {
// Custom message.
pVO.doesNotMatch(subnet, HPIOMessage.get(HPIOBundleKey.ALLOCATION_CRITERIA_CUSTOM, Failure message));
boolean match=true;
/* -------------- CUSTOM LOGIC ----------------------*/
/* -------------- CUSTOM LOGIC ----------------------*/
return match;
}
Deploying rules
1. Make sure that the rule file is valid (using the iopolicyassist tool).
2. Copy the validated rule file to ..\Program Files\HP\Matrix infrastructure
orchestration\conf\policy directory.
3. Wherever applicable, update the hook <policy-rule-file> information in the
policy.xml file by modifying or adding the recently defined rule file.
<policy enabled="false" name="SubnetPolicyCheck.applyFitting">
<policy-rule-file>
SubnetCheck.drl,
newrulefile.drl
</policy-rule-file>
<policy-class-name>policy-class-name</policy-class-name>
</policy>
4. Do one of the following:
To enable any policy, modify the corresponding enabled flag to true in the policy file.
To disable any policy, modify the corresponding enabled flag to false in the policy
file.
5. Restart the infrastructure orchestration Windows service for the changes to take effect.
Overview 215