You can use collectors, manifests, and selectors together
to choose a server resource at run time for a project or step.
Three different data objects allow the system to dynamically choose
servers:
- A collector is an object that defines the set of properties
that the system collects from or assigns to a server resource. The
system runs a collector when it checks a server resource's properties.
The collected property values are stored in a manifest.
- A manifest is a list of the properties for a specific server.
It contains the results from running a collector.
- A selector is a list of properties and comparisons such
as MEM_TOTAL = 512. The system can compare the properties of a selector
with a manifest to see if a server meets the requirements for a particular
selector. Projects and steps specify a selector as one of their properties.
When the project or step runs, the selector is compared to the manifest
of all defined server resources to choose the server resource to run
on.
The following example shows how to create and use a simple selector:
- Create a server resource named Mercury and associate it with an
agent.
- Create a selector named Mercury. Set it to selects servers with
BF_NAME = Mercury.
- Create a project named Lincoln. Assign the Mercury selector to
it.
When you run the Lincoln project, the system selects the server
resource named Mercury. If that server resource is not available,
the project fails.
The following example shows how to set up dynamic server selection
in a set of servers:
- Create a collector named RAMSIZE. Set it to collect the Built-in
property MEM_TOTAL.
- Create server resources to associate with hosts. Set each one
to use collector RAMSIZE.
- Mercury, a host with 512 MB RAM
- Mars, a host with 1 GB RAM
- Jupiter, a host with 3 GB RAM
- Create a selector named BigRam. Set it to select a Standard Property,
property=MEM_TOTAL, Operator=GE (Greater than or Equal), and Value=2048.
MEM_TOTAL is expressed in MB. This selector selects only hosts that
have 2 GB of RAM or more.
- Create a selector named SmallRam. Set it to select a Standard
Property, property=MEM_TOTAL, Operator=GE (Greater than or Equal),
and Value=256. This selector selects only hosts that have 256 MB
of RAM or more.
- Create two projects:
- HighMaint: set this project to use selector BigRam.
- LowMaint: set this project to use selector SmallRam.
When you run HighMaint, the system chooses the server Jupiter,
because it is the only one that meets the selector requirement of
having at least 2 GB of RAM.
When you run LowMaint, the system chooses any of the three server
resources that is available.
If you later add a server resource named Neptune for a host that
has 2 GB RAM, then the next time project HighMaint runs, one of either
Neptune or Jupiter is selected for the project. If Jupiter is down
for some reason, then Neptune is selected. It is the only one left
that fits the selector.