|
|
@ -1520,9 +1520,8 @@ class PyVmomiHelper(PyVmomi):
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
vm_obj = None
|
|
|
|
vm_obj = None
|
|
|
|
|
|
|
|
|
|
|
|
# need a resource pool if cloning from template
|
|
|
|
# always get a resource_pool
|
|
|
|
if self.params['resource_pool'] or self.params['template']:
|
|
|
|
resource_pool = self.get_resource_pool()
|
|
|
|
resource_pool = self.get_resource_pool()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# set the destination datastore for VM & disks
|
|
|
|
# set the destination datastore for VM & disks
|
|
|
|
(datastore, datastore_name) = self.select_datastore(vm_obj)
|
|
|
|
(datastore, datastore_name) = self.select_datastore(vm_obj)
|
|
|
@ -1598,7 +1597,6 @@ class PyVmomiHelper(PyVmomi):
|
|
|
|
vmPathName="[" + datastore_name + "]")
|
|
|
|
vmPathName="[" + datastore_name + "]")
|
|
|
|
|
|
|
|
|
|
|
|
clone_method = 'CreateVM_Task'
|
|
|
|
clone_method = 'CreateVM_Task'
|
|
|
|
resource_pool = self.get_resource_pool()
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
task = destfolder.CreateVM_Task(config=self.configspec, pool=resource_pool)
|
|
|
|
task = destfolder.CreateVM_Task(config=self.configspec, pool=resource_pool)
|
|
|
|
except vmodl.fault.InvalidRequest as e:
|
|
|
|
except vmodl.fault.InvalidRequest as e:
|
|
|
|