Clone VMs on vSphere

Hey,

I am currently playing around with ansible to see if this could be used for us in production with our deployments. Something I am currently have trouble wrapping my head around is the following.

I want to use ansible to deploy entire test invironment on the fly (tower button eventually). This would mean deploying 50ish machines to vSphere. I see you have to specify the datastore when cloning a vsphere_quest. When you dont have the most expensive version of vCenter you dont have storage pools and have to specifiy the datastore with the most free space. How would I be able to do this in ansible? I saw the vsphere_guest doesnt support wildcards in datastore names or just picks the one with the most free space if I dont specify any datastore at all. (which would be an awesome feature imho.)

I dont feel like “hardcoding” the datastore in the playbook when cloning the machines cause the environment around you won’t stand still :wink:

thnx

You can pass it as variable through the command line and then use a
fail task to abort unless it's been set. That's how I've done similar
things in the past.

Not sure if you’ve seen this blog post then, but you might find it helpful…

http://www.ansible.com/blog/managing-vmware-vsphere-guests-with-ansible-tower

Cheers!

–Mark