Ansible - vmware_vm_inventory dynamic inventory plugin

If you are not familiar with static inventory vs. dynamic inventory, and dynamic inventory plugins vs. dynamic inventory scripts, check out Ansible - Getting Started with Dynamic Inventory.

The ansible-doc command can be used to display documentation on the vmware_vm_inventory plugin.

ansible-doc --type inventory --snippet vmware_vm_inventory


Before using the vmware_vm_inventory plugin, you must have the following:

  • a VMWare ESXi contoller
  • vCenter

If you do not have pip installed, following the direction in Installing PIP on Linux CentOS. Then, use pip to install pyVmomi, setuptools and vSphere Automation SDK.

pip3 install pyVmomi
pip3 install --upgrade pip setuptools
pip3 install --upgrade git+


The pip list command can be used to ensure the packages were installed.

pip3 list

Package                            Version
---------------------------------- ------------------
ansible                            2.9.12
certifi                            2020.6.20
cffi                               1.14.2
chardet                            3.0.4
cryptography                       3.0
idna                               2.10
Jinja2                             2.11.2
lxml                               4.5.2
MarkupSafe                         1.1.1
pip                                20.2.2
pycparser                          2.20
pyOpenSSL                          19.1.0
pyvmomi                            7.0
PyYAML                             5.3.1
requests                           2.24.0
setuptools                         49.6.0
six                                1.15.0
suds-jurko                         0.6
urllib3                            1.25.10
vapi-client-bindings               3.3.0
vapi-common-client                 2.15.0
vapi-runtime                       2.15.0
vmc-client-bindings                1.26.0
vmc-draas-client-bindings          1.10.0
vSphere-Automation-SDK             1.32.0


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 69590 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |