From 66d12f6f1e520dceac91be5c96efb18772f42e5e Mon Sep 17 00:00:00 2001 From: Evert Mulder Date: Mon, 15 Jul 2019 10:47:13 +0200 Subject: [PATCH] Only convert VirtualDiskFix for #57653 clone_with_convert is failing --- lib/ansible/modules/cloud/vmware/vmware_guest.py | 2 +- test/integration/targets/vmware_guest/tasks/main.yml | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index 1c903114f6b..c27997505e5 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -2214,7 +2214,7 @@ class PyVmomiHelper(PyVmomi): # Convert disk present in template if is set if self.params['convert']: for device in vm_obj.config.hardware.device: - if hasattr(device.backing, 'fileName'): + if isinstance(device, vim.vm.device.VirtualDisk): disk_locator = vim.vm.RelocateSpec.DiskLocator() disk_locator.diskBackingInfo = vim.vm.device.VirtualDisk.FlatVer2BackingInfo() if self.params['convert'] in ['thin']: diff --git a/test/integration/targets/vmware_guest/tasks/main.yml b/test/integration/targets/vmware_guest/tasks/main.yml index a54b0df8d79..d1b4775b0fb 100644 --- a/test/integration/targets/vmware_guest/tasks/main.yml +++ b/test/integration/targets/vmware_guest/tasks/main.yml @@ -91,9 +91,8 @@ setup_virtualmachines: true - block: - include: boot_firmware_d1_c1_f0.yml - # Failing, see: https://github.com/ansible/ansible/issues/57653 - # - include: clone_with_convert.yml - # - include: clone_customize_guest_test.yml + - include: clone_with_convert.yml + - include: clone_customize_guest_test.yml - include: max_connections.yml - include: mem_reservation.yml always: