xuru/pyvisdk — Issue #4: CloneVM_Task Fail
Author: shhgs
Created: 2012-03-01 16:29:27+00:00
State: open

Hi Eric:

I am using pyvisdk and I got this error while cloning and VM.

The code looks like that::

def createvm(buildreq):
relocSpec = VirtualMachineRelocateSpec( conn
, datastore = ds_depesx1.ref
, host = esx_depesx1.ref
, pool = esx_depesx1.parent.ref)
cloneSpec = VirtualMachineCloneSpec( conn
, location = relocSpec
, powerOn = False
, template = False)
tmpl_vmbuild.CloneVM_Task(getFolder(buildreq), buildreq.hostname, cloneSpec)

..

And the error messages looks like this::

$ python createvm.py
[2012-03-01 11:23:57,333][INFO ] vim.login:41 Successfully logged into https://imsvcenter.intelerad.com/sdk
[2012-03-01 11:24:02,311][ERROR ] client.send:648

vm-739
group-v10255
cdcchinarch1.cdc

datastore-6143
domain-c565
host-6140

false
false

Traceback (most recent call last):
File "createvm.py", line 89, in
createvm(req)
File "createvm.py", line 84, in createvm
tmpl_vmbuild.CloneVM_Task(getFolder(buildreq), buildreq.hostname, cloneSpec)
File "/home/shhgs/.local/lib/python2.7/site-packages/pyvisdk-0.9dev_20120228-py2.7.egg/pyvisdk/mo/virtual_machine.py", line 200, in CloneVM_Task
return self.delegate("CloneVM_Task")(folder, name, spec)
File "/home/shhgs/.local/lib/python2.7/site-packages/pyvisdk-0.9dev_20120228-py2.7.egg/pyvisdk/base/base_entity.py", line 46, in __call__
rv = self.__target(*args, **kwargs)
File "/home/shhgs/.local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/client.py", line 542, in __call__
return client.invoke(args, kwargs)
File "/home/shhgs/.local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/client.py", line 602, in invoke
result = self.send(soapenv)
File "/home/shhgs/.local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/client.py", line 649, in send
result = self.failed(binding, e)
File "/home/shhgs/.local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/client.py", line 702, in failed
r, p = binding.get_fault(reply)
File "/home/shhgs/.local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/bindings/binding.py", line 265, in get_fault
raise WebFault(p, faultroot)
suds.WebFault: Server raised fault: 'Invalid argument'

..

I don't know much about the VMware SDK, so can you please help troubleshooting this problem?

Thanks
- shhgs