[AI Generated] BugFix: auto-bump osdisk_size_in_gb when ARM rejects too-small OS disk#4475
Merged
Merged
Conversation
…oo-small OS disk When an Azure marketplace image's OS disk is larger than the requested osdisk_size_in_gb, ARM fails the deployment with OperationNotAllowed. Some images don't expose their disk size via the virtual_machine_images API, so the pre-deploy bump in _create_node_arm_parameters is skipped. This change parses the ARM error, bumps osdisk_size_in_gb to the size reported by ARM, and retries the deployment once. The discovered size is cached against the marketplace identifier so subsequent environments using the same image deploy correctly on the first try.
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest
Test case details
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a resilience mechanism to Azure ARM deployments when the requested osdisk_size_in_gb is smaller than the marketplace image’s actual OS disk size and Azure fails the deployment with an OperationNotAllowed-style message. The change retries the deployment once with the corrected OS disk size parsed from the ARM error, and caches the discovered size per marketplace image so subsequent deployments avoid the initial failure.
Changes:
- Add an ARM error regex to detect “OS disk size too small” failures and extract the required size.
- On matching failure, bump
osdisk_size_in_gbin the ARM deployment parameters and retry deployment once. - Cache discovered OS disk sizes keyed by marketplace identifier and apply the cached size during later ARM parameter generation.
johnsongeorge-w
approved these changes
May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When an Azure marketplace image's OS disk is larger than the requested osdisk_size_in_gb, ARM fails the deployment with OperationNotAllowed. Some images don't expose their disk size via the virtual_machine_images API, so the pre-deploy bump in _create_node_arm_parameters is skipped.
This change parses the ARM error, bumps osdisk_size_in_gb to the size reported by ARM, and retries the deployment once. The discovered size is cached against the marketplace identifier so subsequent environments using the same image deploy correctly on the first try.
Description
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results