pyvmomi icon indicating copy to clipboard operation
pyvmomi copied to clipboard

'Not supported on the object error' while deploying OVF

Open goindwalia opened this issue 11 years ago • 11 comments

Hello, I am trying to make a python script to deploy OVF on vSphere. https://gist.github.com/goindwalia/48a5f9ab6a2f4eedfdba The error I am getting is leading me no where:

(vmodl.fault.NotSupported) {
   dynamicType = <unset>,
   dynamicProperty = (vmodl.DynamicProperty) [],
   msg = 'The operation is not supported on the object.',
   faultCause = <unset>,
   faultMessage = (vmodl.LocalizableMessage) []
}

The lease is getting failed after initialising. I am having strong feeling that there is something wrong while creating ImportVApp or CreateImportSpec. I have tried 2-3 different minimal OVFs so far. Kindly help me rectifying this error.

goindwalia avatar Aug 20 '15 12:08 goindwalia

Having the same issue. Also on VSphere 5.5

Did you ever find a solution?

ryanrussell avatar Oct 11 '15 19:10 ryanrussell

You're probably pointing the script at your vCenter IP instead of an individual host. Someone else had this issue over in the community samples repo: https://github.com/vmware/pyvmomi-community-samples/issues/54

tonya11en avatar Oct 11 '15 22:10 tonya11en

Looking at your code, nothing happens with the lease. Eventually it will timeout. There is now a full sample for deploying OVF:

https://github.com/vmware/pyvmomi-community-samples/blob/master/samples/deploy_ovf.py

derchrisuk avatar Nov 19 '15 15:11 derchrisuk

@stormbeard @derchrisuk changing to ESXi host instead of vCenter address fixes the issue, but could the sample code be made to work with vCenter? When deploying to an ESX host directly, vCenter does not list any progress (Recent Tasks) of any type.

saad-cliqr avatar Apr 05 '16 17:04 saad-cliqr

Have you tried to deploy an OVF via vSphere Client connected to a vCenter? Is this working? Then you could sniff what it is doing using Onyx, and use that to create the correct pyvmomi specs.

derchrisuk avatar Apr 05 '16 22:04 derchrisuk

@derchrisuk yes of course, we deploy using the vSphere client connected to vCenter all the time. I found the vSphere logs (client request) to vCenter for deploying a OVF. I'll try to model this via pyvmomi and update the results there.

saad-cliqr avatar Apr 06 '16 00:04 saad-cliqr

@derchrisuk well that was simple.

Changing one line makes it work for both ESXi host and directly to vCenter:

    lease = objs["resource pool"].ImportVApp(import_spec.importSpec, objs["datacenter"].vmFolder);

saad-cliqr avatar Apr 06 '16 17:04 saad-cliqr

I think you can close this issue now. Also if you guys want, I can issue a pull-request for the sample/deploy_ovf.py

saad-cliqr avatar Apr 06 '16 17:04 saad-cliqr

That would be nice

derchrisuk avatar Apr 06 '16 18:04 derchrisuk

@saad-cliqr would you please also replace curl with requests in the same patch

reubenur-rahman-hpeprod avatar Apr 29 '16 05:04 reubenur-rahman-hpeprod

closing this issue as the sample is fixed by @saad-cliqr. Thanks @saad-cliqr

tianhao64 avatar Jun 27 '16 20:06 tianhao64