I'm a beginner with the SDK and I'm trying to get the configuration of a running VirtualMachine.
I'm able to connect to the virtual center and to the following:
Dim myVM As New VMware.Vim.VirtualMachine(vmClient, New VMware.Vim.ManagedObjectReference("VirtualMachine-vm-1404"))
I'm sure that the object myVM is correctly set coz I'm able to command the VirtualMachine (for example I can issue a MyVM.ShutdownGuest that works perfectly).
I wish to retrieve the configuration of the virtual machine, particularly I wish to get virtual disks configuration, but here is my problem, if I look into the managed objects that are supposed to store the infos I need they are empty!
since I'm a beginner with the SDK I think I'm missing something...
Please have a look at the method attached in the text file to collect VM disks information from the VirtualMachineConfigInfo object.
To answer your question more succintly, the method you used does not return all the properties. If I were doing it, I would use VirtualMachine = myVM = (VirtualMachine)VimClient.GetView(vimclient, moref);
This will return a complete virtual machine object and then you can get whatever properites you needed. Note using the Datastore property will only return the MOREF's of the datastore(s).