Deploy Virtual Machine from template stored in content library.
- Module to deploy virtual machine from template in content library.
- Content Library feature is introduced in vSphere 6.0 version.
- vmtx templates feature is introduced in vSphere 67U1 and APIs for clone template from content library in 67U2.
- This module does not work with vSphere version older than 67U2.
- All variables and VMware object names are case sensitive.
The below requirements are needed on the host that executes this module.
- vSphere Automation SDK
- name: Deploy Virtual Machine from template in content library
community.vmware.vmware_content_deploy_template:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
template: rhel_test_template
datastore: Shared_NFS_Volume
folder: vm
datacenter: Sample_DC_1
name: Sample_VM
resource_pool: test_rp
state: present
delegate_to: localhost
- name: Deploy Virtual Machine from template in content library with PowerON State
community.vmware.vmware_content_deploy_template:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
template: rhel_test_template
content_library: test_content_library
datastore: Shared_NFS_Volume
folder: vm
datacenter: Sample_DC_1
name: Sample_VM
resource_pool: test_rp
state: poweredon
delegate_to: localhost
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
vm_deploy_info
dictionary
|
on success |
Virtual machine deployment message and vm_id
Sample:
{'msg': "Deployed Virtual Machine 'Sample_VM'.", 'vm_id': 'vm-1009'}
|
- Pavan Bidkar (@pgbidkar)