Pilu1978
Enthusiast
Enthusiast

Host MultiPath Policy

Hi,

I want to check multipath policy of each path of each LUN of each esx hosts in my vCenter. It is taking hell lot of time when doing it the below way:

for each (esxhost in esxhosts){

var scsiobj = {}

for each (scsilun in esxhost.config.storageDevice.scsiLun){

if (scsilun.localDisk == false){

scsiobj[scsilun.uuid] = scsilun.canonicalName

}

}

     for each (lun in esxhost.config.storageDevice.multipathInfo.lun){

          if (lun.policy.policy != "VMW_PSP_RR"){

               var mpathInfo = {}

               mpathInfo["HostName"] = esxhost.name

               mpathInfo["Cluster"] = esxhost.parent.name

               mpathInfo["LUN"] = scsiobj[lun.id]

               mpathInfo["mpathPolicy"] = lun.policy.policy

               mpathPolicy.push(mpathInfo)

          }

     }

}

Is there any other way I can retrieve the info quickly. Please help.

0 Kudos
0 Replies