vmware / vmware/pyvmomi

InvokeMethod error when trying to copy disk

Open
#576 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Python
Stars
2.3k
Forks
763
PR merge metrics
No merged PRs in 30d

Description

Hello,

I'm trying to copy a disk using VirtualDiskManager.CopyVirtualDisk:

destSpec = vim.VirtualDiskManager.VirtualDiskSpec()
 destSpec.diskType = "eagerZeroedThick"
 destSpec.adapterType = "busLogic"
 dc = self.get_obj([vim.Datacenter], dc)
 task = vim.VirtualDiskManager.CopyVirtualDisk(
            sourceName=source_path,
            sourceDatacenter=dc,
            destName=dest_path,
            destDatacenter=dc,
            destSpec=destSpec
   )

Here, sourceDatacenter and desDatacenter are valids, sourceName and destName are strings in the form of "[Datastore] path/to/disk"

I get the following error:

File "/usr/lib/python2.7/site-packages/pyVmomi/VmomiSupport.py", line 574, in call
return self.f(*args, **kwargs)
TypeError: _InvokeMethod() takes at least 2 arguments (1 given)

I originally used pyvmomi-6.0.0.2016.6 and I upgraded to 6.5.0.2017.5.post1, without any change.

Is there a way I can troubleshoot this ? I tried to find in the documentation what I missed but found nothing, is it a known issue ?

Regards,
Grégoire

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied VirtualDiskManager.CopyVirtualDisk call and inspect VmomiSupport.py around _InvokeMethod, then compare the invocation signature with the pyVmomi API documentation for VirtualDiskSpec and datacenter arguments. Reproduce the TypeError using the provided Python snippet; done means the cause of the argument mismatch is identified and the issue has a verified invocation or documented limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.