From 9065b0a417d785bc2b430fc0048632305fcfd1f6 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 20 Sep 2010 19:50:43 +0000 Subject: [PATCH] -Honor vm.host placement in clonevm git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@7541 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/plugins/esx.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/esx.pm b/xCAT-server/lib/xcat/plugins/esx.pm index e5556f852..4e25fbb08 100644 --- a/xCAT-server/lib/xcat/plugins/esx.pm +++ b/xCAT-server/lib/xcat/plugins/esx.pm @@ -1961,11 +1961,13 @@ sub clone_vms_from_master { my $placement_resources=get_placement_resources(hyp=>$hyp,cluster=>$cluster,destination=>$destination); my $pool=$placement_resources->{pool}; my $dstore=$placement_resources->{datastore}; - my $relocatespec = VirtualMachineRelocateSpec->new( + my %relocatespecargs = ( datastore=>$dstore, #$hyphash{$hyp}->{datastorerefmap}->{$destination}, - #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=>$pool, - ); + #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... + ); + if ($hyp) { $relocatespecargs{host}=$hyphash{$hyp}->{hostview} } + my $relocatespec = VirtualMachineRelocateSpec->new(%relocatespecargs); my $clonespec = VirtualMachineCloneSpec->new( location=>$relocatespec, template=>0,