Skip to content

Nutanix - Dynamic inventory #344

@linuxcube

Description

@linuxcube

Hi Everyone,
Have anyone been succesfull is creating a dynamic inventory using ascender under Nutanix virtualization platform?

I have played around with the VMware plugin and it works well, but I am facing some challenges with Nutanix, I am wondering if someone had had success on that front. Thank you for your input

Below are the steps, I tried to follow but appear to be missing some things:

To configure a Nutanix dynamic inventory in the Ascender Ansible Automation Platform (AAAP)
, you should use the official Nutanix Ansible Collection (). This collection includes a dynamic inventory plugin that queries Nutanix Prism Central or Prism Element to automatically discover virtual machines.

  1. Install Prerequisites
    Your Ansible Control Machine or Execution Environment must have the necessary Python dependencies.

• Install the Collection:
ansible-galaxy collection install nutanix.ncp

• Install Python Requirements:
pip install -r ~/.ansible/collections/ansible_collections/nutanix/ncp/requirements.txt

  1. Create the Inventory Source File
    Create a YAML configuration file (e.g., ) on your local machine or within your project repository. This file tells the Nutanix plugin how to connect and filter hosts.

nutanix_inventory.yml

plugin: nutanix.ncp.ntnx_prism_vm_inventory
pc_hostname: "your_prism_central_ip"
pc_username: "admin"
pc_password: "your_password"
validate_certs: false

Optional: Group hosts by specific attributes

keyed_groups:

  • prefix: cluster
    key: cluster_name
  1. Configure in Ansible Automation Platform
    Once your inventory script/config is ready in your Git repository, follow these steps in the AAP (Controller) UI:

  2. Create Credentials: Go to Resources > Credentials and add a new credential. Choose Nutanix Prism Central as the type and enter your Nutanix login details.

  3. Add Inventory: Go to Resources > Inventories, click Add, and select Inventory. Name it (e.g., "Nutanix Dynamic Inventory") and save.

  4. Add Source:

    • Navigate to the Sources tab of your new inventory and click Add.
    • Set the Source to "Sourced from a Project".
    • Select the Project containing your file.
    • In Inventory File, select your from the dropdown.
    • Attach the Nutanix credential you created in Step 1.

  5. Sync: Save and click Sync to pull the VM list from your Nutanix environment into the AAP.

  6. Advanced Filtering (Optional)
    You can further refine which VMs are imported by adding filters to your YAML configuration:

• Fetch all VMs: Set to bypass default pagination limits.
• Filtering: Use standard Ansible inventory plugin parameters to include or exclude hosts based on power state or tags.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions