ServiceInstance si = new ServiceInstance(
new URL(args[0]), args[1], args[2], true);
Folder rootFolder = si.getRootFolder();
VirtualMachine vm = (VirtualMachine) new InventoryNavigator(
rootFolder).searchManagedEntity(
"VirtualMachine", vmname);
HostSystem newHost = (HostSystem) new InventoryNavigator(
rootFolder).searchManagedEntity(
"HostSystem", newHostName);
ComputeResource cr = (ComputeResource) newHost.getParent();
String[] checks = new String[] {"cpu", "software"};