Creating and managing host attributes for job affinity
Manage host attributes for job affinity with the battr command.
Procedure
-
Use the battr create command to create host attributes.
battr create -m "host_name ..." [-d "description"] attr_name ...
This command creates the specified attributes on the specified hosts. Use a space to separate multiple attributes. Use the -m option to specify one or more hosts in which to create the attributes, and use a space to separate multiple hosts. You can specify the names in condensed host formats, but you cannot specify host groups, remote (lease-in) hosts, or client hosts. You can use the optional -d option to specify a description for the attributes.
battr create -m "hostA hostB" -d "Hosts in room 103" room103
-
Use the battr delete command to delete host attributes.
battr delete -m "host_name ... | all" attr_name ...
This command deletes the specified attributes from the specified hosts. Use a space to separate multiple attributes. Use the -m option to specify one or more hosts in which to create the attributes, and use a space to separate multiple hosts.
battr delete -m "hostA hostB" room103
-
Use the battr show command to show information on host attributes in the
cluster.
battr show [-w] [ -m "host_name ..."] [ -u user_name] [attr_name ...]
You can show information on all host attributes or specify one or more attributes to display. Use a space to separate multiple attributes. Use the -w option to display attribute information in a wide format without truncating fields. Use the -m option to specify one or more hosts from which to show the attributes, otherwise this command shows attributes from all hosts in the cluster. Use the -u option to show attributes that are created by the specified user.
battr show -m "hostA hostB"
- Use the bhosts -attr or bhosts -l command options to show information on attributes on the specified hosts.