# vsphere/vcenter inventory plugin

**URL:** <https://forum.ansible.com/t/vsphere-vcenter-inventory-plugin/14228>\
**Category:** Ansible Developer\
**Created:** [December 27, 2013, 9:31pm UTC](https://forum.ansible.com/t/vsphere-vcenter-inventory-plugin/14228 "2013-12-27T21:31:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [December 27, 2013, 9:31pm UTC](https://forum.ansible.com/t/vsphere-vcenter-inventory-plugin/14228/1 "2013-12-27T21:31:53Z")

</div>

My fisrt working draft [https://github.com/bcoca/ansible/tree/vsphere\_inventory](https://github.com/bcoca/ansible/tree/vsphere_inventory),

test, comment, patch, break, insult … etc

---

<div class="post-metadata">

**Author:** ![Chris\_Church1](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@Chris\_Church1](https://forum.ansible.com/u/Chris_Church1)\
**Post date:** [December 27, 2013, 10:34pm UTC](https://forum.ansible.com/t/vsphere-vcenter-inventory-plugin/14228/2 "2013-12-27T22:34:07Z")

</div>

It at least works to connect to my ESXi server and list all the VMs.

There are no host variables returned (e.g. ansible\_ssh\_host), so Ansible  
wouldn't be able to connect unless the VM name happened to be the same as  
the hostname. There is also no indication of VM status to allow connecting  
only to running VMs. The --host command line option also doesn't work  
(though Ansible will normally use ['\_meta']['hostvars'] and never call it  
with --host anyways).

I'll be glad to help out in implementing some of these things next week if  
you don't get to it before then.
