Hi expert
I will upgrade ESXi 4.1 to ESXi5.1
But We upgrade process use clean install because replace usb boot to network boot.
How to migrate disk path setting?
I using Prefered path, and different for each host.
Could you help me or any idia?
Best regards
Hironori
Use the following versions of the scripts.
For the export
Get-VMHost |
Get-ScsiLun -LunType disk |
Select @{N="VMHost";E={$_.VMHost.Name}},CanonicalName,MultipathPolicy,
@{N="Preferred";E={
if($_.MultipathPolicy -eq "Fixed"){
Get-ScsiLunPath -ScsiLun $_ | where {$_.Preferred} |
Select -ExpandProperty Name
}
}} |
Export-Csv C:\Lun-Path-Policy.csv -NoTypeInformation -UseCulture
And for the import
Import-Csv C:\Lun-Path-Policy.csv -UseCulture | %{
$lun = Get-ScsiLun -CanonicalName $_.CanonicalName -VMHost $_.VMHost -LunType disk
if($_.MultiPathPolicy -eq "Fixed"){}
$prefPath = $_.Preferred
$path = Get-ScsiLunPath -ScsiLun $lun | where {$_.Name -eq $prefPath}
Set-ScsiLun -ScsiLun $lun -MultipathPolicy $_.MultiPathPolicy -Confirm:$false -PreferredPath $path
else{
Set-ScsiLun -ScsiLun $lun -MultipathPolicy $_.MultiPathPolicy -Confirm:$false
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Sorry! additional.
How to dump pathsetting before upgrade ?
And
how to set path againg after upgrade ?
Use this for the export
Get-VMHost |
Get-ScsiLun -LunType disk |
Select @{N="VMHost";E={$_.VMHost.Name}},CanonicalName,MultipathPolicy |
Export-Csv C:\Lun-Path-Policy.csv -NoTypeInformation -UseCulture
And you configure the path policy with this
Import-Csv C:\Lun-Path-Policy.csv -UseCulture | %{
Get-ScsiLun -CanonicalName $_.CanonicalName -VmHost $_.VMHost -LunType disk |
Set-ScsiLun -MultipathPolicy $_.MultiPathPolicy -Confirm:$false
}
Try this out in a test environment before you use it in your live environment !
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you for your reply.
I try it soon.
Additinal.
Could you tell me how to migrate preferd path setting?
Sorry
Use the following versions of the scripts.
For the export
Get-VMHost |
Get-ScsiLun -LunType disk |
Select @{N="VMHost";E={$_.VMHost.Name}},CanonicalName,MultipathPolicy,
@{N="Preferred";E={
if($_.MultipathPolicy -eq "Fixed"){
Get-ScsiLunPath -ScsiLun $_ | where {$_.Preferred} |
Select -ExpandProperty Name
}
}} |
Export-Csv C:\Lun-Path-Policy.csv -NoTypeInformation -UseCulture
And for the import
Import-Csv C:\Lun-Path-Policy.csv -UseCulture | %{
$lun = Get-ScsiLun -CanonicalName $_.CanonicalName -VMHost $_.VMHost -LunType disk
if($_.MultiPathPolicy -eq "Fixed"){}
$prefPath = $_.Preferred
$path = Get-ScsiLunPath -ScsiLun $lun | where {$_.Name -eq $prefPath}
Set-ScsiLun -ScsiLun $lun -MultipathPolicy $_.MultiPathPolicy -Confirm:$false -PreferredPath $path
else{
Set-ScsiLun -ScsiLun $lun -MultipathPolicy $_.MultiPathPolicy -Confirm:$false
}
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Feedback!
Script error occur "Set-ScsiLun If the Multipathpolicy parameter is set to 'Fixed', you must specify the PreferredPath parameter".
I can`t found Preferred parameter in get-scsilun commandlet output.
thank you.
Hiro
I updated the import script above, please try again.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Feedback!
Second script Error occurs "set-scsilun : paramter 'ScsiLun' can not bind."
???
OK I retry it
Hi LucD
your script work fine!
Thank you very much
hiro