You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AzureBasicLoadBalancerUpgrade/module/AzureBasicLoadBalancerUpgrade/modules/ValidateScenario/ValidateScenario.psm1
+96Lines changed: 96 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -547,6 +547,25 @@ Function Test-SupportedMultiLBScenario {
547
547
548
548
log -Message "[Test-SupportedMultiLBScenario] Verifying if Multi-LB configuration is valid for migration"
549
549
550
+
# check that backend type is not 'empty', meaning there is no reason to use -multiLBConfig
551
+
log -Message "[Test-SupportedMultiLBScenario] Checking that backend type is not 'empty' for any of the multi load balancers"
552
+
If ($multiLBConfig.scenario.backendType-contains'Empty') {
553
+
log -ErrorAction Stop -Severity 'Error'-Message "[Test-SupportedMultiLBScenario] One or more Basic Load Balancers backend is empty. Empty load balancer should not be included in -multiLBConfig. Use standalone migrations or remove the load balancer with the empty backend from the -multiLBConfig parameter"
554
+
return
555
+
}
556
+
557
+
# check that all backend pool members are VMs or VMSSes
558
+
log -Message "[Test-SupportedMultiLBScenario] Checking that all backend pool members are VMs or VMSSes"
log -ErrorAction Stop -Severity 'Error'-Message "[Test-SupportedMultiLBScenario] Basic Load Balancer backend pools can contain only VMs or VMSSes, contains: '$($backendMemberTypes-join',')'"
563
+
return
564
+
}
565
+
Else {
566
+
log -Message "[Test-SupportedMultiLBScenario] All backend pool members are '$($backendMemberTypes)'"
567
+
}
568
+
550
569
# check that standard load balancer names are different if basic load balancers are in the same resource group
551
570
log -Message "[Test-SupportedMultiLBScenario] Checking that standard load balancer names are different if basic load balancers are in the same resource group"
552
571
@@ -571,6 +590,83 @@ Function Test-SupportedMultiLBScenario {
571
590
}
572
591
}
573
592
593
+
# check that that the provided load balancer do share backend pool members - using -multiLBConfig when backend is not shared adds risk
594
+
log -Message "[Test-SupportedMultiLBScenario] Checking that that the provided load balancer do share backend pool members - using -multiLBConfig when backend is not shared adds risk"
595
+
596
+
## shared backend should be a single VMSS
597
+
If ($multiLBConfig[0].scenario.backendType -eq'VMSS') {
log -Severity Error -Message "[Test-SupportedMultiLBScenario] The provided Basic Load Balancers do not share backend pool members (more than one backend VMSS found: '$($groupedBackends)'). Using -multiLBConfig when backend is not shared adds risk and complexity in recovery."-terminateOnError
606
+
}
607
+
Else {
608
+
log -Message "[Test-SupportedMultiLBScenario] The provided Basic Load Balancers share '$($groupedBackends.count)' backend pool members."
609
+
}
610
+
}
611
+
612
+
## shared backend should be a single Availability Set for VMs
613
+
If ($multiLBConfig[0].scenario.backendType -eq'VM') {
} while ($VMPIPRecords.count-eq0-and$env:LBMIG_WAIT_FOR_ARG-and$timeoutStopwatch.Elapsed.Seconds-lt$global:defaultJobWaitTimeout)
655
+
656
+
If ($timeoutStopwatch.Elapsed.Seconds-gt$global:defaultJobWaitTimeout) {
657
+
log -Severity Error -Message "[UpgradeVMPublicIP] Resource Graph query timed out before results were returned! The Resource Graph lags behind ARM by several minutes--if the resources to migrate were just created (as in a test), test the query from the log to determine if this was an ingestion lag or synax failure. Once the issue has been corrected follow the steps at https://aka.ms/basiclbupgradefailure to retry the migration."-terminateOnError
658
+
}
659
+
660
+
# VMs must share an availability set or the backend must be a single VM with no availability set ('NO_AVAILABILITY_SET')
661
+
If (($VMAvailabilitySets.availabilitySetId|Sort-Object|Get-Unique).count -gt1-or ($VMAvailabilitySets.availabilitySetId|Where-Object {$_-eq'NO_AVAILABILITY_SET'}).count -gt1) {
662
+
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: '$($VMAvailabilitySets.availabilitySetId-join',')'). Using -multiLBConfig when backend is not shared adds risk and complexity in recovery."-terminateOnError
0 commit comments