community.vmware.vmware_deploy_ovf module – Deploys a VMware virtual machine from an OVF or OVA file
Note
This module is part of the community.vmware collection (version 2.10.2).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.vmware
.
To use it in a playbook, specify: community.vmware.vmware_deploy_ovf
.
Synopsis
This module can be used to deploy a VMware VM from an OVF or OVA file
Parameters
Parameter |
Comments |
---|---|
Whether or not to allow duplicate VM names. ESXi allows duplicates, vCenter may not. Choices:
|
|
Cluster to deploy to. This is a required parameter, if
This parameter is case sensitive. |
|
Datacenter to deploy to. Default: |
|
Datastore to deploy to. Default: |
|
The key of the chosen deployment option. |
|
Disk provisioning type. Choices:
|
|
The ESXi hostname where the virtual machine will run. This is a required parameter, if
This parameter is case sensitive. |
|
Cause the module to treat OVF Import Spec warnings as errors. Choices:
|
|
Absolute path of folder to place the virtual machine. If not specified, defaults to the value of Examples:
|
|
The hostname or IP address of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. |
|
Force the given properties to be inserted into an OVF Environment and injected through VMware Tools. Choices:
|
|
Name of the VM to work with. Virtual machine names in vCenter are not necessarily unique, which may be problematic. |
|
Default: |
|
Path to OVF or OVA file to deploy. |
|
The password of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. |
|
The port number of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. Default: |
|
Whether or not to power on the virtual machine after creation. Choices:
|
|
The assignment of values to the properties found in the OVF as key value pairs. |
|
Address of a proxy that will receive all HTTPS requests and relay them. The format is a hostname or a IP. If the value is not specified in the task, the value of environment variable This feature depends on a version of pyvmomi greater than v6.7.1.2018.12 |
|
Port of the HTTP proxy that will receive all HTTPS requests and relay them. If the value is not specified in the task, the value of environment variable |
|
Resource Pool to deploy to. Default: |
|
The username of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. If set to Choices:
|
|
Wait for the host to power on. Choices:
|
|
Wait until vCenter detects an IP address for the VM. This requires vmware-tools (vmtoolsd) to properly work after creation. Choices:
|
Notes
Note
All modules requires API write access and hence is not supported on a free ESXi license.
Examples
- community.vmware.vmware_deploy_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
ovf: /path/to/ubuntu-16.04-amd64.ovf
wait_for_ip_address: true
delegate_to: localhost
# Deploys a new VM named 'NewVM' in specific datacenter/cluster, with network mapping taken from variable and using ova template from an absolute path
- community.vmware.vmware_deploy_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: Datacenter1
cluster: Cluster1
datastore: vsandatastore
name: NewVM
networks: "{u'VM Network':u'{{ ProvisioningNetworkLabel }}'}"
power_on: no
ovf: /absolute/path/to/template/mytemplate.ova
delegate_to: localhost
- community.vmware.vmware_deploy_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter: Datacenter1
esxi_hostname: test-server
datastore: test-datastore
ovf: /path/to/ubuntu-16.04-amd64.ovf
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
metadata about the new virtual machine Returned: always Sample: |