-Add basic lsvm command support for VMWare hypervisors
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@6392 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
f091419332
commit
558474cdd4
@ -73,6 +73,7 @@ sub handled_commands{
|
||||
rmvm => 'nodehm:mgt',
|
||||
rinv => 'nodehm:mgt',
|
||||
chvm => 'nodehm:mgt',
|
||||
lsvm => 'hypervisor:type',
|
||||
rmhypervisor => 'hypervisor:type',
|
||||
#lsvm => 'nodehm:mgt', not really supported yet
|
||||
};
|
||||
@ -135,7 +136,7 @@ sub preprocess_request {
|
||||
|
||||
my $vmtabhash = $vmtab->getNodesAttribs($noderange,['host']);
|
||||
foreach my $node (@$noderange){
|
||||
if ($command eq "rmhypervisor") {
|
||||
if ($command eq "rmhypervisor" or $command eq 'lsvm') {
|
||||
$hyp_hash{$node}{nodes} = [$node];
|
||||
} else {
|
||||
my $ent = $vmtabhash->{$node}->[0];
|
||||
@ -420,6 +421,8 @@ sub do_cmd {
|
||||
generic_vm_operation(['config.name','config','runtime.host'],\&inv,@exargs);
|
||||
} elsif ($command eq 'rmhypervisor') {
|
||||
generic_hyp_operation(\&rmhypervisor,@exargs);
|
||||
} elsif ($command eq 'lsvm') {
|
||||
generic_hyp_operation(\&lsvm,@exargs);
|
||||
} elsif ($command eq 'mkvm') {
|
||||
generic_hyp_operation(\&mkvms,@exargs);
|
||||
} elsif ($command eq 'chvm') {
|
||||
@ -1402,6 +1405,19 @@ sub rmhypervisor_inmaintenance {
|
||||
}
|
||||
}
|
||||
|
||||
sub lsvm {
|
||||
my %args = @_;
|
||||
my $hyp = $args{hyp};
|
||||
$hyphash{$hyp}->{hostview} = get_hostview(hypname=>$hyp,conn=>$hyphash{$hyp}->{conn}); #,properties=>['config','configManager']);
|
||||
use Data::Dumper;
|
||||
my @vms = @{$hyphash{$hyp}->{hostview}->vm};
|
||||
foreach (@vms) {
|
||||
my $vmv = $hyphash{$hyp}->{conn}->get_view(mo_ref=>$_);
|
||||
sendmsg($vmv->name,$hyp);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
sub rmhypervisor {
|
||||
my %args = @_;
|
||||
my $hyp = $args{hyp};
|
||||
|
Loading…
x
Reference in New Issue
Block a user