2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-22 03:32:04 +00:00

Clear key words for install status update log message (#5618)

- detect provisioning when updateing status to installing/netbooting
- consistent message format "xcat.updatestatus - ($node): changing status=($status)" (no need to log the time as syslog has the timestamp)
This commit is contained in:
bxuxa 2018-11-27 14:06:12 +08:00
parent 27d7212ee4
commit cc6cb0f217
2 changed files with 14 additions and 5 deletions

View File

@ -627,7 +627,7 @@ sub getNodeStatusFromNodesetState {
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: {alive=>["node1", "node1"], unreachable=>["node5","node100"]}
for example: {alive=>["node1", "node2"], unreachable=>["node5","node100"]}
force -- 1 force the input values to be set.
-- 0 make sure if the input value is the next valid value.
Returns:
@ -637,7 +637,7 @@ sub getNodeStatusFromNodesetState {
#--------------------------------------------------------------------------------
sub setNodeStatusAttributes {
print "monitorctrl::setNodeStatusAttributes called\n";
#print "monitorctrl::setNodeStatusAttributes called\n";
my $temp = shift;
if ($temp =~ /xCAT_monitoring::monitorctrl/) {
$temp = shift;
@ -703,8 +703,12 @@ sub setNodeStatusAttributes {
if (@$nodes > 0) {
$updates{'status'} = $_;
$updates{'statustime'} = $currtime;
my $nodestate = "@$nodes status: $updates{'status'} statustime: $updates{'statustime'}";
xCAT::MsgUtils->message('S', "$nodestate");
#my $nodestate = "@$nodes status: $updates{'status'} statustime: $updates{'statustime'}";
foreach my $node (@$nodes) {
# To make the log clear, iterate for each node. This might be potential performance issue!
my $nodestate = "xcat.updatestatus - $node: changing status=$updates{'status'}";
xCAT::MsgUtils->message('S', "$nodestate");
}
my $where_clause;
my $dbname = xCAT::Utils->get_DBName();

View File

@ -509,7 +509,12 @@ sub do_installm_service {
node => [$node],
arg => ["$newstat"],
);
xCAT::MsgUtils->trace(0, "I", "xcatd: triggering \'updatenodestat $node $newstat\'...");
# TODO, better to use constant here for the specified status
if ($newstat eq 'installing') {
xCAT::MsgUtils->trace(0, "I", "xcat.updatestatus - $node: provisioning detected...");
} elsif ($newstat eq 'netbooting') {
xCAT::MsgUtils->trace(0, "I", "xcat.updatestatus - $node: provisioning detected...");
}
# node should be blocked, race condition may occur otherwise
#my $pid=xCAT::Utils->xfork();
#unless ($pid) { # fork off the nodeset and potential slowness