I am trying to get the naaIDs from the host so I can match them to the lun that the VM has. On vCO 5.5.1 it can get to the storageDeviceInfo but in 5.1 it comes back as undefined as stroageSystem is there some configuration that you need to set in the VC?
inputs: vm
var lunDeviceList = new Array ();
var naaIDArray = new Array ();
var HostPlugStoreTopologyDevicePath = new Array ();
var host = vm.runtime.host;
var hostStorageTopology = host.configManager.storageSystem.storageDeviceInfo.plugStoreTopology;
System.log(hostStorageTopology);
var HostPlugStoreTopologyDevice = hostStorageTopology.device;
for each (var i in HostPlugStoreTopologyDevice){
var sharedStoragePath = i.path;
for each (var j in sharedStoragePath){
var b = "naa.";
var naaIDLocation = j.indexOf(b) + 4;
naaIDArray.push(j.substring(naaIDLocation));
//System.log(j.substring(naaIDLocation));
}
}
System.log("This is the array of Naa ID's" + " " + naaIDArray);