Skip to content

[AI Generated] BugFix: add securityProfile to ephemeral OS disk for ConfidentialVM deployments#4442

Open
lubaihua33 wants to merge 1 commit intomainfrom
AI_fix/cvm-ephemeral-disk-securityprofile
Open

[AI Generated] BugFix: add securityProfile to ephemeral OS disk for ConfidentialVM deployments#4442
lubaihua33 wants to merge 1 commit intomainfrom
AI_fix/cvm-ephemeral-disk-securityprofile

Conversation

@lubaihua33
Copy link
Copy Markdown
Collaborator

@lubaihua33 lubaihua33 commented Apr 28, 2026

Confidential VM deployments failed with an error indicating that managedDisk.securityProfile.securityEncryptionType was missing for the OS disk.

Root cause
There was an inconsistency in the Azure template logic:

The standard OS disk path included managedDisk.securityProfile.
The ephemeral OS disk path did not include it.
As a result, CVM + ephemeral OS disk deployments generated an invalid disk payload for Azure.

What this PR changes
Added managedDisk.securityProfile handling to the ephemeral OS disk path in the Bicep template.
Kept the same null-safe logic pattern used by the standard OS disk path.
Regenerated the corresponding ARM JSON template to keep generated artifacts in sync.

Validation
The fix was validated with 3 runs:

CVM + ephemeral OS disk: Passed (original failing scenario).
Standard SSD provisioning regression: Passed.
Non-CVM + ephemeral OS disk regression: Passed.

Copilot AI review requested due to automatic review settings April 28, 2026 07:17
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

Fixes Azure Confidential VM (CVM) deployments with ephemeral OS disks by ensuring the OS disk payload includes managedDisk.securityProfile (matching the standard OS disk path), and updates the generated ARM artifact accordingly.

Changes:

  • Add managedDisk.securityProfile to the ephemeral OS disk path in arm_template.bicep.
  • Regenerate autogen_arm_template.json to reflect the Bicep change.
  • Remove the temporary CvmDisabled() restriction from the ephemeral-disk provisioning smoke test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
lisa/sut_orchestrator/azure/autogen_arm_template.json Regenerated ARM JSON to include managedDisk.securityProfile for ephemeral OS disk scenario.
lisa/sut_orchestrator/azure/arm_template.bicep Adds null-safe managedDisk.securityProfile emission for ephemeral OS disk when security_type == 'ConfidentialVM'.
lisa/microsoft/testsuites/core/provisioning.py Allows the ephemeral-disk provisioning test to run without forcing CVM-disabled environments.

Comment on lines +114 to +116
managedDisk: {
securityProfile: (empty(node.security_profile) || (node.security_profile.security_type != 'ConfidentialVM')) ? null : getSecurityProfileForOSDisk(node)
}
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

getEphemeralOSImage now always emits a managedDisk object, and for non-ConfidentialVM nodes it can end up as an empty object (because securityProfile evaluates to null). To avoid unexpected payload shape changes (and potential ARM schema/Compute API validation issues), consider making the entire managedDisk property conditional so it is omitted unless a ConfidentialVM security profile is required.

Suggested change
managedDisk: {
securityProfile: (empty(node.security_profile) || (node.security_profile.security_type != 'ConfidentialVM')) ? null : getSecurityProfileForOSDisk(node)
}
...((empty(node.security_profile) || (node.security_profile.security_type != 'ConfidentialVM')) ? {} : {
managedDisk: {
securityProfile: getSecurityProfileForOSDisk(node)
}
})

Copilot uses AI. Check for mistakes.
Comment on lines 211 to 214
requirement=simple_requirement(
environment_status=EnvironmentStatus.Deployed,
disk=DiskEphemeral(),
supported_features=[CvmDisabled()], # TODO: Fix disk deployment for CVM
),
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

Removing the CvmDisabled() constraint means this provisioning smoke test no longer guarantees coverage of the original failing scenario (CVM + ephemeral OS disk) in automated runs—selection may still choose a non-CVM security profile. Consider adding a dedicated test case (or adjusting this one) that explicitly requires CvmEnabled() along with DiskEphemeral() so the regression is continuously exercised.

Copilot uses AI. Check for mistakes.
Comment on lines 211 to 214
requirement=simple_requirement(
environment_status=EnvironmentStatus.Deployed,
disk=DiskEphemeral(),
supported_features=[CvmDisabled()], # TODO: Fix disk deployment for CVM
),
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

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

This is a bug fix PR but there’s no linked issue/work item in the PR description. Consider linking the related issue for traceability (or add a short note that there isn’t one).

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

13 test case(s) selected (view run)

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

Count
✅ Passed 13
❌ Failed 0
⏭️ Skipped 0
Total 13
Test case details
Test Case Status Time (s) Message
verify_deployment_provision_ephemeral_managed_disk (lisa_0_4) ✅ PASSED 29.851
smoke_test_check_serial_console_pattern (lisa_0_1) ✅ PASSED 45.462
verify_deployment_provision_synthetic_nic (lisa_0_2) ✅ PASSED 47.392
verify_deployment_provision_standard_ssd_disk (lisa_0_3) ✅ PASSED 54.571
smoke_test (lisa_0_0) ✅ PASSED 60.978
verify_deployment_provision_premium_disk (lisa_0_5) ✅ PASSED 28.844
verify_deployment_provision_premiumv2_disk (lisa_0_6) ✅ PASSED 36.038
verify_reboot_in_platform (lisa_0_8) ✅ PASSED 43.406
verify_deployment_provision_ultra_datadisk (lisa_0_9) ✅ PASSED 40.855
verify_deployment_provision_sriov (lisa_0_7) ✅ PASSED 52.041
verify_deployment_provision_swiotlb_force (lisa_0_12) ✅ PASSED 105.047
verify_stop_start_in_platform (lisa_0_10) ✅ PASSED 199.998
stress_reboot (lisa_0_11) ✅ PASSED 549.970

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants