I've seen answers all around the forums regarding how to create a virtual disk using C# and the Web Services sdk. In the Vim25Api.dll that I built using the SDK, I see a CreateVirtualDisk_Task(), which is, apparently what I need.
http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.VirtualDiskManager.ht... shows that I need a VirtualDiskSpec, but I don't see this in the Vim25Api.dll at all. Has anyone experienced missing classes while working with C# and the Vim25Api?
Any help in this matter would be appreciated.
Also, I don't see any references to VirtualDiskManager in the Vim25Api.dll either.
Actually, I found VirtualDiskSpec, it's the VirtualDiskInfo class that I can't find.
I guess I'm wondering why there is mention of Managed Objects and Data objects in the SDK that aren't available in the DLLs generated from the WSDL.
Looks like you are confused about:
1) object model of VimSdk
2) creating virtual disks with VimSdk
Maybe you find info over here:
Has it been confirmed that the VirtualCenter that was released with VI4 supports the VirtualDiskManager?
If so, then I'm going to accelerate our upgrade plan, if not, then I'm going to have to start connecting to our ESX servers, but there are 10 of them 😕 I assume that I can get the hosted server from the VirtualMachine mOR?
I dont know exactly. Before VI4 the virtualDiskManager object was pretty much null, unset all the way on vCenter. It is valid and usable from VI4 (vSphere), yes.
It pretty much does what you want it todo. Even if it suffers from some rare behaviours that existed in VI3 before...
Anyway. When you want to use virtualDiskManager do copy any files, you may achieve better results when using the ESX directly.
My goal is to programmatically create and attach new drives to existing VMs. This would explain why I'm getting mysterious errors when I use the VirtualDiskManager in VC.
Do you know if it is possible to get the host of a VirtualMachine that is running on a cluster from VirtualCenter? I try using the "runtime.host" property, but it appears to be null. Surely there must be a way to get this information from the SDK.
Refer to managed object browser for vCenter and check if the runtime.host property of the Virtual Machine is null or not.
I'm almost done this, I've managed to create a second hard disk but i'm getting the path screwed up. I know about summary.config.vmPathName, but is there a way to get the parent directory of the virtual machine? vmPathName is currently "[ESXSTORE_A] TCN - Web Server/TCN - Web Server.vmx". Before I break out my parsing, is there a way to get a Folder mOR for the TCN - Web Server directory?