VMware: filter VMs of Same name on the basis of folder (#65922)
vmware_guest now filters VMs of same name on the basis of additional information of folder.
This commit is contained in:
parent
50eb4eec90
commit
4769d731ac
2 changed files with 7 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- Vmware Fix for Create overwrites a VM of same name even when the folder is different(https://github.com/ansible/ansible/issues/43161)
|
|
@ -1053,6 +1053,10 @@ class PyVmomi(object):
|
||||||
break
|
break
|
||||||
elif vms:
|
elif vms:
|
||||||
# Unique virtual machine found.
|
# Unique virtual machine found.
|
||||||
|
actual_vm_folder_path = self.get_vm_path(content=self.content, vm_name=vms[0])
|
||||||
|
if self.params.get('folder') is None:
|
||||||
|
vm_obj = vms[0]
|
||||||
|
elif self.params['folder'] in actual_vm_folder_path:
|
||||||
vm_obj = vms[0]
|
vm_obj = vms[0]
|
||||||
elif 'moid' in self.params and self.params['moid']:
|
elif 'moid' in self.params and self.params['moid']:
|
||||||
vm_obj = VmomiSupport.templateOf('VirtualMachine')(self.params['moid'], self.si._stub)
|
vm_obj = VmomiSupport.templateOf('VirtualMachine')(self.params['moid'], self.si._stub)
|
||||||
|
|
Loading…
Reference in a new issue