diff --git a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm index ca2711826..4440bcab5 100644 --- a/xCAT-server/lib/xcat/plugins/00kitnodebase.pm +++ b/xCAT-server/lib/xcat/plugins/00kitnodebase.pm @@ -92,6 +92,7 @@ sub process_request { my @commandslist; my %argslist; + my $noupdate_flag = 0; my %msghash = ( "makehosts" => "Updating hosts entries", "makedns" => "Updating DNS entries", "makedhcp" => "Update DHCP entries", @@ -145,7 +146,7 @@ sub process_request { if ($chainarray[0]){ if($chainarray[0] =~ m/^osimage=/) { - $chainarray[0] = $chainarray[0] . " --noupdateinitrd"; + $noupdate_flag = 1; } push @commandslist, ['nodeset', $chainarray[0]]; } @@ -154,7 +155,7 @@ sub process_request { if ($isfsp) { my $cmmref = xCAT::ProfiledNodeUtils->get_nodes_cmm($nodelist); my @cmmchassis = keys %$cmmref; - + push @commandslist, ['rspconfig', 'network=*']; push @commandslist, ['rscan', '-u']; push @commandslist, ['mkhwconn', '-t']; @@ -164,18 +165,26 @@ sub process_request { }elsif ($command eq 'kitnodeupdate') { my $firstnode = (@$nodelist)[0]; if (exists $profilehash{$firstnode}{"ImageProfile"}){ - my $osimage = 'osimage='.$profilehash{$firstnode}{"ImageProfile"}.' --noupdateinitrd'; + my $osimage = 'osimage='.$profilehash{$firstnode}{"ImageProfile"}; + $noupdate_flag = 1; push @commandslist, ['nodeset', $osimage]; } } - + # Run commands foreach (@commandslist) { my $current_cmd = $_->[0]; my $current_args = $_->[1]; setrsp_progress($msghash{$current_cmd}); $retref = ""; - $retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, 0, 2); + if(($current_cmd eq "nodeset") && $noupdate_flag) + { + $retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args, "--noupdateinitrd"]}, $request_command, 0, 2); + } + else + { + $retref = xCAT::Utils->runxcmd({command=>[$current_cmd], node=>$nodelist, arg=>[$current_args]}, $request_command, 0, 2); + } log_cmd_return($retref); } diff --git a/xCAT-server/lib/xcat/plugins/destiny.pm b/xCAT-server/lib/xcat/plugins/destiny.pm index 538cda78b..71cc52fa2 100644 --- a/xCAT-server/lib/xcat/plugins/destiny.pm +++ b/xCAT-server/lib/xcat/plugins/destiny.pm @@ -576,13 +576,18 @@ sub nextdestiny { my %requ; $requ{node}=[$node]; $requ{arg}=[$ref->{currstate}]; + if($ref->{currstate} =~ /noupdateinitrd$/) + { + my @items = split /[:]/,$ref->{currstate}; + $requ{arg}= \@items; + } setdestiny(\%requ, $flag+1); } if ($callnodeset) { $subreq->({command=>['nodeset'], node=> \@nodes, - arg=>['enact']}); + arg=>['enact', '--noupdateinitrd']}); } } diff --git a/xCAT-server/lib/xcat/plugins/profilednodes.pm b/xCAT-server/lib/xcat/plugins/profilednodes.pm index ce03f9436..863ebb8a2 100644 --- a/xCAT-server/lib/xcat/plugins/profilednodes.pm +++ b/xCAT-server/lib/xcat/plugins/profilednodes.pm @@ -1790,11 +1790,11 @@ sub gen_new_hostinfo_dict{ if (exists $chain->{'chain'}) { my $hardwareprofile_chain = $chain->{'chain'}; - $hostinfo_dict{$item}{"chain"} = $hardwareprofile_chain.',osimage='.$provmethod; + $hostinfo_dict{$item}{"chain"} = $hardwareprofile_chain.',osimage='.$provmethod.":--noupdateinitrd"; } else { - $hostinfo_dict{$item}{"chain"} = 'osimage='.$provmethod; + $hostinfo_dict{$item}{"chain"} = 'osimage='.$provmethod.":--noupdateinitrd"; } if (exists $netprofileattr{"bmc"}){ # Update BMC records.