Skip to content

Commit

Permalink
Merge pull request #8352 from vr4manta/SPLAT-1599_fix-storagepolicy
Browse files Browse the repository at this point in the history
SPLAT-1599: Convert storage policy id to SpbmStoragePolicy.
  • Loading branch information
openshift-merge-bot[bot] committed May 6, 2024
2 parents 0360da3 + 828702e commit 419b435
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions upi/vsphere/powercli/upi-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ function New-OpenShiftVM {
}
}

# If storage policy is set, lets pull the mo ref
if ($NULL -ne $StoragePolicy -and $StoragePolicy -ne "")
{
$storagePolicyRef = Get-SpbmStoragePolicy -Id $StoragePolicy
$args["StoragePolicy"] = $storagePolicyRef
}

# Clone the virtual machine from the imported template
# $vm = New-VM -VM $Template -Name $Name -Datastore $Datastore -ResourcePool $ResourcePool #-Location $Folder #-LinkedClone -ReferenceSnapshot $Snapshot
$vm = New-VM -VM $Template @args
Expand Down

0 comments on commit 419b435

Please sign in to comment.