HP XC System Software Administration Guide Version 3.1
Example 4-1 Sample gconfig Script: Client Selection and Client-to-Server Assignment
my($service) = 'my_new_service';
sub gconfigure
{
my(@servers) = @_;
cs_reset_service($service,@servers);
1
my($client_flags) = ''; # "all selected nodes", default
2
my($assignment_flags) = ''; # "client may be assigned to itself", default
3
# Make a server set from the server list
my($serverset) = Set::Node->select_by_name(@servers);
4
# Get my client list
# Client list is "all nodes"
my($clientset) = cs_get_all_clients
5
($service,$serverset,$client_flags);
# Assign client nodes to server nodes and modify database
my(%map) = cs_assign_clients_to_servers
6
($service,$serverset,$clientset, $assignment_flags);
}
1
This instruction clears any previous client/server assignments for this service in the database.
2
The $client_flags are used by cs_get_all_clients(...) to include or to exclude specific
nodes as clients. The default is all selected nodes (that is, exclude none).
Service attributes for client selection are as follows:
• sa_no_client_on_server
The clients are all nodes except for the nodes in the server set. The servers are not also clients.
• sa_clients_match_servers
The client set is exactly the same as the server set.
• sa_clients_are_servers_of.service
The clients of this service are the same set as the servers of some related service.
• sa_all_selected_nodes
This is the default, which is the same as the double quote character (“); it means all nodes of the
HP XC system.
3
The $assignment_flags are used to determine the pattern of the client-to-server assignments. The
default is a server may be assigned to itself as a client. The following service
attributes control a client's assignment to itself as a server and are valid for client and server
assignments:
• sa_do_not_assign_to_self
• sa_must_assign_to_self
• sa_may_assign_to_self
This is the default, which is the same as the double quote character (“).
The following service attributes are valid for client and server assignment patterns:
• sa_block
Assigns equal (as equal as practical) contiguous blocks of client nodes to each server subject to
the additional assign to self specification.
• sa_block_cyclic.N - (for example, sa_block_cyclic.8)
Assigns a contiguous block of N client nodes to each server in round-robin style, subject to the
additional assign to self specification.
• sa_cyclic
Is the same as sa_block_cyclic with N = 1, assigning round-robin one client at a time,
subject to the additional assign to self specification.
Writing gconfigure Scripts 65