From 25a83a4ac803a0ef1c6aa3bd2e6d8095e4ff1f7c Mon Sep 17 00:00:00 2001 From: balonik Date: Fri, 2 Feb 2018 10:14:15 +0100 Subject: [PATCH] Make vmware_guest always get a resource pool (#34995) --- lib/ansible/modules/cloud/vmware/vmware_guest.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index 6c2d6930c14..13315e19fbc 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -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: