After upgrading from esx 3.5 to esx 4.0 and using ALUA for Netapp storage the path policy has to be changed from FIXEd to Round Robin.
VMware KB Articel:
Release | Mode | Recommended Path Policy | Firmware | Device Driver(s) | Configuration |
ESX 4.0 | VMW_SATP_ALUA | VMW_PSP_MRU | Data ONTAP 7.3 | N/A | FC Switched |
For esx4i alua can be confiured over vsphere cli
Command for Esxi 4 and esx 4 per vsphere cli
esxcli --server esxhost nmp satp setdefaultpsp --psp VMW_PSP_RR --satp VMW_SATP_ALUA
Command for esx (service console)
esxcli --server esxhost nmp satp setdefaultpsp --psp VMW_PSP_RR --satp VMW_SATP_ALUA
After setting this ALUA config only new created LUN's have the default setting ALUA and Round Robin.
For the existing LUN'S the path polica was with esx 3.5 set to fixed . After the upgrade to esx 4.0 they are allthough set to Fixed.
What is the command to find out which old luns are set to a fIxed policy and the new LUN's are set to Round Robin.
From this vmware blog, there is an example for set . Is there an get command to find fixed , rr or mru ?
After some PMs I have to conclude that the script, that emulates the esxcfg-mpath command, doesn't handle the NAA addressing that is used by NetApp.
As a quick solution you can use the other script I gave above that uses the Get-ScsiLun and Get-ScsiLunPath cmdlets.
That should at least show you what multi-path policy is used.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Have a look at the script I wrote for .
The output contains the path policy in force.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
connect to esx directly
I get following error:
Der Umleitungsoperator "<" wird noch nicht unterstützt.
Bei D:\scripts-vmware\emulate-esxcfg-mpath.ps1:1 Zeichen:26
+ $esx = Get-VMHost -Name <e <<<< sx-hostname> | Get-View
Or in english
The operator "<" is not supported at D:\scripts-vmware\emulate-esxcfg-mpath.ps1:1 Zeichen:26 + $esx = Get-VMHost -Name <e <<<< sx-hostname> | Get-View
You have to replace the placeholder "<esx-hostname>" with the actual hostname of your ESX server.
But I forgot that you can also do this with cmdlets since PowerCLI 4.0.
Something like this
$esxName = <your-ESX-hostname> $luns = Get-VmHost $esxName | Get-ScsiLun foreach($lun in $luns){ $lun | Get-ScsiLunPath }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
replace the placeholder , but no output.
Have i to put the code in .ps file ?
From where do you start your PowerShell scripts ? From the PowerCLI prompt ?
Can you do
Get-ViToolkitVersion
In any case use the short script I gave in the previous answer.
It's new in PowerCLI 4.0 and will show you path policy and which path is in use and which path is in standby.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Btw I added a new version of my script to .
The script now handles FC paths as well.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The script was started from VMware vSphere PowerCLI .
Version is VMware vSphere PowerCLI 4.0 build 162509.
I tried your new script , but no output.
So the steps were.
1.) Open a VMware vSphere PowerCLI console.
2.) Connect to an esx hosts per : Connect-VIserver esxhostname
3.) cd to d:\scripts\vmware
4.) .\emulate-esxcfg-mpath-v2.ps1
5.) script run 2 seconds and then no output . I am back at the prompt d:\scripts\vmware
What kind of storage do you have connected to that ESX server (FC, parallel, iSCSI, block) ?
What type does it show under for the device to which your disks are connected ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
After some PMs I have to conclude that the script, that emulates the esxcfg-mpath command, doesn't handle the NAA addressing that is used by NetApp.
As a quick solution you can use the other script I gave above that uses the Get-ScsiLun and Get-ScsiLunPath cmdlets.
That should at least show you what multi-path policy is used.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Luc help me a lot. Many thanks.
So now the script lists the Netapp luns, not cdrom or local hard drives.
$esxName = <your-ESX-hostname>
$luns = Get-VmHost $esxName | Get-ScsiLun
foreach($lun in $luns){
$lun | select CanonicalName , Luntype , MultipathPolicy , Model | where {$_.Model -match "LUN"}
}
Luc,
how can we run an external command in powershell.
I wanted to run the following command in vpowershell to set ALUA .
esxcli --server esxhost nmp satp setdefaultpsp --psp VMW_PSP_RR --satp VMW_SATP_ALUA
I'm afraid that PowerCLI has no straightforward method to list local directories in the COS.
The bypass you can use is the plink.exe command (that comes with the PuTTY suite) combined with a sudo setup in the COS.
You can then call the plink.exe from your PS script, execute the ls command and capture the output into a PS variable or pipe.
Have a look at for a sample how to do this.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference