VMware {code} Community
Carmageddon
Contributor
Contributor

Error trying to clone a VM to a DataStoreCluser

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!

Reply
0 Kudos
5 Replies
stumpr
Virtuoso
Virtuoso

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.

Reuben Stump | http://www.virtuin.com | @ReubenStump
Reply
0 Kudos
Carmageddon
Contributor
Contributor

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 Smiley Happy

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?

Reply
0 Kudos
stumpr
Virtuoso
Virtuoso

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

Reuben Stump | http://www.virtuin.com | @ReubenStump
Reply
0 Kudos
Carmageddon
Contributor
Contributor

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.

Reply
0 Kudos
samsvmware
Enthusiast
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.

Reply
0 Kudos