Skip to content

Commit

Permalink
Execution only if user provides multipathing policy
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Sep 13, 2023
1 parent 259cd23 commit 586999a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Microsoft.AVS.VMFS/Microsoft.AVS.VMFS.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function New-VmfsDatastore {
HelpMessage = 'Set Multipath policy')]
[ValidateNotNull()]
[String]
$MultipathPolicy = "VMW_PSP_MRU",
$MultipathPolicy,
)

try {
Expand Down Expand Up @@ -209,7 +209,10 @@ function New-VmfsDatastore {
$VmfsDatastoreCreateSpec.vmfs.MajorVersion = $DatastoreCreateOptions[0].Spec.Vmfs.MajorVersion

$DatastoreSystem.CreateVmfsDatastore($VmfsDatastoreCreateSpec)
Set-VMFSDatastoreMultipathPolicy -DatastoreName $DatastoreName -MultipathPolicy $MultipathPolicy

if (-not [string]::IsNullOrEmpty($MultipathPolicy)) {
Set-VMFSDatastoreMultipathPolicy -DatastoreName $DatastoreName -MultipathPolicy $MultipathPolicy
}
} catch {
Write-Error $Global:Error[0]
}
Expand Down

0 comments on commit 586999a

Please sign in to comment.