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
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ function _GetScenarioBackendType {
54
54
}
55
55
}
56
56
57
-
If (($backendMemberTypes|Sort-Object|Get-Unique).count -gt1) {
57
+
If (($backendMemberTypes|Sort-Object-Unique).count -gt1) {
58
58
log -ErrorAction Stop -Message "[Test-SupportedMigrationScenario] Basic Load Balancer backend pools can contain only VMs or VMSSes, contains: '$($backendMemberTypes-join',')'"-Severity 'Error'
59
59
return
60
60
}
@@ -268,7 +268,7 @@ Function Test-SupportedMigrationScenario {
If (![string]::IsNullOrEmpty($availabilitySetReference)) {
662
-
$availabilitySetVMs=$availabilitySetReference|Get-Unique|Get-AzResource|Get-AzAvailabilitySet|Select-Object-expand VirtualMachinesReferences |Select-Object-ExpandProperty Id
log -Message "[Test-SupportedMigrationScenario] Getting Availability Sets and associated VMs"-Severity Verbose
663
+
try {
664
+
$availabilitySetVMs=$availabilitySetReference|Get-Unique|Get-AzResource|Get-AzAvailabilitySet|Select-Object-expand VirtualMachinesReferences |Select-Object-ExpandProperty Id
665
+
}
666
+
catch {
667
+
$message="[Test-SupportedMigrationScenario] Error retrieving Availability Set VMs: $($_.Exception.Message)"
$message="[Test-SupportedMigrationScenario] VMs ('$($extraAvailabilitySetVMs-join';')') belong(s) to an Availability Set but is not associated with the LB. There are other members of the same Availability Set which are part of the load balancer backend pools, NAT pools, or associated with NAT Rules. This is not supported for migration. To work around this, create a new backend pool on the basic LB which is not associated with a load balancing rule and add the extra VMs to it temporarily, then retry migration."
@@ -728,7 +736,7 @@ Function Test-SupportedMultiLBScenario {
728
736
729
737
# check that all backend pool members are VMs or VMSSes
730
738
log -Message "[Test-SupportedMultiLBScenario] Checking that all backend pool members are VMs or VMSSes"
0 commit comments