Fixed how MAC address prefix is obtained by using VMCP Q VMLAN instead of using VMCP Q V NIC. VMCP Q VMLAN is more accurate for z/VM 6.2 SSI clusters.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16149 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
phamt 2013-05-01 17:16:28 +00:00
parent 4f8e82198a
commit 9a672c7329

View File

@ -1090,16 +1090,23 @@ sub createMacAddr {
return -1;
}
# Get HCP MAC address
# Get the first MAC address found
my $out = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp q v nic" | grep "MAC:"`;
my @lines = split( "\n", $out );
my @vars = split( " ", $lines[0] );
# Extract MAC prefix
my $prefix = $vars[1];
$prefix = xCAT::zvmUtils->replaceStr( $prefix, "-", "" );
$prefix = substr( $prefix, 0, 6 );
# Get USER Prefix
my $prefix = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp q vmlan" | egrep -i "USER Prefix:"`;
$prefix =~ s/(.*?)USER Prefix:(.*)/$2/;
$prefix =~ s/^\s+//;
$prefix =~ s/\s+$//;
# Get MACADDR Prefix instead if USER Prefix is not defined
if (!$prefix) {
$prefix = `ssh -o ConnectTimeout=5 $user\@$hcp "$sudo /sbin/vmcp q vmlan" | egrep -i "MACADDR Prefix:"`;
$prefix =~ s/(.*?)MACADDR Prefix:(.*)/$2/;
$prefix =~ s/^\s+//;
$prefix =~ s/\s+$//;
if (!$prefix) {
return -1;
}
}
# Generate MAC address of source node
my $mac = $prefix . $suffix;