# vsphere\_guest only supports vcenter?

**URL:** <https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123>\
**Category:** Ansible Developer\
**Tags:** aws\
**Created:** [September 4, 2014, 10:51pm UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123 "2014-09-04T22:51:35Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![nathan.sosnovske](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@nathan.sosnovske](https://forum.ansible.com/u/nathan.sosnovske)\
**Post date:** [September 4, 2014, 10:51pm UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/1 "2014-09-04T22:51:35Z")

</div>

Hey All,

I was playing around with the vsphere\_guest module today and it appears that it only supports creating VMs if the ESXi host is actually joined to vcenter. I don’t think that this is a limitation of pysphere. At least one of the reasons for it not working seems to be a requirement for passing a Datacenter string to the module. This wouldn’t exist on a standalone ESXi host that wasn’t joined to a vcenter system.

I guess I have two questions:

1. Am I correct in my findings that standalone ESXi hosts aren’t supported?
2. Is this a by-design thing? Or could I work on the module to add ESXi support and submit a pull request? I’d be more than willing to do the work if it was welcome.

Nathan

[Try Enterprise R Now!](https://aws.amazon.com/marketplace/seller-profile/ref=_ptnr_emailfooter?ie=UTF8&id=3c6536d3-8115-4bc0-a713-be58e257a7be)  
Get a 14 Day Free Trial of Revolution R Enterprise on AWS Marketplace

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 5, 2014, 1:49am UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/2 "2014-09-05T01:49:24Z")

</div>

Goal was to get vcenter going first and foremost.

I’m _totally_ open to changes to make it support raw ESX, that would be quite welcome!

---

<div class="post-metadata">

**Author:** ![nathan.sosnovske](https://avatars.discourse-cdn.com/v4/letter/n/53a042/32.png) [@nathan.sosnovske](https://forum.ansible.com/u/nathan.sosnovske)\
**Post date:** [September 5, 2014, 9:16pm UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/3 "2014-09-05T21:16:26Z")

</div>

Cool! I’ll get working on that.

On a related note, do you think there would be any demand for a hyper-v module? I’d be willing to start work on that if there isn’t already development being done on it.

Nathan

---

<div class="post-metadata">

**Author:** ![Victor\_Martinez](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@Victor\_Martinez](https://forum.ansible.com/u/Victor_Martinez)\
**Post date:** [July 21, 2015, 9:20am UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/4 "2015-07-21T09:20:26Z")

</div>

Hi there,

Just found this thread and I wonder whether this raw esx modules is already in place, if so, where can I find further details?

Thanks so much

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 21, 2015, 2:22pm UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/5 "2015-07-21T14:22:09Z")

</div>

i've used it with ESXI, for some options you just have to use a  
default resource when it is vcenter specific.

---

<div class="post-metadata">

**Author:** ![Victor\_Martinez](https://avatars.discourse-cdn.com/v4/letter/v/2acd7d/32.png) [@Victor\_Martinez](https://forum.ansible.com/u/Victor_Martinez)\
**Post date:** [July 21, 2015, 4:16pm UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/6 "2015-07-21T16:16:31Z")

</div>

Cool! I was able to run some commands:

`

---

<div class="post-metadata">

**Author:** ![Alland\_Vyyrylainen](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@Alland\_Vyyrylainen](https://forum.ansible.com/u/Alland_Vyyrylainen)\
**Post date:** [June 15, 2016, 7:15am UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/7 "2016-06-15T07:15:57Z")

</div>

HI!

Could you give an example on how to create vm on just esxi , without a vcenter.

All my attempts have failed this far.

Regards  
Alland

---

<div class="post-metadata">

**Author:** ![Alex\_Lien](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Alex\_Lien](https://forum.ansible.com/u/Alex_Lien)\
**Post date:** [December 2, 2016, 5:09am UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/8 "2016-12-02T05:09:04Z")

</div>

Hi all,

Does anyone have any example of creating vm and/or cloning a VM with the ESXi free version (without vcenter) using Ansible?

Thanks so much for your help.

Regards,  
Alex

---

<div class="post-metadata">

**Author:** ![Matthias\_Fabinski](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@Matthias\_Fabinski](https://forum.ansible.com/u/Matthias_Fabinski)\
**Post date:** [December 6, 2016, 10:31pm UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/9 "2016-12-06T22:31:41Z")

</div>

Hello Alex,

i was searching for a solution to the same problem you’re facing. I finally made it, i got a running vm. Here i provide the steps i think are necessary.

1. Make sure you can login to your ESXI with ssh:  
`

2. Create inventory file containing ESXI Host (replace [esxi.default.de](http://esxi.default.de) with your esxi hostname):  
`

3. Make sure you maintained the ESXI Hostname in vsphere client (navigate to Configuration → DNS and Routing → Change (link in the top right) → set here hostname and domain

4. Create a playbook like this (Credit to [Michael Hampton and user3796292](http://serverfault.com/questions/800552/error-trying-to-create-a-new-vm-in-ansible)):  
`

---

<div class="post-metadata">

**Author:** ![Alex\_Lien](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@Alex\_Lien](https://forum.ansible.com/u/Alex_Lien)\
**Post date:** [December 7, 2016, 11:36pm UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/10 "2016-12-07T23:36:33Z")

</div>

Hi Matthias,

This is very helpful. Thank You very much for the detailed instruction.

Regards,  
Alex

---

<div class="post-metadata">

**Author:** ![robert\_tayar](https://avatars.discourse-cdn.com/v4/letter/r/977dab/32.png) [@robert\_tayar](https://forum.ansible.com/u/robert_tayar)\
**Post date:** [May 10, 2017, 1:00am UTC](https://forum.ansible.com/t/vsphere-guest-only-supports-vcenter/16123/11 "2017-05-10T01:00:43Z")

</div>

I can confirm this ansible playbook works! I struggled for a few days trying to figure out how to bypass vcenter and couldn’t tell from the raw python on git if it was required. I was able to create a vm just now. Thank you for the post and directions. Especially the DNS part because mine was wrong.
