Skip to content

Commit 828702e

Browse files
committed
Convert storage policy id to SpbmStoragePolicy.
1 parent 0360da3 commit 828702e

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)