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

[Imprv] add functionality to filter to exclude by cluster or vm names to module nutanix.ncp.ntnx_prism_vm_inventory #580

Open
mikekuhlmann opened this issue Feb 5, 2025 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mikekuhlmann
Copy link

Describe the request
We are using the nutanix.ncp v1.9.2 collection with Ansible Automation Platform v2.4 for collecting constructed inventories for our Nutanix clusters. We need help with getting the nutanix.yml file set up correctly for the ntnx_prism_vm_inventory plugin. We are looking for examples for how to filter by clustername to exclude our Virtual Desktop VMs that are in a specific cluster.

We also have a need to have the ntnx_prism_vm_inventory plugin retrieve more information from the nutanix guesttools. Is there a way to have ntnx_prism_vm_inventory retrieve the FQDN of the VM or the network domain name so we can construct our inventories using only FQDN names. I can do this with the vmware plugin and aws ec2 plugin so I would like to be able to do the same with your ntnx_prism_vm_inventory plugin.

Current behaviour
We can use the nutanix.ncp.ntnx_prism_vm_inventory with a basic nutanix.yml file to connect to Nutanix Prism and collect an inventory of all known VMs. Not all Nutanix VMs can be ssh'd to by Ansible (example: CVM VMs, VDI VMs) and we eould like to be able to filter them out from the main inventory source. Currently we need to have our users take care to not include unwanted VMs from their own constructed inventories and it has been problematic.

Expected behaviour
We would like to be able to use something like the following in the nutanix.yml file for applying filers to collected inventory from Prism:

plugin: nutanix.ncp.ntnx_prism_vm_inventory
data:
filter: "vm_name != ABC-*"
filter: "vm_name=startswith(vm_name, 'ABC-')"
filter: "cluster != cluster010"
offset: 0
length: 10000
use_extra_vars: true
strict: false
...

@mikekuhlmann mikekuhlmann added the enhancement New feature or request label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants