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
This commit is contained in:
phamt 2012-03-27 13:14:11 +00:00
parent 19bc3d77c4
commit db43394393
2 changed files with 60 additions and 3 deletions

View File

@ -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,

View File

@ -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],";
}
}