# Ansible VMWare ESXi Guest VM launch using template

**URL:** <https://forum.ansible.com/t/ansible-vmware-esxi-guest-vm-launch-using-template/24659>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [June 6, 2017, 1:32pm UTC](https://forum.ansible.com/t/ansible-vmware-esxi-guest-vm-launch-using-template/24659 "2017-06-06T13:32:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiva\_jawanjal](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@shiva\_jawanjal](https://forum.ansible.com/u/shiva_jawanjal)\
**Post date:** [June 6, 2017, 1:32pm UTC](https://forum.ansible.com/t/ansible-vmware-esxi-guest-vm-launch-using-template/24659/1 "2017-06-06T13:32:26Z")

</div>

First I will admit that I am not an exprt on VMWare ESXi. And facing issue while automating launch of preconfigured servers using Ansible.

I want to launch a VM using template in VMWare ESXi server 5. I have created a template from an existing VM (.ova file). And now I am trying to launch it using Ansible VMWare\_guest module. What I find confusing is the part where you provide path to the template file. Wouldn’t it be easier to launch if template is stored in datastore!?

My Ansible task as follows, which gets a VM up & running for me with CentOS 7ISO file loaded then I proceed to install CentOS manually by taking console access of VM.

- vsphere\_guest:  
vcenter\_hostname: 172.xxx.x.xxx  
username: xxxx  
password: xxxxxx  
guest: test-1  
state: powered\_on  
force: yes  
vm\_disk:  
disk1:  
size\_gb: 50  
type: thin  
datastore: datastore1  
vm\_nic:  
nic1:  
type: vmxnet3  
network: VM Network  
network\_type: standard  
vm\_hardware:  
memory\_mb: 4096  
num\_cpus: 2  
osid: centos64Guest  
scsi: paravirtual  
vm\_cdrom:  
type: iso  
iso\_path: “datastore1/CentOS\_iso/CentOS-7-x86\_64-Everything.iso”  
state: reconfigured  
esxi:  
datacenter: ha-datacenter  
hostname: “172”

What I want to achieve is to launch a VM with preinstalled OS & Preconfigured hardware configuration. I have wrote another ansible task for this which will use template to achieve this feat.

---

<div class="post-metadata">

**Author:** ![Paul\_Farrington](https://avatars.discourse-cdn.com/v4/letter/p/94ad74/32.png) [@Paul\_Farrington](https://forum.ansible.com/u/Paul_Farrington)\
**Post date:** [June 6, 2017, 2:24pm UTC](https://forum.ansible.com/t/ansible-vmware-esxi-guest-vm-launch-using-template/24659/2 "2017-06-06T14:24:36Z")

</div>

Hi,

I am new to this also, but do have a working play that deploys from a template… although i am using a different module, vmware\_guest, my understanding is that the vsphere\_guest is very limited and vmware\_guest is the newer…
