Skip to content

Commit 98e274a

Browse files
authored
Fix shared avset test casing (#154)
* make AV set ID lower case * version bump
1 parent 3fe6078 commit 98e274a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

AzureBasicLoadBalancerUpgrade/module/AzureBasicLoadBalancerUpgrade/AzureBasicLoadBalancerUpgrade.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AzureBasicLoadBalancerUpgrade'
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.5.34'
15+
ModuleVersion = '2.5.35'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -107,7 +107,7 @@
107107
# IconUri = ''
108108

109109
# ReleaseNotes of this module
110-
ReleaseNotes = 'Improve multi-LB scenario AV set membership validation error message.'
110+
ReleaseNotes = 'Fix multi-LB scenario validation to handle inconsistent casing on availability set IDs.'
111111

112112
# Prerelease string of this module
113113
# Prerelease = 'beta'

AzureBasicLoadBalancerUpgrade/module/AzureBasicLoadBalancerUpgrade/modules/ValidateScenario/ValidateScenario.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ Function Test-SupportedMigrationScenario {
606606
}
607607
}
608608

609-
# warn that internal LB backends will have no outbound connectivity
609+
# warn that internal load balancer backends will have no outbound connectivity
610610
If (!$AllVMsHavePublicIPs -and $scenario.ExternalOrInternal -eq 'Internal') {
611611
$message = "[Test-SupportedMigrationScenario] Internal load balancer backend VMs do not have Public IPs and will not have outbound internet connectivity after migration to a Standard LB."
612612
log -Message $message -Severity 'Warning'
@@ -805,7 +805,7 @@ Function Test-SupportedMultiLBScenario {
805805
resources |
806806
where type =~ 'microsoft.network/networkinterfaces' and id in~ ($joinedNicIDs) |
807807
project lbNicVMId = tolower(tostring(properties.virtualMachine.id)) |
808-
join ( resources | where type =~ 'microsoft.compute/virtualmachines' | project vmId = tolower(id), availabilitySetId = coalesce(properties.availabilitySet.id, 'NO_AVAILABILITY_SET')) on `$left.lbNicVMId == `$right.vmId |
808+
join ( resources | where type =~ 'microsoft.compute/virtualmachines' | project vmId = tolower(id), availabilitySetId = coalesce(tolower(properties.availabilitySet.id), 'NO_AVAILABILITY_SET')) on `$left.lbNicVMId == `$right.vmId |
809809
project availabilitySetId
810810
"@
811811

@@ -832,7 +832,7 @@ Function Test-SupportedMultiLBScenario {
832832
}
833833

834834
# VMs must share an availability set or the backend must be a single VM with no availability set ('NO_AVAILABILITY_SET')
835-
$uniqueAvailabilitySets = $VMAvailabilitySets.availabilitySetId | Sort-Object | Get-Unique
835+
$uniqueAvailabilitySets = $VMAvailabilitySets.availabilitySetId | Sort-Object | Get-Unique -CaseInsensitive
836836
If (($uniqueAvailabilitySets.count -gt 1 -or ($VMAvailabilitySets.availabilitySetId | Where-Object { $_ -eq 'NO_AVAILABILITY_SET' }).count -gt 1)) {
837837
log -Severity Error -Message "[Test-SupportedMultiLBScenario] The provided Basic Load Balancers do not share backend pool members (VMs are in different or no Availability Sets: '$($uniqueAvailabilitySets -join ',')'). Using -multiLBConfig when backend is not shared adds risk and complexity in recovery." -terminateOnError
838838
}

0 commit comments

Comments
 (0)