Added chhypervisor --smapi option for z/VM.
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.7@14342 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
		| @@ -5422,8 +5422,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 | ||||
| @@ -5454,8 +5455,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) { | ||||
| @@ -5464,8 +5466,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]; | ||||
|  | ||||
| @@ -5479,8 +5482,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]; | ||||
|  | ||||
| @@ -5492,7 +5496,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 | ||||
| @@ -5511,18 +5515,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" ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user