vmware.vmware.deploy_content_library_ovf module – Deploy a virtual machine from an OVF in a content library.
Note
This module is part of the vmware.vmware collection (version 1.11.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 vmware.vmware
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: vmware.vmware.deploy_content_library_ovf
.
Synopsis
Create a VM based on an OVF in a content library.
The module basis idempotentency on if the deployed VM exists or not, not the storage or deployment spec applied at deployment time.
Requirements
The below requirements are needed on the host that executes this module.
vSphere Automation SDK
aiohttp
Parameters
Parameter |
Comments |
---|---|
The name of the cluster where the VM should be deployed. Changing this option will not result in the VM being redeployed (it does not affect idempotency). One and only one of |
|
The name of the datacenter to use when searching for and deploying resources. |
|
Name of the datastore to store deployed VM and disk.
|
|
Name of the datastore cluster to store deployed VM and disk. Please make sure Storage DRS is active for recommended datastore from the given datastore cluster. If Storage DRS is not enabled, datastore with largest free storage space is selected.
|
|
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 ID of the content library where the template exists. This is an optional parameter, but may be required if you use This option is mutually exclusive with |
|
The ID of content library template to use when deploying the VM. This option is mutually exclusive with One of either |
|
The name of content library template to use when deploying the VM. This option is mutually exclusive with One of either |
|
The name of the content library where the template exists. This is an optional parameter, but may be required if you use This option is mutually exclusive with |
|
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 server. If the value is not specified in the task, the value of environment variable Default: |
|
The 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 |
|
The 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 |
|
The proxy connection protocol to use. This option is used if the correct proxy protocol cannot be automatically determined. Choices:
|
|
The name of a resource pool into which the virtual machine should be deployed. Changing this option will not result in the VM being redeployed (it does not affect idempotency). One and only one of |
|
Default storage provisioning type to use for all sections of type vmw:StorageSection in the OVF descriptor. Choices:
|
|
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:
|
|
Virtual machine folder into which the virtual machine should be deployed. This can be the absolute folder path, or a relative folder path under /<datacenter>/vm/. See the examples for more info. This option is required if you have more than one VM with the same name in the datacenter. Changing this option will result in the VM being redeployed, since it affects where the module looks for the deployed VM. If not provided, the /<datacenter>/vm/ folder is used. |
|
The name of the VM to deploy. If you have multiple VMs with the same name, you should also supply |
Notes
Note
All modules require API write access and hence are not supported on a free ESXi license.
All variables and VMware object names are case sensitive.
Modules may rely on the ‘requests’ python library, which does not use the system certificate store by default. You can specify the certificate store by setting the REQUESTS_CA_BUNDLE environment variable. Example: ‘export REQUESTS_CA_BUNDLE=/path/to/your/ca_bundle.pem’
See Also
See also
- vmware.vmware.deploy_content_library_template
Deploy a virtual machine from a template in a content library.
- vmware.vmware.deploy_folder_template
Deploy a VM from a template located in a folder.
Examples
- name: Create Virtual Machine From OVF Template
vmware.vmware.deploy_content_library_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
library_item_name: mytemplate
library_name: mylibrary
vm_name: myvm
datacenter: DC01
datastore: DS01
resource_pool: RP01
- name: Create Virtual Machine Using Absolute Folder Destination
vmware.vmware.deploy_content_library_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
library_item_name: mytemplate
library_name: mylibrary
vm_name: myvm
datacenter: DC01
datastore: DS01
folder: /DC01/vm/my/deploys
- name: Create Virtual Machine Using Relative Folder Destination
vmware.vmware.deploy_content_library_ovf:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
library_item_name: mytemplate
library_name: mylibrary
vm_name: myvm
datacenter: DC01
datastore: DS01
folder: my/deploys
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
The MOID of the deployed VM Returned: when state is present Sample: |
|
The name of the vm, as specified by the input parameter vm_name Returned: always Sample: |