N1 Grid Service Provisioning System 5.0 Plug-in Development Guide

Limiting Hosts for a Plug-In

The N1 Grid Service Provisioning System enables you to limit plug-in behavior to hosts that match certain criteria. There are three mechanisms that you can use to limit your hosts:

You define all three host limiters in the plug-in descriptor file, as shown in the following examples.


Example 2–12 Host Type Definition in plugin-descriptor.xml File

The following example defines two host types for use with Solaris containers: one for a global zone and one for a local zone. The plug-in name is appended to the actual hostType name. When a user creates a host of type com.sun.solaris#global_zone, four attributes are provided, each attribute of which has a default value. The com.sun.solaris#local_zone host type, on the other hand, has no user-defined attributes associated with it.

<hostType name="global_zone" 
    description="a physical host from which partitioned local zones can be created"> 
  <varList>
    <var name="local_zone_base_path" default="/export/zones"/>
    <var name="local_zone_connection_type" default="RAW"/>
    <var name="local_zone_port" default="1131"/>
    <var name="local_zone_advanced_params" default=" "/>
  </varList>
    </hostType>
    <hostType name="local_zone" 
      description="a physical host that is created out of the larger global_zone"/>


Example 2–13 Host Set Definition in plugin-descriptor.xml File

The following example defines a host set that contains global zones. The actual contents of the host set are provided when the referenced host search is performed.

<hostSet name="global_zones"
     description="Solaris global zones">
<hostSearchRef name="global_zones"/>


Example 2–14 Host Search Definition in plugin-descriptor.xml File

The following example defines a host search to find all global zones. The search returns a result for any host that matches the following criteria:

<hostSearch name="global_zones" description="Solaris global zones">
  <criteriaList>
    <criteria name="sys.OS" pattern="SunOS"/>
    <criteria name="sys.OSVersion" pattern="5.10"/>
    <criteria name="sys.hostType" pattern="com.sun.solaris#global_zone"/>
  </criteriaList>
  <appTypeCriteria ra="true"/>
  <physicalCriteria physical="true"/>
</hostSearch>