From 624bbefa5cb5b18229bd30a9f4ad20e78d858af1 Mon Sep 17 00:00:00 2001 From: phamt Date: Fri, 17 Feb 2012 15:42:50 +0000 Subject: [PATCH] Set active configuration when adding NIC and coupling to LAN or VSWITCH. Also, set active configuration when adding MDISK. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11611 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 37be6d429..78617d4dd 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -614,7 +614,7 @@ sub changeVM { $userId =~ tr/a-z/A-Z/; # Output string - my $out; + my $out = ""; # add3390 [disk pool] [device address] [cylinders] [mode] [read password] [write password] [multi password] # [read password] [write password] [multi password] are optional @@ -627,7 +627,11 @@ sub changeVM { my $writePw = $args->[6]; my $multiPw = $args->[7]; + # Add to directory entry $out = `ssh $hcp "$::DIR/add3390 $userId $pool $addr $cyl $mode $readPw $writePw $multiPw"`; + + # Add to active configuration + $out .= `ssh $hcp "$::DIR/add3390active $userId $addr $mode"`; $out = xCAT::zvmUtils->appendHostname( $node, $out ); } @@ -692,7 +696,10 @@ sub changeVM { my $devcount = $args->[3]; # Add to active configuration - $out = `ssh $node "vmcp define nic $addr type $type"`; + my $ping = `pping $node`; + if ($ping =~ m/ping/i) { + $out = `ssh $node "vmcp define nic $addr type $type"`; + } # Add to directory entry $out .= `ssh $hcp "$::DIR/addnic $userId $addr $type $devcount"`; @@ -731,10 +738,13 @@ sub changeVM { my $addr = $args->[1]; my $lan = $args->[2]; my $owner = $args->[3]; - + # Connect to LAN in active configuration - $out = `ssh $node "vmcp couple $addr to $owner $lan"`; - + my $ping = `pping $node`; + if ($ping =~ m/ping/i) { + $out = `ssh $node "vmcp couple $addr to $owner $lan"`; + } + $out .= `ssh $hcp "$::DIR/connectnic2guestlan $userId $addr $lan $owner"`; $out = xCAT::zvmUtils->appendHostname( $node, $out ); } @@ -747,9 +757,12 @@ sub changeVM { # Grant access to VSWITCH for Linux user $out = "Granting access to VSWITCH for $userId\n "; $out .= `ssh $hcp "vmcp set vswitch $vswitch grant $userId"`; - + # Connect to VSwitch in active configuration - $out .= `ssh $node "vmcp couple $addr to system $vswitch"`; + my $ping = `pping $node`; + if ($ping =~ m/ping/i) { + $out .= `ssh $node "vmcp couple $addr to system $vswitch"`; + } # Connect to VSwitch in directory entry $out .= `ssh $hcp "$::DIR/connectnic2vswitch $userId $addr $vswitch"`;