From 42dc03a9638e75fc9338b429b4fd4501c317af7a Mon Sep 17 00:00:00 2001 From: phamt Date: Fri, 17 Feb 2012 15:13:59 +0000 Subject: [PATCH] Set active configuration when adding NIC and coupling to LAN or VSWITCH. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@11610 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 8824bc782..37be6d429 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -691,7 +691,11 @@ sub changeVM { my $type = $args->[2]; my $devcount = $args->[3]; - $out = `ssh $hcp "$::DIR/addnic $userId $addr $type $devcount"`; + # Add to active configuration + $out = `ssh $node "vmcp define nic $addr type $type"`; + + # Add to directory entry + $out .= `ssh $hcp "$::DIR/addnic $userId $addr $type $devcount"`; $out = xCAT::zvmUtils->appendHostname( $node, $out ); } @@ -727,8 +731,11 @@ 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"`; - $out = `ssh $hcp "$::DIR/connectnic2guestlan $userId $addr $lan $owner"`; + $out .= `ssh $hcp "$::DIR/connectnic2guestlan $userId $addr $lan $owner"`; $out = xCAT::zvmUtils->appendHostname( $node, $out ); } @@ -737,13 +744,16 @@ sub changeVM { my $addr = $args->[1]; my $vswitch = $args->[2]; - # Connect to VSwitch - $out = `ssh $hcp "$::DIR/connectnic2vswitch $userId $addr $vswitch"`; - # Grant access to VSWITCH for Linux user - $out .= "Granting access to VSWITCH for $userId\n "; + $out = "Granting access to VSWITCH for $userId\n "; $out .= `ssh $hcp "vmcp set vswitch $vswitch grant $userId"`; - $out = xCAT::zvmUtils->appendHostname( $node, $out ); + + # Connect to VSwitch in active configuration + $out .= `ssh $node "vmcp couple $addr to system $vswitch"`; + + # Connect to VSwitch in directory entry + $out .= `ssh $hcp "$::DIR/connectnic2vswitch $userId $addr $vswitch"`; + $out = xCAT::zvmUtils->appendHostname( $node, $out ); } # copydisk [target address] [source node] [source address] @@ -3195,6 +3205,9 @@ sub nodeSet { # Get autoyast/kickstart template my $tmpl = "$profile.$osBase.$arch.tmpl"; + + # Also check for $profile.$os.$arch.tmpl + # Get host IP and hostname from /etc/hosts $out = `cat /etc/hosts | grep "$node "`;