Skip to content

Use x64 as default arch for .vhd images#4463

Open
SRIKKANTH wants to merge 1 commit into
mainfrom
smyakam/2026_04_27/vhd_default_arch_x86
Open

Use x64 as default arch for .vhd images#4463
SRIKKANTH wants to merge 1 commit into
mainfrom
smyakam/2026_04_27/vhd_default_arch_x86

Conversation

@SRIKKANTH
Copy link
Copy Markdown
Collaborator

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

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

  • verify_nvme_basic
  • verify_nvme_function
  • verify_nvme_function_unpartitioned
  • verify_nvme_fstrim
  • verify_nvme_blkdiscard
  • verify_nvme_manage_ns
  • verify_nvme_rescind

Impacted LISA Features:

Tested Azure Marketplace Images:

  • Canonical 0001-com-ubuntu-pro-microsoft pro-fips-20_04 latest

Test Results

Image VM Size Result
Canonical 0001-com-ubuntu-pro-microsoft pro-fips-20_04 latest Standard_L8as_v3 PASSED

Copilot AI review requested due to automatic review settings May 3, 2026 12:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 36.860

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.architecture to 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.

Comment on lines +567 to +571
# 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
Comment on lines 565 to +570
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:
Comment on lines 565 to +572
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

@SRIKKANTH SRIKKANTH force-pushed the smyakam/2026_04_27/vhd_default_arch_x86 branch from 4f08da7 to a9cc133 Compare May 3, 2026 13:30
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 3, 2026

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-arm64 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
smoke_test (lisa_0_0) ✅ PASSED 36.000

@SRIKKANTH SRIKKANTH assigned umfranci and unassigned umfranci May 6, 2026
@SRIKKANTH SRIKKANTH requested a review from umfranci May 6, 2026 04:56
@SRIKKANTH
Copy link
Copy Markdown
Collaborator Author

@LiliDeng , @johnsongeorge-w ,
Can you review and approve this PR.

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.

Comment on lines +566 to +569
# 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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arm64 sizes dont support vhd. They need sig images in case of custom images.

Copy link
Copy Markdown
Collaborator

@kanchansenlaskar kanchansenlaskar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please address a minor comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants