ManagedObjectReference hsdi = new ManagedObjectReference(); hsdi.setType("HostSystem"); hsdi.setValue("host-28"); ObjectSpec objectSpec = new ObjectSpec(); objectSpec.setObj(hsdi);
PropertySpec propertySpec = new PropertySpec(); propertySpec.setType("HostSystem"); propertySpec .getPathSet() .add( "config.storageDevice.hostBusAdapter[\"key-vim.host.FibreChannelHba-vmhba1\"].portWorldWideName");
I want to read all WWPNs from a host. The code above cause an error. Any ideas why the property doesn't exist.
The MOB shows the property.
If I read the storageDeviceInfo and call getHostBusAdapter() all elements in the list are type of HostHostBusAdapter, so it's not possible to call the getter for WWPN's.
Why did I get the wrong class type from the server? Casting cause an error.