Hi,
I want to create virtual machines on Cluster, not on a specified host.
My Problem is that the function VMCreate need an type "resourcePool" and I don't know how to create a resourcePool from a ClusterComputeResource.
Can anyone help me?
Thanks in advance
Henning
If you don't have/use resource pool, by default there is a default resource pool called resourcePool. You just need to get a reference to the root pool and that can be used as a param to CreateVM_Task().
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
If you don't have/use resource pool, by default there is a default resource pool called resourcePool. You just need to get a reference to the root pool and that can be used as a param to CreateVM_Task().
=========================================================================
William Lam
VMware vExpert 2009
VMware ESX/ESXi scripts and resources at:
VMware Code Central - Scripts/Sample code for Developers and Administrators
If you find this information useful, please award points for "correct" or "helpful".
Thanks again for your help!!
Hi, is it possible that You check the thread Creation of the virtual machine on a cluster via vmcreate.pl script please ?
Your XML should look more like this:
<Virtual-Machines>
<Virtual-Machine>
<Name>$vmhostname</Name>
<Host>$cluster_host</Host>
<Datacenter>$vdatacenter</Datacenter>
<Guest-Id>rhel6_64Guest</Guest-Id>
<Datastore>$datastore</Datastore>
<Disksize>$first_disk</Disksize>
<Memory>$memory</Memory>
<Number-of-Processor>$numprocs</Number-of-Processor>
</Virtual-Machine>
</Virtual-Machines>
$cluster_host is a host in the cluster you wish to create the VM in. It wont necessarily create the vm on that host, as the cluster will decide the best place for the VM to go.
Ok, I have found the problem thanks to You!
The value of the <Guest-Id> has to be for example "rhel6_64Guest" and not a random word... that is it!