mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Make vmware_guest always get a resource pool (#34995)
This commit is contained in:
parent
f04d40640e
commit
25a83a4ac8
1 changed files with 2 additions and 4 deletions
|
@ -1520,9 +1520,8 @@ class PyVmomiHelper(PyVmomi):
|
|||
else:
|
||||
vm_obj = None
|
||||
|
||||
# need a resource pool if cloning from template
|
||||
if self.params['resource_pool'] or self.params['template']:
|
||||
resource_pool = self.get_resource_pool()
|
||||
# always get a resource_pool
|
||||
resource_pool = self.get_resource_pool()
|
||||
|
||||
# set the destination datastore for VM & disks
|
||||
(datastore, datastore_name) = self.select_datastore(vm_obj)
|
||||
|
@ -1598,7 +1597,6 @@ class PyVmomiHelper(PyVmomi):
|
|||
vmPathName="[" + datastore_name + "]")
|
||||
|
||||
clone_method = 'CreateVM_Task'
|
||||
resource_pool = self.get_resource_pool()
|
||||
try:
|
||||
task = destfolder.CreateVM_Task(config=self.configspec, pool=resource_pool)
|
||||
except vmodl.fault.InvalidRequest as e:
|
||||
|
|
Loading…
Reference in a new issue