Stressed About Managing Multiple Clouds? We've Got Your Back!
I am reusing code from [url=https://github.com/mbach04/nutanix_vm_provisioner]https://github.com/mbach04/nutanix_vm_provisioner[/url] Currently working on provisioning k8s cluster on nutanix - I will put it on github once I am happy with it.
[user=68336]itguyadam[/user] - Thanks for reply! I eventually figured out how to do it (Couldn't find any documentation about filters) [code]- import_tasks: get_session_cookie.yml - name: Get VMS list uri: url: "{{ api_url_v3 }}/vms/list" body: kind: vm sort_order: ASCENDING offset: 0 length: 1000 sort_attribute: '' filter: "cluster_name=={{ cluster_name }}" method: POST validate_certs: no body_format: json status_code: 200 headers: Cookie: "{{ session_cookie }}" register: vms_result [/code]
Hey [user=68336]itguyadam[/user] - I am trying to list VMs on specific cluster using ansible - Currently, I am listing all the VMs and then filtering based on cluster_name. Is there better way where I could pass cluster_name as filter and get VMs only on that particular cluster ? TIA
Already have an account? Login
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.