Skip to content

Commit

Permalink
Fix multilb vm arg timeout (#125)
Browse files Browse the repository at this point in the history
* fix carlm params

* added vmss backup state file path to log

* corrected recovery parameter sets

* version bump

* fix arg timeout, test template imrpovements

* version bump
  • Loading branch information
mbrat2005 authored Jun 14, 2024
1 parent b693ee1 commit 857e0db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'AzureBasicLoadBalancerUpgrade'

# Version number of this module.
ModuleVersion = '2.4.11'
ModuleVersion = '2.4.12'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -107,7 +107,7 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = 'Fix https://github.com/Azure/AzLoadBalancerMigration/issues/124'
ReleaseNotes = 'Fix ARG timeout in multi-lb VM scenario validation'

# Prerelease string of this module
# Prerelease = ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -659,20 +659,20 @@ Function Test-SupportedMultiLBScenario {
$timeoutStopwatch = [System.Diagnostics.Stopwatch]::StartNew()
do {
If (!$waitingForARG) {
log -Message "[UpgradeVMPublicIP] Querying Resource Graph for availability sets of VMs in load balancers backend pools"
log -Message "[Test-SupportedMultiLBScenario] Querying Resource Graph for availability sets of VMs in load balancers backend pools"
}
Else {
log -Message "[UpgradeVMPublicIP] Waiting 15 seconds before querying ARG again (total wait time up to 15 minutes before failure)..."
log -Message "[Test-SupportedMultiLBScenario] Waiting 15 seconds before querying ARG again (total wait time up to 15 minutes before failure)..."
Start-Sleep 15
}

$VMAvailabilitySets = Search-AzGraph -Query $graphQuery

$waitingForARG = $true
} while ($VMPIPRecords.count -eq 0 -and $env:LBMIG_WAIT_FOR_ARG -and $timeoutStopwatch.Elapsed.Seconds -lt $global:defaultJobWaitTimeout)
} while ($VMAvailabilitySets.count -eq 0 -and $env:LBMIG_WAIT_FOR_ARG -and $timeoutStopwatch.Elapsed.Seconds -lt $global:defaultJobWaitTimeout)

If ($timeoutStopwatch.Elapsed.Seconds -gt $global:defaultJobWaitTimeout) {
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
log -Severity Error -Message "[Test-SupportedMultiLBScenario] 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
}

# VMs must share an availability set or the backend must be a single VM with no availability set ('NO_AVAILABILITY_SET')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ module vm '../modules/Microsoft.Compute/virtualMachines_custom/deploy.bicep' = {
name: 'vm-01'
params: {
adminUsername: 'admin-vm'
name: 'vm-01'
adminPassword: '${uniqueString(randomGuid)}rpP@340'
availabilitySetResourceId: availabilitySet.outputs.resourceId
location: location
Expand Down Expand Up @@ -162,7 +163,9 @@ module vm2 '../modules/Microsoft.Compute/virtualMachines_custom/deploy.bicep' =
name: 'vm-02'
params: {
adminUsername: 'admin-vm'
name: 'vm-02'
adminPassword: '${uniqueString(randomGuid)}rpP@340'
availabilitySetResourceId: availabilitySet.outputs.resourceId
location: location
imageReference: {
offer: 'WindowsServer'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module aks '../modules/aks/aks.bicep' = {
name: 'aks-module'
scope: resourceGroup(resourceGroupName)
params: {
k8sVersion: '1.28.3'
k8sVersion: '1.29'
location: location
subnetId: virtualNetworks.outputs.subnetResourceIds[0]
vmSize: vmSize
Expand Down

0 comments on commit 857e0db

Please sign in to comment.