VMware {code} Community
Dreamer732
Contributor
Contributor

How to exapnd vmdk file programmatically using vmware webservices sdk?

Hi,

I want to exapnd vmdk file programmatically using webservices sdk.

Can anyone please let me know how to do it or refer me to a code sample for the same?

Thanks,

Dreamer

0 Kudos
3 Replies
Steve_Jin
Expert
Expert

Check out the ExtendVirtualDisk method on the VirtualDiskManager managed object type:

http://vijava.sourceforge.net/vSphereAPIDoc/ver5/ReferenceGuide/vim.VirtualDiskManager.html#extendVi...

Steve

Steve JIN Author of VMware VI and vSphere SDK; Creator of open source VI Java API (http://vijava.sf.net); Blogger at http://www.doublecloud.org
0 Kudos
Dreamer732
Contributor
Contributor

Thanks Steve for the reply.

I did use ExtendVirtualDisk_Task API to resize vmdk.

If a vmdk is not attached to a vm, the API successful.

However if a vmdk is attached to a vm, I am getting following error:

Failed to lock the file

Any idea/thoughts?

Regards,

Naresh

0 Kudos
Dreamer732
Contributor
Contributor

I dont have a clue.

Can anyone please guide me how to get to exapnd a vmdk which is attached to a VM?

Regards,

Naresh

0 Kudos