Bridging NDL resource descriptions to controls

Overview

Many existing ORCA controls used by authority actors rely on table-driven resource descriptions: (resource type, quantity) tuples. They also use attributes and properties. Examples of such controls are orca.policy.core.SimpleVMControl used for XX.vm resources and orca.policy.core.VlanControl used for XX.vlan resources. Controls are specified as part of resource pool specification in the actors configuration file. Originally ORCA required duplicate specification of resources in both NDL and attributes and properties in the actors configuration file.

For example the SimpleVMControl required attributes to be specified (in the config file for Eucalyptus VM site authority):

<attributes>
    <attribute>
        <key>resource.memory</key>                                                        
        <label>Memory</label>
        <value>128</value>
        <unit>MB</unit>
        <type>integer</type>
    </attribute>
     <attribute>
        <key>resource.cpu</key>
        <label>CPU</label>
        <value>1/2 of 2GHz Intel Xeon</value>
        <type>String</type>
    </attribute>
</attributes>

Similarly, VlanControl? policy requires properties that denote the upper and lower bounds on vlan tags in a particular resource pool:

    <property name="vlan.tag.start" value="2" />
    <property name="vlan.tag.end" value="1002" />

The same information was also available in the NDL-OWL resource description of the site. It was desirable to be able to bridge NDL-OWL resource descriptions to these controls in an automated fashion to reduce duplication of information.

As of Camano 3.0 ORCA implements this bridging with a set of classes in orca.network.policyhelpers package. Each policy helper subclassed from orca.network.policyhelpers.GenericNDLPoolPropertyExtractor and implements one or both of the following methods:

	public Properties getPoolProperties();
	public List <ResourcePoolAttributeDescriptor> getPoolAttributes();

The class can implement whatever appropriate NDL-OWL query functions are needed to extract the necessary attributes and properties expected by the control.

The final step is adding a new class name into the static map (from Control names to property extractor classes) maintained in orca.boot.inventory.NdlResourcePoolFactory?.java. At boot time the NDL-OWL file describing the resources of the appropriate authority will be parsed and properties and attributes will be generated and attached to the resource pool.