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:
Define a specific host type. The host type defines a base class of servers that is bound by a set of common attributes. For example, you might define a host type that identifies servers that are considered to be Solaris 10 global zones.
Define a host set. The host set is a logical grouping of hosts that share one or more common attributes, such as physical location or functional group. Use a host set to quickly and easily update all hosts in the set. You can also use host sets to perform install-to-install comparisons.
Define a host search. A host search queries the host database to provide a list of hosts whose attributes match those that the query specifies. You might use the host search to find all hosts that match a given host type or that run a certain application.
You define all three host limiters in the plug-in descriptor file, as shown in the following examples.
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"/>
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"/>
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:
Is running the Solaris 10 operating system
Has a host type of com.sun.solaris#global_zone
Is running a remote agent
Is a physical host, rather than a virtual host
<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>