Ansible VMware Dynamic Inventory: Complete Guide (2026)

By Luca Berton · Published 2024-01-01 · Category: installation

Complete guide to Ansible VMware dynamic inventory. Configure vmware.vmware.vms plugin, filter VMs, migrate from deprecated community.vmware inventory with examples.

Overview

VMware dynamic inventory plugins automatically discover virtual machines from vSphere and populate your Ansible inventory. This eliminates manual host management and keeps your inventory in sync with your virtual infrastructure.

Important: Plugin Deprecation

The community.vmware.vmware_vm_inventory plugin was deprecated in v5.4.0 and will be removed in v7.0.0. Migrate to vmware.vmware.vms for a future-proof setup.

| Plugin | Status | Collection | |--------|--------|------------| | community.vmware.vmware_vm_inventory | ⚠️ Deprecated (remove in 7.0.0) | community.vmware | | vmware.vmware.vms | ✅ Active | vmware.vmware |

Install Collections

New Plugin: vmware.vmware.vms

Basic Configuration

With Filters

Group by Datacenter/Cluster

Legacy Plugin: community.vmware

Migration Guide

Step 1: Install New Collection

Step 2: Update Inventory File

Step 3: Update Property References

Some property names differ between plugins. Test with:

Step 4: Validate Groups

Filtering VMs by Date

A common requirement is filtering VMs by creation date (e.g., VMs created in the last week):

Workaround: Post-Filter with Playbook

Using with AWX/AAP Create a VMware vCenter credential in AWX Create an inventory with Source = Sourced from a project Point to your vmware_inventory.yml file in the project Enable Update on Launch for always-fresh inventory

Credential Security

Troubleshooting

No hosts returned

SSL certificate errors

Slow inventory refresh

FAQ

When will community.vmware inventory be removed?

In community.vmware collection version 7.0.0 (expected late 2026). Start migrating now.

Can I filter by custom attributes?

Yes — use config.annotation for notes, or custom attributes via the properties list.

How often does dynamic inventory refresh?

Every time you run a playbook, unless you enable caching. In AWX/AAP, configure sync schedules.

Related ArticlesAnsible Inventory Complete GuideAnsible AWS Complete Guide

Category: installation

Browse all Ansible tutorials · AnsiblePilot Home