From db43394393b53b7e522fb50c6f9b47e52c0b1651 Mon Sep 17 00:00:00 2001 From: phamt Date: Tue, 27 Mar 2012 13:14:11 +0000 Subject: [PATCH] Added dedicated disk support in nodeset for RH. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@12019 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/zvmUtils.pm | 43 +++++++++++++++++++++++++++++ xCAT-server/lib/xcat/plugins/zvm.pm | 20 ++++++++++++-- 2 files changed, 60 insertions(+), 3 deletions(-) diff --git a/perl-xCAT/xCAT/zvmUtils.pm b/perl-xCAT/xCAT/zvmUtils.pm index aeaf711d8..0dfe0d7b5 100644 --- a/perl-xCAT/xCAT/zvmUtils.pm +++ b/perl-xCAT/xCAT/zvmUtils.pm @@ -641,6 +641,49 @@ sub getMdisks { #------------------------------------------------------- +=head3 getDedicates + + Description : Get the DEDICATE statements in the user entry of a given node + Arguments : Node + Returns : DEDICATE statements + Example : my @dedicates = xCAT::zvmUtils->getDedicates($callback, $node); + +=cut + +#------------------------------------------------------- +sub getDedicates { + + # Get inputs + my ( $class, $callback, $node ) = @_; + + # Directory where executables are + my $dir = '/opt/zhcp/bin'; + + # Get HCP + my @propNames = ( 'hcp', 'userid' ); + my $propVals = xCAT::zvmUtils->getNodeProps( 'zvm', $node, @propNames ); + my $hcp = $propVals->{'hcp'}; + + # Get node userID + my $userId = $propVals->{'userid'}; + + my $out = `ssh $hcp "$dir/getuserentry $userId" | grep "DEDICATE"`; + + # Get DEDICATE statements + my @lines = split( '\n', $out ); + my @dedicates; + foreach (@lines) { + $_ = xCAT::zvmUtils->trimStr($_); + + # Save MDISK statements + push( @dedicates, $_ ); + } + + return (@dedicates); +} + +#------------------------------------------------------- + =head3 getUserEntryWODisk Description : Get the user entry of a given node without MDISK statments, diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 157ed6623..2b79ee42f 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -634,7 +634,7 @@ sub changeVM { my $ping = `pping $node`; if (!($ping =~ m/noping/i)) { $out .= `ssh $hcp "$::DIR/add3390active $userId $addr $mode"`; - } + } $out = xCAT::zvmUtils->appendHostname( $node, $out ); } @@ -3787,7 +3787,7 @@ sub nodeSet { # Close sample parmfile close(SAMPLEPARM); - # Get mdisk address + # Get mdisk virtual address my @mdisks = xCAT::zvmUtils->getMdisks( $callback, $node ); my $dasd = ""; my $i = 0; @@ -3798,8 +3798,22 @@ sub nodeSet { # Do not put a comma at the end of the last disk address if ( $i == @mdisks ) { $dasd = $dasd . "0.0.$words[1]"; + } else { + $dasd = $dasd . "0.0.$words[1],"; } - else { + } + + # Get dedicated virtual address + my @dedicates = xCAT::zvmUtils->getDedicates( $callback, $node ); + $i = 0; + foreach (@dedicates) { + $i = $i + 1; + @words = split( ' ', $_ ); + + # Do not put a comma at the end of the last disk address + if ( $i == @dedicates ) { + $dasd = $dasd . "0.0.$words[1]"; + } else { $dasd = $dasd . "0.0.$words[1],"; } }