Hi there,
nice to see anotherone that was able to get started with this guide.
But for now, lets jump in:
// The problem with your statement could be a two part story.
// I would be very cautious about for what you ask. You can actually
// use the ManagedObjectReference and that is absolutely fine. But
// you'll probably get to the point where you don't have it in the
// first place. I'll update my original post with some infos for finding
// Object over MORs and other useful tools...
// But for now I'll just show you how it works for me. For example:
// Be careful here, it's not enough to put just the Id part in here,
// you have to specify the type up front:
String virutalMachineId = "VirtualMachine-vm-266";
ManagedObjectReference tmp = new ManagedObjectReference(virtualMachineId);
// Another way is this, which I personally prefer...
ManagedObjectReference tmp2 = new ManagedObjectReference { Type = "VirtualMachine", Value = "vm-266" };
VirtualMachine vm = null;
try
{
// vmc is my instance of VimClient
vm = (VirtualMachine)vmc.GetView(tmp, null);
}
catch (VimException e)
{
throw new MyNamespace.Exceptions.VirtualMachineNotFoundException("Couldn't find the VirtualMachine by id: " + virtualMachineId, e);
}
To the more general part:
As far a I know, there is no exact documentation for the API provided by this dll. I would love to see this in the future. But until we get something like that, the MOB is your friend and it can always show you the Properties you want to use and the "paths" you can take to get to a target.
Hope this helps, keep asking please =)
Greetings,
Kjellski