I’ve made a simple python script which uses VMWare vCenter to create a Dynamic Inventory. It is very simple, does not support grouping by datacenter or resource groups (yet, pull requests accepted).
https://raymii.org/s/software/Ansible__Dynamic_Inventory_From_VMware_vCenter.html
I’d like some feedback and testing on it. It works for me at our vCenter 5.5 cluster, which, has only *NIX vm’s.
Excellent,
Both vcenter and vsphere together would be ideal.
We’re seeing increased interest in folks of having VMware inventory lately, I think to date a lot of VMware was in the “I’m going to ask for an IP from IT” mode, so very glad to see this change and more folks (non-Ansible-specific-comment) treat it more like a cloud service.
I’d also like to see some VMware provisioning modules in core, though I’d also want to make sure we had some for non-vcloud too.
Any other services/configuration modules for it are also fair game!
I named it vsphere but it works with standalone vcenter directly, both apis
are basically the same with vsphere having 'more capabilities'.
Once this is stable my next step was going to be to try and get the
provisioning plugins from ansible-provisioning project into core.
Excellent,
Both vcenter and vsphere together would be ideal.
It also works on standalone ESXi hosts as far as I can see. (Just tried it).
We’re seeing increased interest in folks of having VMware inventory lately, I think to date a lot of VMware was in the “I’m going to ask for an IP from IT” mode, so very glad to see this change and more folks (non-Ansible-specific-comment) treat it more like a cloud service.
VMWare seems to be more enterprisy. Who asks for a VM IP these days…
I’d also like to see some VMware provisioning modules in core, though I’d also want to make sure we had some for non-vcloud too.
The pysphere module currently does not have the capability to create a VM, however there is some example code: https://groups.google.com/forum/#!msg/pysphere/VF9pN9qU-94/YxVHeae8anoJ
It is possible, there is a rubygem that does support it. We use that to create a VM, then provision it further with Ansible and Cobbler.
Hi Brian, I wrote the vsphere_guest[1] ansible module in the
ansible-provisioning repo. If you have the time to work on the module to
make it more 'idempotent' that'd be great. Currently it can create the VM
just fine but can't modify it after the fact. It just checks if the VM
exists and skips the creation steps if it does. This is one area that could
be improved. Here is an example of how I use the module to create VM's in
our environment:
https://github.com/romeotheriault/ansible-vsphere_guest
[1]
https://github.com/ansible-provisioning/ansible-provisioning/blob/master/library/vsphere_guest
@romeo, I'll check that out, since this will be used at my current job I'll
probably be able to dedicate the time.
You may consider reviewing https://github.com/vmware/pyvmomi, which offers a full rest-api to vsphere. This will enhance or possibly replace vsphere_guest functionality
Yeah currently we have the inventory module using one python module and the provisioner users the other.
Both are functional but would be nice to standardize for sure.
I don’t think it would replace “vsphere_guest” the module at all - we still want the module, but the module can be open to using other libraries if not enough functionality is surfaced.
Right now I’m not quite clear on what those things might be, but again, open to expansion, totally.