Ansible provides various modules to manage VMware infrastructure, which includes datacenter, cluster, host system and virtual machine.
Ansible VMware modules are written on top of pyVmomi. pyVmomi is the Python SDK for the VMware vSphere API that allows user to manage ESX, ESXi, and vCenter infrastcture. You can install pyVmomi using pip:
$ pip install pyvmomi
The :ref:vmware_guest <vmware_guest>module is used to manage various operations related to virtual machines in the given ESXi or vCenter server.
folder
was an optional parameter with a default value of /vm
. The folder parameterStarting with Ansible version 2.5, folder
is still an optional parameter with no default value.
This parameter will be now used to identify a user’s virtual machine, if multiple virtual machines or virtual
machine templates are found with same name. VMware does not restrict the system administrator from creating virtual
machines with same name.
When debugging or creating a new issue, you will need information about your VMware infrastructure. You can get this information using govc, For example:
$ export GOVC_USERNAME=ESXI_OR_VCENTER_USERNAME
$ export GOVC_PASSWORD=ESXI_OR_VCENTER_PASSWORD
$ export GOVC_URL=https://ESXI_OR_VCENTER_HOSTNAME:443
$ govc find /
See also