Skip to content

Commit 0b35e62

Browse files
committed
Update PureStorage.FlashArray.VMware.VCF.psm1
1 parent 05a6279 commit 0b35e62

File tree

1 file changed

+36
-5
lines changed

1 file changed

+36
-5
lines changed

PureStorage.FlashArray.VMware.VCF/PureStorage.FlashArray.VMware.VCF.psm1

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,11 @@ function Initialize-PfaVcfWorkloadDomain {
8282
{
8383
throw "The cmdlet Initialize-PfaVcfWorkloadDomain is only supported with PowerShell Core (7.x or later)."
8484
}
85-
Write-Progress -id 1 -Activity "VCF and Pure ESXi Host Commission Process" -Status "Verifying input" -PercentComplete 5
86-
$vcfpools = Get-VCFNetworkPool
87-
if (($vcfpools.name -contains $VcfNetworkPool) -ne $true)
85+
if ($Protocol -eq "iSCSI" -and ($Vvol -ne $True))
8886
{
89-
throw "Invalid VCF network pool ($($vcfnetworkpool)). Please verify network pools with Get-VCFNetworkPool"
87+
throw "iSCSI can only be specified with vVols. VMFS can only be principal storage when deployed with Fibre Channel."
9088
}
89+
Write-Progress -id 1 -Activity "VCF and Pure ESXi Host Commission Process" -Status "Verifying input" -PercentComplete 5
9190
Write-Debug -Message ($vcfpools| out-string)
9291
$ErrorActionPreference = "stop"
9392
if ($Vvol -ne $true)
@@ -109,7 +108,39 @@ function Initialize-PfaVcfWorkloadDomain {
109108
Write-Progress -id 1 -Activity "VCF and Pure ESXi Host Commission Process" -Status "Connecting to Resources" -PercentComplete 10
110109
Write-Progress -parentid 1 -Id 2 -Activity "Connecting to FlashArray" -Status "Connecting to $($FlashArrayFqdn)" -PercentComplete 50
111110
$flasharray = New-PfaArray -EndPoint $FlashArrayFqdn -Credentials $FlashArrayCredential -IgnoreCertificateError
111+
if ($Vvol -eq $true)
112+
{
113+
$arrayInfo = New-PfaRestOperation -resourceType array -restOperationType GET -flasharray $flasharray -SkipCertificateCheck
114+
if ($arrayInfo.version -eq "5.3.9")
115+
{
116+
throw "Found Purity 5.3.9--this is not a supported release for vVols with VCF. Please reach out to Pure Support to upgrade Purity to 5.3.10 or higher."
117+
}
118+
if (($arrayinfo.version.split(".")[0] -eq "5") -and ($arrayinfo.version.split(".")[1] -lt 3))
119+
{
120+
throw "Found a Purity release earlier than 5.3.x (currently at $($arrayinfo.version)). Please reach out to Pure Support to upgrade Purity to 5.3.x or higher."
121+
}
122+
}
112123
$foundProtocol = checkFaProtocol -flasharray $flasharray -protocol $Protocol -ErrorAction stop
124+
$vcfpools = Get-VCFNetworkPool
125+
if (($vcfpools.name -contains $VcfNetworkPool) -ne $true)
126+
{
127+
throw "Invalid VCF network pool ($($vcfnetworkpool)). Please verify network pools with Get-VCFNetworkPool"
128+
}
129+
else {
130+
$vcfNetworkInfo = Get-VCFNetworkIPPool -id ($vcfpools |Where-Object {$_.name -eq $VcfNetworkPool}).id
131+
Write-Debug -Message ($vcfNetworkInfo| out-string)
132+
if ($foundProtocol = "iSCSI")
133+
{
134+
if (($vcfNetworkInfo.type -contains "iSCSI") -eq $false)
135+
{
136+
throw "The specified network pool $($VcfNetworkPool) does not have an iSCSI-type vLAN assigned to it. Please add one or choose a network pool that does. This is required for iSCSI-vVols deployment."
137+
}
138+
if (($vcfNetworkInfo.type -contains "VMOTION") -eq $false)
139+
{
140+
throw "The specified network pool $($VcfNetworkPool) does not have a VMOTION-type vLAN assigned to it. Please add one or choose a network pool that does. This is required for any deployment type."
141+
}
142+
}
143+
}
113144
Write-Progress -parentid 1 -Id 2 -Activity "Connecting to FlashArray" -Status "Connected to $($FlashArrayFqdn)" -PercentComplete 100
114145
$esxiConnections = @()
115146
for ($i =0;$i -lt $EsxiHostFqdn.count;$i++)
@@ -248,7 +279,7 @@ function Initialize-PfaVcfWorkloadDomain {
248279
$hostspec | Add-Member -MemberType NoteProperty -Name storageType -value "VVOL"
249280
}
250281
else {
251-
$hostspec | Add-Member -MemberType NoteProperty -Name storageType -value "FC"
282+
$hostspec | Add-Member -MemberType NoteProperty -Name storageType -value "VMFS_FC"
252283
}
253284
$hostspec | Add-Member -MemberType NoteProperty -Name password -value ($EsxiHostCredential.Password |ConvertFrom-SecureString -AsPlainText)
254285
$hostspec | Add-Member -MemberType NoteProperty -Name networkPoolName -value $VcfNetworkPool

0 commit comments

Comments
 (0)