From e729ad56a003f3de04a86b4ba11079741d42dd03 Mon Sep 17 00:00:00 2001 From: Jose Angel Munoz Date: Mon, 25 Feb 2019 10:13:53 +0100 Subject: [PATCH] Fixing VMWare Guest Disk Creation when Using Template (#52676) --- lib/ansible/modules/cloud/vmware/vmware_guest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index 344cc78e0d..4ef73678a6 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -1818,8 +1818,8 @@ class PyVmomiHelper(PyVmomi): if 'filename' in expected_disk_spec and expected_disk_spec['filename'] is not None: self.add_existing_vmdk(vm_obj, expected_disk_spec, diskspec, scsi_ctl) continue - elif vm_obj is None: - # We are creating new VM + elif vm_obj is None or self.params['template']: + # We are creating new VM or from Template diskspec.fileOperation = vim.vm.device.VirtualDeviceSpec.FileOperation.create # which datastore?