Skip to content

Commit 419b435

Browse files
Merge pull request #8352 from vr4manta/SPLAT-1599_fix-storagepolicy
SPLAT-1599: Convert storage policy id to SpbmStoragePolicy.
2 parents 0360da3 + 828702e commit 419b435

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

upi/vsphere/powercli/upi-functions.ps1

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ function New-OpenShiftVM {
4444
}
4545
}
4646

47+
# If storage policy is set, lets pull the mo ref
48+
if ($NULL -ne $StoragePolicy -and $StoragePolicy -ne "")
49+
{
50+
$storagePolicyRef = Get-SpbmStoragePolicy -Id $StoragePolicy
51+
$args["StoragePolicy"] = $storagePolicyRef
52+
}
53+
4754
# Clone the virtual machine from the imported template
4855
# $vm = New-VM -VM $Template -Name $Name -Datastore $Datastore -ResourcePool $ResourcePool #-Location $Folder #-LinkedClone -ReferenceSnapshot $Snapshot
4956
$vm = New-VM -VM $Template @args

0 commit comments

Comments
 (0)