From 2ca61ad9e8028a3c5e5393fdafa11b563efcc9d5 Mon Sep 17 00:00:00 2001 From: Victor Hu Date: Mon, 14 Nov 2016 13:27:27 -0500 Subject: [PATCH] Support noboot on interfaces that are tagged vlan on the mangement node --- xCAT-server/lib/xcat/plugins/mknb.pm | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/mknb.pm b/xCAT-server/lib/xcat/plugins/mknb.pm index 9e68b6887..16721de47 100644 --- a/xCAT-server/lib/xcat/plugins/mknb.pm +++ b/xCAT-server/lib/xcat/plugins/mknb.pm @@ -74,8 +74,27 @@ sub process_request { } my $nicips = xCAT::NetworkUtils->get_nic_ip(); foreach (keys %nobootnics) { - if (defined($nicips->{$_})) { - $nobootnicips{$nicips->{$_}} = 1; + # looping on each nics that has 'noboot' configured + print "DEBUG ==> Interface $_ is set to 'noboot'\n"; + if (defined($nicips)) { + foreach my $nicipkey (keys $nicips) { + if ( $nicipkey =~ "@" ) { + # If VLAN tagging is in use on this management node, the interface name is taken + # from 'ip addr show' command and will contain the physical interface: + # enP1p12s0f0.2@enP1p12s0f0 + if ($nicipkey =~ m/$_\@/i ) { + print "DEBUG ---- FOUND ---- Interface name $_ is part of $nicipkey, IP=$nicips->{$nicipkey}!\n"; + if (defined($nicips->{$nicipkey})) { + $nobootnicips{$nicips->{$nicipkey}} = 1; + } + } + } else { + # Non VLAN case + if (defined($nicips->{$_})) { + $nobootnicips{$nicips->{$_}} = 1; + } + } + } } } }