Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

community.vmware.vmware_vm_info does not provide instance_UUID of vm #1805

Closed
Marx1st opened this issue Jul 20, 2023 · 3 comments · Fixed by #1814
Closed

community.vmware.vmware_vm_info does not provide instance_UUID of vm #1805

Marx1st opened this issue Jul 20, 2023 · 3 comments · Fixed by #1814
Labels
feature_request New feature or request python3

Comments

@Marx1st
Copy link

Marx1st commented Jul 20, 2023

SUMMARY

The community.vmware.vmware_vm_info module returns a UUID that corresponds to bios_UUID instead of the expected instance_UUID.

ISSUE TYPE
  • Bug Report
COMPONENT NAME

community.vmware.vmware_vm_info

ANSIBLE VERSION
ansible [core 2.13.10]
  config file = /etc/ansible/playbooks/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.8/dist-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.8.10 (default, May 26 2023, 14:05:08) [GCC 9.4.0]
  jinja version = 3.1.2
  libyaml = True
COLLECTION VERSION
# /usr/local/lib/python3.8/dist-packages/ansible_collections
Collection       Version
---------------- -------
community.vmware 2.10.2

# /root/.ansible/collections/ansible_collections
Collection       Version
---------------- -------
community.vmware 3.8.0

CONFIGURATION
DEFAULT_LOAD_CALLBACK_PLUGINS(/etc/ansible/playbooks/ansible.cfg) = True
DEFAULT_LOG_PATH(/etc/ansible/playbooks/ansible.cfg) = /etc/ansible/playbooks/logs/ansible.log
DEFAULT_PRIVATE_KEY_FILE(/etc/ansible/playbooks/ansible.cfg) = /etc/ansible/ssh/id_rsa
DEFAULT_ROLES_PATH(/etc/ansible/playbooks/ansible.cfg) = ['/etc/ansible/playbooks/roles']
DEFAULT_STDOUT_CALLBACK(/etc/ansible/playbooks/ansible.cfg) = yaml
DEFAULT_VAULT_PASSWORD_FILE(/etc/ansible/playbooks/ansible.cfg) = /etc/ansible/playbooks/secrets/zim.secret
HOST_KEY_CHECKING(/etc/ansible/playbooks/ansible.cfg) = False
OS / ENVIRONMENT

Ubuntu 22.04

STEPS TO REPRODUCE
      - name: Get UUID from given VM Name
        community.vmware.vmware_vm_info:
          hostname: "REDACTED"
          username: 'REDACTED'
          password: '{{ ansibleapi_vsphere }}'
          validate_certs: false
          vm_name: "REDACTED"
        delegate_to: localhost
        register: vm_info

      - name: Print VM UUID
        debug:
          var: vm_info.virtual_machines[0].uuid

EXPECTED RESULTS

I would expect to receive the instance_UUID instead of the bios_UUID or both values.

ACTUAL RESULTS

The uuid containd the bios_UUID.

TASK [Print VM UUID] *************************************************************************************************************************
task path: /etc/ansible/playbooks/zim/zabbix_link_templates_new.yml:54
ok: [REDACTED] =>
  vm_info.virtual_machines[0].uuid: 4220f091-0306-26f9-e481-da71806e33da
@Marx1st Marx1st changed the title community.vmware.vmware_vm_info does o community.vmware.vmware_vm_info does not provide instance_UUID of vm Jul 20, 2023
@ansibullbot
Copy link

Files identified in the description:
None

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug needs_triage Needs a first human triage before being processed. python3 labels Jul 20, 2023
@mariolenz mariolenz added feature_request New feature or request and removed bug This issue/PR relates to a bug needs_triage Needs a first human triage before being processed. labels Jul 20, 2023
@mariolenz
Copy link
Collaborator

@Marx1st It looks like the module returns uuid from VirtualMachineConfigSummary(vim.vm.Summary.ConfigSummary). This is indeed documented as Virtual machine BIOS identification. We're very close to naming in the API here.

Do you want the instanceUuid from there, is this correct?

  1. We won't change this, it might be breaking things for other users.
  2. We could easily add a new instance_uuid or similar to the output. This wouldn't be breaking, so we can do it whenever we like. However, we're facing some problems in the CI at the moment so I'm not sure when we have a chance to implement this.

@Marx1st
Copy link
Author

Marx1st commented Jul 20, 2023

Hi @mariolenz ! Yes, we do need the instanceUuid as this is the only unique id for a vm in a clustered environment: https://blogs.vmware.com/vsphere/2012/02/uniquely-identifying-virtual-machines-in-vsphere-and-vcloud-part-1-overview.html
It would be absolutely great if you could add instance_uuid to the output! :)

softwarefactory-project-zuul bot pushed a commit that referenced this issue Jul 30, 2023
vmware_vm_info: Add instance_uuid

SUMMARY
Fixes #1805
Add instance_uuid to the result of vmware_vm_info.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
vmware_vm_info
ADDITIONAL INFORMATION
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature_request New feature or request python3
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants