New Posts‎ > ‎

Configure RDM pathing to Fixed

posted Jun 14, 2016, 11:31 AM by Kris Knight   [ updated Jun 14, 2016, 11:34 AM ]
    Configures a VM's RDM pathing to Fixed.
    Created to quickly configure MSSQL cluster VMs that need RDMs in physical compatibility mode and SCSI bus sharing. It is recommended that the path selection be configured for Fixed path.
    .\SET-RDMvmtoFixed.ps1  <ESXi Name>
Author: KnightUSN
Version: 1.0 May 2016

    [parameter(Mandatory = $true,

$hdds = get-vm $vmname | Get-HardDisk -DiskType RawPhysical

foreach($hdd in $hdds){

$lun = Get-ScsiLun -CanonicalName $hdd.ScsiCanonicalName -VmHost $hdd.Parent.VMhost

If($lun.MultipathPolicy -ne 'Fixed'){
$scsilunpath = get-scsilunpath -ScsiLun $lun | Sort-Object State | Select-Object -First 1
set-scsilun -ScsiLun $lun -MultipathPolicy Fixed -PreferredPath $scsilunpath -Confirm:$false