From 7d3aa32f859d5de6cd3bb5e17215235ed3bbfff1 Mon Sep 17 00:00:00 2001 From: phamt Date: Thu, 15 Nov 2012 19:59:56 +0000 Subject: [PATCH] Added chhypervisor --smapi option for z/VM. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@14342 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/zvm.pm | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/zvm.pm b/xCAT-server/lib/xcat/plugins/zvm.pm index 750447a63..689f9f8c6 100644 --- a/xCAT-server/lib/xcat/plugins/zvm.pm +++ b/xCAT-server/lib/xcat/plugins/zvm.pm @@ -5424,8 +5424,9 @@ sub changeHypervisor { $out = "Resetting SMAPI... Done"; } - # Get disk pool names + # diskpoolnames elsif ( $args->[0] eq "--diskpoolnames" ) { + # Get disk pool names # If the cache directory does not exist if (!(`ssh $hcp "test -d $cache && echo Exists"`)) { # Create cache directory @@ -5456,8 +5457,9 @@ sub changeHypervisor { $out = `ssh $hcp "cat $file"`; } - # Get zFCP disk pool names + # zfcppoolnames elsif ( $args->[0] eq "--zfcppoolnames") { + # Get zFCP disk pool names # Go through each zFCP pool my @pools = split("\n", `ssh $hcp "ls $::ZFCPPOOL"`); foreach (@pools) { @@ -5466,8 +5468,9 @@ sub changeHypervisor { } } - # Get disk pool configuration + # diskpool [pool] [all|free|used] elsif ( $args->[0] eq "--diskpool" ) { + # Get disk pool configuration my $pool = $args->[1]; my $space = $args->[2]; @@ -5481,8 +5484,9 @@ sub changeHypervisor { } } - # Get zFCP disk pool configuration + # zfcppool [pool] [space] elsif ( $args->[0] eq "--zfcppool" ) { + # Get zFCP disk pool configuration my $pool = lc($args->[1]); my $space = $args->[2]; @@ -5494,7 +5498,7 @@ sub changeHypervisor { } } - # Get FCP channels + # fcpchannels [active|free|offline|agent] elsif ( $args->[0] eq "--fcpchannels" ) { # Display the status of real FCP Adapter devices # i.e. query fcp active|free|offline|agent @@ -5513,18 +5517,29 @@ sub changeHypervisor { } } - # Get network names + # getnetworknames elsif ( $args->[0] eq "--getnetworknames" ) { $out = xCAT::zvmCPUtils->getNetworkNames($hcp); } - # Get network + # getnetwork [name] elsif ( $args->[0] eq "--getnetwork" ) { my $netName = $args->[1]; $out = xCAT::zvmCPUtils->getNetwork( $hcp, $netName ); } + # smapi [api] [args] + elsif ( $args->[0] eq "--smapi" ) { + # Invoke SMAPI API directly through zHCP smcli + my $str = "@{$args}"; + $str =~ s/$args->[0]//g; + $str = xCAT::zvmUtils->trimStr($str); + + # Pass arguments directly to smcli + $out = `ssh $hcp "$::DIR/smcli $str"`; + } + # Otherwise, print out error else { xCAT::zvmUtils->printLn( $callback, "$node: (Error) Option not supported" );