3 Replies Latest reply on Jul 4, 2018 7:16 AM by Warenn

    Create a VM using StoragePlacementSpec

    nuriel77 Lurker

      Hello,

       

      I cannot use the apps/vm/vmcreate.pl when using StoragePod (SDRS).

      I understood one might need to use StorageDrsPodSelectionSpec and the like?

       

      Would it be possible to request a working example of a script creating a VM onto a StoragePod?

      Or otherwise a link, as I did not find any example besides a CloneVM one.

       

      Thanks in advance,

      Nuriel Shem-Tov

        • 1. Re: Create a VM using StoragePlacementSpec
          lamw Guru
          VMware EmployeesCommunity Warriors

          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.

          1 person found this helpful
          • 2. Re: Create a VM using StoragePlacementSpec
            nuriel77 Lurker

            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_cluster1
            Error 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 :-)

             

            Thanks again,

            Nuriel Shem-Tov

            • 3. Re: Create a VM using StoragePlacementSpec
              Warenn Lurker
              Hi,
               
              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