VMware {code} Community
Carmageddon
Contributor
Contributor

How to clone from Template without specifying a host?

Hello!

I've been using the vSphere SDK for Perl to do automation.

I have used until now, something like this to clone from templates:

my @args = ("/root/vmware-vsphere-cli-distrib/apps/vm/vmclone.pl --vmhost esx12.infra.local --vmname $templateName --vmname_destination $finalVMName --datastore $dataStore  --username $User --password $Pass --url $serverIP");

Which is working.

However now they want to do some changes in infrastructure, and asking me whether I can make it dynamic.

I have not found any examples or documentation stating how to do that, but logic dictates it must be possible somehow - the whole point of vCenter is that it chooses automatically on which host to provision the new VM.

However as I said, no sample shows this is possible (and how).

Any ideas please?

Reply
0 Kudos
2 Replies
Carmageddon
Contributor
Contributor

Come on guys, anyone? How do you create/clone VMs from template without hardcoded reliance on a single (or a pre-defined list) of host(s)?

Reply
0 Kudos
weinstein5
Immortal
Immortal

I have moved this to a more appropriate forum.

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos