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:
Am I correct in my findings that standalone ESXi hosts aren’t supported?
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!
Get a 14 Day Free Trial of Revolution R Enterprise on AWS Marketplace
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.
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.
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
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.