fulfill the requirement of defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node.
This commit is contained in:
parent
9d98e4c170
commit
b7ce4802a1
@ -1867,6 +1867,38 @@ sub getPostScripts
|
||||
}
|
||||
|
||||
|
||||
#for redhat 7, append "disableconsistentNICrename" to default postscripts
|
||||
#if "net.ifnames=0" is specified in kcmdline/addkcmdline of node or osimage
|
||||
my $tftpdir = xCAT::TableUtils::getTftpDir();
|
||||
my $osimagetab=xCAT::Table->new('osimage',-create=>1);
|
||||
my $osimgent = $osimagetab->getAttribs({imagename => $osimgname },'osvers');
|
||||
my $os = $osimgent->{'osvers'};
|
||||
my $nrret = $::GLOBAL_TAB_HASH{noderes}{$node};
|
||||
my $netboot = $nrret->{'netboot'};
|
||||
|
||||
if( ($os =~ "rhel7*") || ($os =~ "rhels7*") )
|
||||
{
|
||||
my $nodecfg;
|
||||
if($netboot eq "grub2")
|
||||
{
|
||||
$nodecfg="$tftpdir/boot/grub2/$node";
|
||||
}elsif($netboot eq "xnba")
|
||||
{
|
||||
$nodecfg="$tftpdir/xcat/xnba/nodes/$node";
|
||||
|
||||
}elsif($netboot eq "pxe")
|
||||
{
|
||||
$nodecfg="$tftpdir/pxelinux.cfg/$node";
|
||||
|
||||
}
|
||||
|
||||
my $rc=system("grep net.ifnames=0 $nodecfg >/dev/null 2>&1");
|
||||
if($rc ==0)
|
||||
{
|
||||
$result .= "disableconsistentNICrename\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user