Use x64 as default arch for .vhd images#4463
Conversation
✅ 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
|
There was a problem hiding this comment.
Pull request overview
This PR updates Azure custom VHD handling so unannotated VHD images default to x64 during image feature loading, with the goal of preventing Azure size selection from drifting to Arm64 SKUs for x86 VHDs. This change sits in the Azure image-capability enrichment path that feeds VM-size matching during environment preparation.
Changes:
- Default
VhdSchema.architectureto x64 when a VHD image does not provide architecture metadata. - Preserve the existing VHD security-profile inference based on VMGS presence.
- Document the rationale for constraining VHD-backed image selection to x64 by default.
| # architecture metadata for them, and uploaded VHDs in this codepath | ||
| # are x64. Restrict candidate VM sizes to x64 to avoid selecting | ||
| # ARM64 SKUs that would fail to boot the VHD. | ||
| if self.architecture is None: | ||
| self.architecture = schema.ArchitectureType.x64 |
| def load_from_platform(self, platform: "AzurePlatform") -> None: | ||
| # VHD images are user-provided custom images. Azure does not expose | ||
| # architecture metadata for them, and uploaded VHDs in this codepath | ||
| # are x64. Restrict candidate VM sizes to x64 to avoid selecting | ||
| # ARM64 SKUs that would fail to boot the VHD. | ||
| if self.architecture is None: |
| def load_from_platform(self, platform: "AzurePlatform") -> None: | ||
| # VHD images are user-provided custom images. Azure does not expose | ||
| # architecture metadata for them, and uploaded VHDs in this codepath | ||
| # are x64. Restrict candidate VM sizes to x64 to avoid selecting | ||
| # ARM64 SKUs that would fail to boot the VHD. | ||
| if self.architecture is None: | ||
| self.architecture = schema.ArchitectureType.x64 | ||
|
|
4f08da7 to
a9cc133
Compare
✅ 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
|
|
@LiliDeng , @johnsongeorge-w , only AMD64 VMs support .vhd files as OS disks. Arm64 need SIG images. This change adding AMD64 as default value in the absence of user input. |
| # VHD images are user-provided custom images. Azure does not expose | ||
| # architecture metadata for them, and uploaded VHDs in this codepath | ||
| # are x64. Restrict candidate VM sizes to x64 to avoid selecting | ||
| # ARM64 SKUs that would fail to boot the VHD. |
There was a problem hiding this comment.
Nit: "uploaded VHDs in this codepath are x64", is not universally true — users could upload an ARM64 VHD.
A more accurate phrasing would be:
"Azure does not expose architecture metadata for VHDs, so default to x64 when the user has not explicitly specified an architecture. Users deploying ARM64 VHDs should set architecture: Arm64 in the runbook"
There was a problem hiding this comment.
arm64 sizes dont support vhd. They need sig images in case of custom images.
kanchansenlaskar
left a comment
There was a problem hiding this comment.
LGTM, please address a minor comment
Description
OS disk vhd doesn't come with any arch details. I found LISA trying to use arm64 sizes for x86 vhds and fail when test VM size is specified. This PR will use x86 as default arch for any vhd when no arch is provided.
Related Issue
Type of Change
Checklist
Test Validation
Key Test Cases:
Impacted LISA Features:
Tested Azure Marketplace Images:
Test Results