diff --git a/changelogs/fragments/vmware_gather_facts_instance_uuid.yaml b/changelogs/fragments/vmware_gather_facts_instance_uuid.yaml new file mode 100644 index 00000000000..50aab8b7569 --- /dev/null +++ b/changelogs/fragments/vmware_gather_facts_instance_uuid.yaml @@ -0,0 +1,2 @@ +minor_changes: +- Updated virtual machine facts with instanceUUID which is unique for each VM irrespective of name and BIOS UUID. diff --git a/lib/ansible/module_utils/vmware.py b/lib/ansible/module_utils/vmware.py index e9ad9472cb5..829c2f85465 100644 --- a/lib/ansible/module_utils/vmware.py +++ b/lib/ansible/module_utils/vmware.py @@ -291,6 +291,7 @@ def gather_vm_facts(content, vm): 'hw_guest_ha_state': None, 'hw_is_template': vm.config.template, 'hw_folder': None, + 'instance_uuid': vm.config.instanceUuid, 'guest_tools_status': _get_vm_prop(vm, ('guest', 'toolsRunningStatus')), 'guest_tools_version': _get_vm_prop(vm, ('guest', 'toolsVersion')), 'guest_question': vm.summary.runtime.question,