HP Insight Orchestration 6.0 User Guide

The name PhysicalServerPolicyCheck.applyFitting in the figure indicates the entry point
or hook for the physical server fitting process.
The enabled flag, enables or disables the rule-based fitting for this hook.
The <policy-rule-file> provides the list of rule files to apply during the fitting process.
When the customizable allocation process initiates, Insight Orchestration reads the policy.xml file and
uses this information to locate the fitting process to use by referencing the corresponding hook status. If the
hook is enabled, the hook uses the rule-based fitting process, otherwise it continues to use the default fitting
process.
You must restart Insight Orchestration to reflect any changes made to the policy file.
Rule file
A rule file is typically a text file with a .drl extension. In a .drl file, you can have multiple rules, queries,
and functions, as well as resource declarations assigned and used by the rules and queries. You can also
separate your rules into multiple rule files to help manage large numbers of rules.
The overall structure of a rule file is:
package package-name
imports
globals
functions
queries
rules
The order in which the elements are declared is not important, except for the package name. If you declare
a package name, it must be the first element in the rule file.
Example: Rule to verify server memory criteria
package com.hp.hpio.controller.policy;
import java.util.List;
import java.lang.Integer;
import com.hp._2007.ess.sw.model.infrastructureutilityschema.LogicalServer;
import com.hp._2007.ess.sw.model.infrastructureutilityschema.ComputeServer;
import com.hp.hpio.controller.wrapper.LogicalServerWrapper;
import com.hp.hpio.common.messages.HPIOBundleKey;
import com.hp.hpio.common.messages.HPIOMessage;
dialect "java" // Since we are using Java syntax with drools
/*
* INIT should be the first rule in a drl file which inserts service
* entity, resource list and result map into working memory by reading
48 Insight Orchestration provisioning and allocation