VMware {code} Community
petermie
Enthusiast
Enthusiast

Expanding VMDK in 6.5 with c#

I would like to expand a VMDK on a VM in our 6.5 environment via the c# Management SDK, and if I understand the documentation correctly the best way to do this would be to leverage HostExtendDisk_Task from HostVStorageObjectManager. The problem i'm having is how do I get the HostVStorageObjectManager object?  I have a feeling my method is close but I just can't figure it out Here is what i'm trying, but it is failing on a type conversion so it's definitely not correct. Do I need to get it from the VM host somehow?

HostVStorageObjectManager vDiskMan = (HostVStorageObjectManager)vimClient.GetView(vimClient.ServiceContent.VStorageObjectManager, null);

Any help is appreciated

Reply
0 Kudos
1 Reply
petermie
Enthusiast
Enthusiast

I made some progress, however it seems that for some reason that my virtual disk VDiskId returns always null and I can't figure out why. If anyone actually sees this and has any advice (including perhaps another community somewhere) i'd appreciate it, however i'm not holding my breath as it seems this forum is abandoned looking at the overall reply counts. Considering how big the vmware community is claimed to be, i'm quite surprised.

Reply
0 Kudos