From 13978e61d0f7d0a816b1ab14d23e94365cfcba47 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Thu, 16 Sep 2010 19:28:25 +0000 Subject: [PATCH] -ESX enhancements, clonevm works git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7480 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/VMCommon.pm | 2 +- xCAT-server/lib/xcat/plugins/esx.pm | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/perl-xCAT/xCAT/VMCommon.pm b/perl-xCAT/xCAT/VMCommon.pm index a7f99ba43..803be34a0 100644 --- a/perl-xCAT/xCAT/VMCommon.pm +++ b/perl-xCAT/xCAT/VMCommon.pm @@ -26,7 +26,7 @@ sub grab_table_data{ #grab table data relevent to VM guest nodes if ($vpdtab) { $cfghash->{vpd} = $vpdtab->getNodesAttribs($noderange,['uuid']); } - $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','storagemodel','memory','cpus','nics','nicmodel','bootorder','virtflags','master']); + $cfghash->{vm} = $vmtab->getNodesAttribs($noderange,['node','host','migrationdest','cfgstore','storage','storagemodel','memory','cpus','nics','nicmodel','bootorder','virtflags','datacenter','master']); my $mactab = xCAT::Table->new("mac",-create=>1); my $nrtab= xCAT::Table->new("noderes",-create=>1); $cfghash->{mac} = $mactab->getAllNodeAttribs(['mac'],1); diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index fe6601099..58c9794cf 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -1720,9 +1720,13 @@ sub clone_vms_from_master { $destination=$masterent->{storage}; $vment->{storage}=$destination; } + unless (defined $hyphash{$hyp}->{pool}) { + $hyphash{$hyp}->{pool} = $hyphash{$hyp}->{conn}->get_view(mo_ref=>$hyphash{$hyp}->{hostview}->parent,properties=>['resourcePool'])->resourcePool; + } my $relocatespec = VirtualMachineRelocateSpec->new( datastore=>$hyphash{$hyp}->{datastorerefmap}->{$destination}, - diskMoveType=>"createNewChildDiskBacking", + #diskMoveType=>"createNewChildDiskBacking", #fyi, requires a snapshot, which isn't compatible with templates, moveChildMostDiskBacking would potentially be fine, but either way is ha incopmatible and limited to 8, arbitrary limitations hard to work around... + pool=>$hyphash{$hyp}->{pool}, ); my $clonespec = VirtualMachineCloneSpec->new( location=>$relocatespec,