fulfill the requirement of defect #4242 In physical rhel7 env,set installnic=ethx can not provision compute node.
This commit is contained in:
parent
e8d48b81e0
commit
33fd485628
@ -1865,6 +1865,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