Skip to content

Commit 10491b3

Browse files
committed
fixed minor bugs
1 parent 0b35e62 commit 10491b3

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,14 @@ function Initialize-PfaVcfWorkloadDomain {
120120
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."
121121
}
122122
}
123-
$foundProtocol = checkFaProtocol -flasharray $flasharray -protocol $Protocol -ErrorAction stop
123+
if ([string]::IsNullOrWhiteSpace($Protocol))
124+
{
125+
$foundProtocol = checkFaProtocol -flasharray $flasharray -ErrorAction stop
126+
}
127+
else {
128+
$foundProtocol = checkFaProtocol -flasharray $flasharray -protocol $Protocol -ErrorAction stop
129+
}
130+
Write-Debug -Message $foundProtocol
124131
$vcfpools = Get-VCFNetworkPool
125132
if (($vcfpools.name -contains $VcfNetworkPool) -ne $true)
126133
{
@@ -129,16 +136,16 @@ function Initialize-PfaVcfWorkloadDomain {
129136
else {
130137
$vcfNetworkInfo = Get-VCFNetworkIPPool -id ($vcfpools |Where-Object {$_.name -eq $VcfNetworkPool}).id
131138
Write-Debug -Message ($vcfNetworkInfo| out-string)
132-
if ($foundProtocol = "iSCSI")
139+
if ($foundProtocol -eq "iSCSI")
133140
{
134141
if (($vcfNetworkInfo.type -contains "iSCSI") -eq $false)
135142
{
136143
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."
137144
}
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-
}
145+
}
146+
if (($vcfNetworkInfo.type -contains "VMOTION") -eq $false)
147+
{
148+
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."
142149
}
143150
}
144151
Write-Progress -parentid 1 -Id 2 -Activity "Connecting to FlashArray" -Status "Connected to $($FlashArrayFqdn)" -PercentComplete 100
@@ -189,7 +196,7 @@ function Initialize-PfaVcfWorkloadDomain {
189196
}
190197
}
191198
Write-Debug -Message ($faHosts| out-string)
192-
$groupName = ("vCF-WorkloadDomain-" + (get-random -Maximum 9999 -Minimum 1000))
199+
$groupName = ("VCF-WorkloadDomain-" + (get-random -Maximum 9999 -Minimum 1000))
193200
$hostGroup = New-PfaRestOperation -resourceType "hgroup/$($groupName)" -restOperationType POST -flasharray $flasharray -SkipCertificateCheck -ErrorAction stop
194201
if ($fahosts.count -gt 0)
195202
{

0 commit comments

Comments
 (0)