community.vmware.vmware_content_deploy_ovf_template – Deploy Virtual Machine from ovf template stored in content library.
Note
This plugin is part of the community.vmware collection (version 1.17.0).
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_content_deploy_ovf_template
.
Synopsis
Module to deploy virtual machine from ovf template in content library.
All variables and VMware object names are case sensitive.
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
PyVmomi
vSphere Automation SDK
Parameters
Parameter |
Comments |
---|---|
Name of the cluster in datacenter in which to place deployed VM. |
|
Name of the datacenter, where VM to be deployed. |
|
Name of the datastore to store deployed VM and disk. |
|
Name of the datastore cluster housing a datastore to store deployed VM and disk. If datastore is not specified, the recommended datastore from this cluster will be used. |
|
Name of the folder in datacenter in which to place deployed VM. Default: “vm” |
|
Name of the ESX Host in datacenter in which to place deployed VM. The host has to be a member of the cluster that contains the resource pool. |
|
The hostname or IP address of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
The name of the content library from where the template resides. |
|
The level of logging desired in this module. Choices:
|
|
The name of the VM to be deployed. |
|
The password of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
The port number of the vSphere vCenter. If the value is not specified in the task, the value of environment variable Default: 443 |
|
The connection to protocol. Choices:
|
|
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 |
|
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 |
|
Name of the resourcepool in datacenter in which to place deployed VM. |
|
Default storage provisioning type to use for all sections of type vmw:StorageSection in the OVF descriptor. Choices:
|
|
The name of OVF template from which VM to be deployed. |
|
The username of the vSphere vCenter server. If the value is not specified in the task, the value of environment variable |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Choices:
|
Examples
- name: Deploy Virtual Machine from OVF template in content library
community.vmware.vmware_content_deploy_ovf_template:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
ovf_template: rhel_test_template
datastore: Shared_NFS_Volume
folder: vm
datacenter: Sample_DC_1
name: Sample_VM
resource_pool: test_rp
delegate_to: localhost
- name: Deploy Virtual Machine from OVF template in content library with eagerZeroedThick storage
vmware_content_deploy_ovf_template:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
ovf_template: rhel_test_template
datastore: Shared_NFS_Volume
folder: vm
datacenter: Sample_DC_1
name: Sample_VM
resource_pool: test_rp
storage_provisioning: eagerZeroedThick
delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
Virtual machine deployment message and vm_id Returned: on success Sample: {“msg”: “Deployed Virtual Machine \u0027Sample_VM\u0027.”, “vm_id”: “vm-1009”} |
Authors
Lev Goncharv (@ultral)