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

Get vm_info from moid, uuid or instance_uuid #2178

Open
sdfk209fj opened this issue Sep 19, 2024 · 0 comments
Open

Get vm_info from moid, uuid or instance_uuid #2178

sdfk209fj opened this issue Sep 19, 2024 · 0 comments

Comments

@sdfk209fj
Copy link

SUMMARY

Rather than getting VM solely by its name, add the ability to get vm_info by a unique identifier. Currently the only way to do this is to get all VMs, store them into a variable and loop through them for a matching unique identifier.

ISSUE TYPE
  • Add a parameter to get a VM by its moid, uuid or instance_uuid
COMPONENT NAME

community.vmware.vmware_vm_info

ADDITIONAL INFORMATION
- name: Gather one specific VM by moid
  community.vmware.vmware_vm_info:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    moid: "{{ vm_moid}}"
  register: vm_info

- name: Gather one specific VM by uuid
  community.vmware.vmware_vm_info:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    uuid: 422d000d-2000-ffff-0000-b00000000000

- name: Gather one specific VM by instance_uuid
  community.vmware.vmware_vm_info:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    instance_uuid: '{{ vm_instance_uuid}}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant