prepare for the new node status for xCAT

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2191 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
linggao 2008-09-17 19:06:45 +00:00
parent 9cac93c6a5
commit d6e89916a6
7 changed files with 21 additions and 14 deletions

View File

@ -25,8 +25,15 @@ $::NODETYPE_HMC="hmc";
$::NODETYPE_IVM="ivm";
# valid values for nodelist.status columns or other status
$::STATUS_ACTIVE="active";
$::STATUS_INACTIVE="inactive";
$::STATUS_ACTIVE="alive";
$::STATUS_INACTIVE="unreachable";
$::STATUS_INSTALLING="installing";
$::STATUS_INSTALLED="installed";
$::STATUS_BOOTING="booting";
$::STATUS_NETBOOTING="netbooting";
$::STATUS_BOOTED="booted";
$::STATUS_POWERING_OFF="powering-off";
$::STATUS_DISCOVERING="discovering";
$::STATUS_UNKNOWN="unknown";
1;

View File

@ -263,7 +263,7 @@ nodelist => {
descriptions => {
node => 'The hostname of a node in the cluster.',
groups => "A comma-delimited list of groups this node is a member of. Group names are arbitrary, except all nodes should be part of the 'all' group.",
status => 'The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, discovering, installing, installed, alive, off.',
status => 'The current status of this node. This attribute will be set by xCAT software. Valid values: defined, booting, netbooting, booted, discovering, installing, installed, alive, powering-off, unreachable. The default value is defined. The possible status change sequenses are: defined->[discovering]->installing->installed->alive, defined->netbooting->booted->alive, alive/unreachable->booting->alive, alive->powering-off->unreachable, alive->unreachable',
comments => 'Any user-written notes.',
disable => "Set to 'yes' or '1' to comment out this row.",
},

View File

@ -193,7 +193,7 @@ sub start {
nodes-- an array of nodes.
Returns:
a hash that has the node status. The format is:
{active=>[node1, node3,...], unreachable=>[node4, node2...]}
{alive=>[node1, node3,...], unreachable=>[node4, node2...]}
=cut
#--------------------------------------------------------------------------------
sub pingNodeStatus {

View File

@ -61,8 +61,8 @@ if ($cond_name eq "NodeReachability") {
exit 1;
}
my $status_string;
if ($status == 1) { $status_string="active"; }
else { $status_string="inactive"; }
if ($status == 1) { $status_string="alive"; }
else { $status_string="unreachable"; }
my $result=`$::XCATROOT/bin/nodech $node nodelist.status=$status_string 2>&1`;
my $code=$?;

View File

@ -539,7 +539,7 @@ sub processMonitoringTableChanges {
Arguments:
status -- a hash pointer of the node status. A key is a status string. The value is
an array pointer of nodes that have the same status.
for example: {active=>["node1", "node1"], inactive=>["node5","node100"]}
for example: {alive=>["node1", "node1"], unreachable=>["node5","node100"]}
Returns:
0 for successful.
non-0 for not successful.
@ -581,7 +581,7 @@ sub setNodeStatusAttributes {
none.
Returns:
a hash that has the node status. The format is:
{active=>[node1, node3,...], unreachable=>[node4, node2...], unknown=>[node8, node101...]}
{alive=>[node1, node3,...], unreachable=>[node4, node2...], unknown=>[node8, node101...]}
=cut
#--------------------------------------------------------------------------------
sub getNodeStatus {
@ -821,7 +821,7 @@ sub getNodeMonServerPair {
Returns:
A hash reference keyed by the monitoring server nodes and each value is a ref to
an array of [nodes, nodetype, status] arrays monitored by the server. So the format is:
{monserver1=>[['node1', 'osi', 'active'], ['node2', 'switch', 'booting']...], ...}
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is a pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
@ -913,7 +913,7 @@ sub getMonHierarchy {
Returns:
A hash reference keyed by the monitoring server nodes and each value is a ref to
an array of [nodes, nodetype, status] arrays monitored by the server. So the format is:
{monserver1=>[['node1', 'osi', 'active'], ['node2', 'switch', 'booting']...], ...}
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is a pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node
@ -976,7 +976,7 @@ sub getMonServerWithInfo {
Returns:
A hash reference keyed by the monitoring server nodes and each value is a ref to
an array of [nodes, nodetype, status] arrays monitored by the server. So the format is:
{monserver1=>[['node1', 'osi', 'active'], ['node2', 'switch', 'booting']...], ...}
{monserver1=>[['node1', 'osi', 'alive'], ['node2', 'switch', 'booting']...], ...}
A key is a pair of hostnames with the first one being the service node ip/hostname
that faces the mn and the second one being the service node ip/hostname that faces the cn.
The value of the first one can be "noservicenode" meaning that there is no service node

View File

@ -273,7 +273,7 @@ sub deconfig {
none.
Returns:
a hash that has the node status. The format is:
{active=>[node1, node3,...], unreachable=>[node4, node2...], unknown=>[node8, node101...]}
{alive=>[node1, node3,...], unreachable=>[node4, node2...], unknown=>[node8, node101...]}
=cut
#--------------------------------------------------------------------------------
sub getMonNodesStatus {
@ -328,7 +328,7 @@ sub getMonNodesStatus {
Arguments:
status -- a hash pointer of the node status. A key is a status string. The value is
an array pointer of nodes that have the same status.
for example: {active=>["node1", "node1"], inactive=>["node5","node100"]}
for example: {alive=>["node1", "node1"], unreachable=>["node5","node100"]}
Returns:
0 for successful.
non-0 for not successful.

View File

@ -71,7 +71,7 @@ if (keys(%node_status) > 0) {
nodes-- an array of nodes.
Returns:
a hash that has the node status. The format is:
{active=>[node1, node3,...], unreachable=>[node4, node2...]}
{alive=>[node1, node3,...], unreachable=>[node4, node2...]}
=cut
#--------------------------------------------------------------------------------
sub pingNodeStatus {