From aa83596560a91ec159d37bdf306ad7b079851fe9 Mon Sep 17 00:00:00 2001 From: Jia Zhao Date: Mon, 5 Aug 2013 19:00:42 +0800 Subject: [PATCH] fix noderegenips scalability problem --- xCAT-server/lib/xcat/plugins/00kitnodebase.pm | 5 +++-- xCAT-server/lib/xcat/plugins/profilednodes.pm | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm index 1c9d81578..ea985c236 100644 --- a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm +++ b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm @@ -106,8 +106,9 @@ sub process_request { # Stage1: pre-run if ($command eq 'kitnoderefresh') { - # This is due to once update nicips table, we need remove node's records first and then re-create by run make* commands. - push @commandslist, ['kitnoderemove', '']; + # This is due to once update nicips table, we need remove node's records first and then re-create by run make* commands. If not, old records can't be removed. + push @commandslist, ['makedns', '-d']; + push @commandslist, ['makehosts', '-d']; } # Stage2: run xcat commands diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index 961f05c11..f2325559a 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -957,13 +957,13 @@ Usage: $chaintab->close(); # Remove all nodes information - push(@kitcommands, "kitnoderemove"); + push(@kitcommands, "removenodes"); # Add all nodes information back push(@kitcommands, "kitnodeadd"); } elsif ( $fsp_flag ) { # Remove all nodes information - push(@kitcommands, "kitnoderemove"); + push(@kitcommands, "removenodes"); # Add all nodes information back push(@kitcommands, "kitnodeadd"); } else { @@ -972,7 +972,17 @@ Usage: #10. Call plugins. foreach my $command (@kitcommands) { - my $retref = xCAT::Utils->runxcmd({command=>[$command], node=>$nodes, sequential=>[1]}, $request_command, 0, 2); + my $retref; + if ($command eq 'removenodes'){ + # Not run makedns -d as it costs too much time + #setrsp_progress("Updating DNS entries"); + #$retref = xCAT::Utils->runxcmd({command=>["makedns"], node=>$nodes, arg=>['-d']}, $request_command, 0, 2); + + #setrsp_progress("Updating hosts entries"); + $retref = xCAT::Utils->runxcmd({command=>["makehosts"], node=>$nodes, arg=>['-d']}, $request_command, 0, 2); + next; + } + $retref = xCAT::Utils->runxcmd({command=>[$command], node=>$nodes, sequential=>[1]}, $request_command, 0, 2); my $retstrref = parse_runxcmd_ret($retref); if ($::RUNCMD_RC != 0){ setrsp_progress("Warning: failed to call kit commands.");