5 Replies Latest reply on May 24, 2018 10:35 AM by samsvmware

    Error trying to clone a VM to a DataStoreCluser

    Carmageddon Novice

      Hey guys,

       

      We are trying to utilize William's script, to clone to the datastorecluster (from here: vGhetto / Code / [r251] /scripts/datastoreClusterVMProvisioning.pl)

      However we have an error we cant figure out what causes it:

      Cloning "sdktemp1" to "del1000" onto "cl_ds1"

      Error:

      SOAP Fault:

      -----------

      Fault string: The operation is not supported on the object.

      Fault detail: NotSupported

       

       

      This is on vSphere 5.5 and SDK 5.5 as well.

       

      One theory the System guy who deals with the VMware infrastructure has, is that it is related to not having the FullyAutomated setting, anywhere in the configuration specifications for the clone.

      I have been looking hard into the objects related to the calls in your script, and their API reference, and I cant find any way this setting could be set in the relevant object (it doesnt exist in those objects).

       

       

      Any ideas what could this be?

       

      Thanks!

        • 1. Re: Error trying to clone a VM to a DataStoreCluser
          stumpr Master

          Take a look at the host property of VirtualMachineRelocateSpec.  It discusses the conditions around clusters vs host.

           

          Just to be sure, you are calling the script against vCenter and not a standalone ESXi host, right?  Standalone ESXi host SDK endpoints don't support cloning, it's a vCenter SDK thing.  That would be my first guess at the problem based on the NotSupported error.

          • 2. Re: Error trying to clone a VM to a DataStoreCluser
            Carmageddon Novice

            Thank you for the hints.

             

            Yes, I am calling against the vCenter API and not separate ESXi hosts.

            The property looks interesting, especially seeing the script uses it: my $location = VirtualMachineRelocateSpec->new();

            I am not sure however what to specify there for the host, it seems to take an object reference, and I am not certain I even need one, and what the different options for it mean:

            The target host for the virtual machine. If not specified,

            • if resource pool is not specified, current host is used.
            • if resource pool is specified, and the target pool represents a stand-alone host, the host is used.
            • if resource pool is specified, and the target pool represents a DRS-enabled cluster, a host selected by DRS is used.
            • if resource pool is specified and the target pool represents a cluster without DRS enabled, an InvalidArgument exception be thrown.

            Keep in mind please, I am not a VMware certified admin, I am the programmer trying to automate what the admin can do in GUI

             

            I will ask tomorrow at work, if any of those things make sense to him as required for DataStoreCluster cloning.

            But if it is not? how is the scripts supposed to work? if by default it takes an empty VirtualMachineRelocateSpec object?

            Does it work for you?

            • 3. Re: Error trying to clone a VM to a DataStoreCluser
              stumpr Master

              It's the NotSupported error that's interesting.  Can you clone the VM manually (via UI) to the same location?

              • 4. Re: Error trying to clone a VM to a DataStoreCluser
                Carmageddon Novice

                The admin says that yes, otherwise we would be working on fixing that before doing it via API.

                EDIT: by the "same location", I suppose you mean clone to a DataStoreCluster? if so yes.

                • 5. Re: Error trying to clone a VM to a DataStoreCluser
                  samsvmware Enthusiast

                  Hi Everyone ,

                   

                  Myself also faced the same error while cloning using perl sdk. please check the follows

                   

                  1). Try to apply stotage DRS recommendations.

                  2). Please check /change the vmfolder permission/param

                   

                  Finally clone got created successfully.