# deploy VM in ESXi using Ansible

**URL:** <https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460>\
**Category:** Ansible Project\
**Created:** [July 3, 2021, 3:14pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460 "2021-07-03T15:14:21Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Orkhan\_Mammadov](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@Orkhan\_Mammadov](https://forum.ansible.com/u/Orkhan_Mammadov)\
**Post date:** [July 3, 2021, 3:14pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460/1 "2021-07-03T15:14:21Z")

</div>

Hi guys,

Could you please help me with the guidance to create VM in ESXi using ansible playbook?  
I tried to find proper one over forums, unfortunately could not find.  
Regards.

---

<div class="post-metadata">

**Author:** ![ffirg](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ffirg/32/10029_2.png) [@ffirg](https://forum.ansible.com/u/ffirg)\
**Post date:** [July 3, 2021, 5:45pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460/2 "2021-07-03T17:45:47Z")

</div>

[https://docs.ansible.com/ansible/latest/scenario\_guides/vmware\_scenarios/faq.html#can-i-deploy-a-virtual-machine-on-a-standalone-esxi-server](https://docs.ansible.com/ansible/latest/scenario_guides/vmware_scenarios/faq.html#can-i-deploy-a-virtual-machine-on-a-standalone-esxi-server)  
“Yes. vmware\_guest can deploy a virtual machine with required settings on a standalone ESXi server. However, you must have a paid license to deploy virtual machines this way. If you are using the free version, the API is read-only.”

---

<div class="post-metadata">

**Author:** ![Orkhan\_Mammadov](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@Orkhan\_Mammadov](https://forum.ansible.com/u/Orkhan_Mammadov)\
**Post date:** [July 4, 2021, 3:46pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460/3 "2021-07-04T15:46:34Z")

</div>

Actually,

I am using ESXi evaluation mode (free). I created .yml file with the following entry:

---

<div class="post-metadata">

**Author:** ![Jim\_Barlow](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jim\_Barlow](https://forum.ansible.com/u/Jim_Barlow)\
**Post date:** [July 4, 2021, 3:48pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460/4 "2021-07-04T15:48:50Z")

</div>

You will want to use the vmware\_guest module:

There are great examples at the bottom of this page. The first listed example is what you will want to use.

[https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware\_guest\_module.html](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_module.html)

---

<div class="post-metadata">

**Author:** ![Jim\_Barlow](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@Jim\_Barlow](https://forum.ansible.com/u/Jim_Barlow)\
**Post date:** [July 4, 2021, 3:50pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460/5 "2021-07-04T15:50:41Z")

</div>

Sorry, I was behind on the thread. Please disregard.

---

<div class="post-metadata">

**Author:** ![Orkhan\_Mammadov](https://avatars.discourse-cdn.com/v4/letter/o/eada6e/32.png) [@Orkhan\_Mammadov](https://forum.ansible.com/u/Orkhan_Mammadov)\
**Post date:** [July 4, 2021, 3:55pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460/6 "2021-07-04T15:55:08Z")

</div>

yes, I followed exactly as mentioned in the 1st option

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [July 4, 2021, 9:11pm UTC](https://forum.ansible.com/t/deploy-vm-in-esxi-using-ansible/35460/7 "2021-07-04T21:11:16Z")

</div>

Looks like your vm\_guest formatting part is wrong
