1 person found this helpful
To provision VMs whether creating a new or cloning from an existing onto a Datastore Cluster, you will need to leverage a different vSphere API than the CreateVM_Task() or CloneVM_Task() methods. You can take a look at this article which goes into details on what you would need to provision VMs on Datastore Clusters http://www.virtuallyghetto.com/2012/03/vm-provisioning-on-datastore-clusters.html and that should provide you with what you need to create your provisioning script.
Thank you for your reply and information.
It took me some trial and error and I finally managed to create a VM onto a datastore cluster
One of the errors I encountered was due to me providing the wrong parameters. Ther reason I am mentioning this is because the "wrong call" has disconnected vCenter completely, something I did not expect could happen.
The parameter which I entered which was wrong was the "vmfolder", somehow it defaulted to the word "Datacenters"...
Output:Creating imp-test onto sdrs_cluster1Error creating VM 'imp-test':SOAP request error - possibly a protocol issue: Status read failed: Connection reset by peer at /usr/share/perl5/Net/HTTP/Methods.pm line 269.After which vCenter has become not accessible anymore (my vSphere client seemed to loose connection as well).I could not connect for about 5 minutes, but then vCenter seemed to become accessible again.I also did not encounter any interesting entries in the log.
I am glad this is working and I can now start using it in production.
However, I am unsettled about the declaration:
NOTE: This data object type and all of its methods are experimental and subject to change in future releases.
Hope for the best :-)
I m facing the same issue and I keep on getting the same error : 'A general system error occured: optional value not set'. When I put a datastore, everything(vm.congifSpec) but it seems that for a cluster of datastore you need different parameters could you please tell me which ones ?
An example of your working code would also be greatly appretiated.
Thanks in advance