2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-11 14:00:17 +00:00

Remove dhcp entry for x86_64 node when nodeset offline is issued

This commit is contained in:
Mark Gurevich
2016-07-11 15:12:13 -04:00
parent 861e60b3e0
commit 05f2832e7d

View File

@@ -18,7 +18,7 @@ my $globaltftpdir = xCAT::TableUtils->getTftpDir();
#my $dhcpver = 3;
my %usage = (
"nodeset" => "Usage: nodeset <noderange> [shell|boot|runcmd=bmcsetup|iscsiboot|osimage[=<imagename>]|offline]",
"nodeset" => "Usage: nodeset <noderange> [shell|boot|runcmd=bmcsetup|osimage[=<imagename>]|offline]",
);
sub handled_commands {
return {
@@ -76,7 +76,8 @@ sub getstate {
chomp($headline);
return $headline;
} else {
return "boot";
# There is no boot configuration file, node must be offline
return "offline";
}
} else {
return "discover";
@@ -531,6 +532,7 @@ sub process_request {
my $linuximgtab=xCAT::Table->new('linuximage',-create=>1);
my %machash = %{$mactab->getNodesAttribs(\@nodes,[qw(mac)])};
my @makedhcp_nodes;
foreach (@nodes) {
my $tftpdir;
if ($nrhash{$_}->[0] and $nrhash{$_}->[0]->{tftpdir}) {
@@ -565,9 +567,14 @@ sub process_request {
unlink($tftpdir."/xcat/xnba/nodes/".$_.".pxelinux");
unlink($tftpdir."/xcat/xnba/nodes/".$_.".uefi");
unlink($tftpdir."/xcat/xnba/nodes/".$_.".elilo");
push(@makedhcp_nodes, $_);
}
}
}
# for offline operation, remove the dhcp entries
if ($args[0] eq 'offline') {
$sub_req->({ command => ['makedhcp'],arg=>['-d'],node => \@makedhcp_nodes }, $::XNBA_callback);
}
#dhcp stuff -- inittime is set when xcatd on sn is started