Posts

Showing posts from June 21, 2017

Changing the path policy of the SCSI lun device using Powercli in Vmware Vsphere Environment

Image
Today my motto is to change the path policy of the scsi lun from Fixed to round robin. It’s always a pain to change the path policy of the scsi lun device, it takes hours of time to change the path manually in case if we have the large environments of say 2000 ESXi and with more than 400 Devices connected with the Esxi. so we used some Powercli and create a loop to perform the redundant task well in crisp words we tried to automate this task which could save hours of manual works Code: $server = Get-content "C:\hostfile.txt" foreach ($i in $server) { Get-ScsiLun -VmHost $i -CanonicalName "naa.6006*" | where {$_.MultipathPolicy -ne "RoundRobin"} | Set-ScsiLun -MultipathPolicy RoundRobin } Here in the above code I am calling the list of ESXi Host in the file named as hostfile.txt and passing it to the variable $server and this will create an array of characters over the variable $server , Each character represents Esxi hosts on devops