Skip to content

Support data disk for shared image gallery transformer#4521

Open
lubaihua33 wants to merge 1 commit into
mainfrom
baihua/sig_datadisk
Open

Support data disk for shared image gallery transformer#4521
lubaihua33 wants to merge 1 commit into
mainfrom
baihua/sig_datadisk

Conversation

@lubaihua33

@lubaihua33 lubaihua33 commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Description

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

Test has been passed with the following runbook:

transformer:
  - type: azure_sig
    enabled: $(enable_transformer_to_sig)
    vhd:
      vhd_path: "$(vhd_path)"
      data_vhd_paths: "$(vhd_data_path1),$(vhd_data_path2)"
    gallery_resource_group_name: $(gallery_rg_name)
    gallery_name: $(gallery_name)
    gallery_image_location:
      - $(location)
    gallery_image_hyperv_generation: $(hyperv_generation)
    gallery_image_name: $(gallery_image_name)
    gallery_image_architecture: $(gallery_image_architecture)
    gallery_image_fullname: $(gallery_image_fullname)
    gallery_image_securitytype: $(gallery_image_securitytype)
    rename:
      azure_sig_url: shared_gallery
  # This is to change vhd value to "" in case of ARM since vhd has
  # high priority than shared_gallery
  - type: script
    enabled: $(enable_transformer_to_sig)
    scripts:
      - name: vhd
        variables:
          - vhd
        script: "str('')"
    rename:
      script_vhd: vhd

Tests have been passed with the following image with data disk:
ibm-usa-ny-armonk-hq-6275750-ibmcloud-aiops 2023-03-27-twas-single-server-base-image 2023-03-27-twas-single-server-base-image 9.0.20250429

Copilot AI review requested due to automatic review settings June 9, 2026 11:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds support for including data disk VHDs when creating a Shared Image Gallery (SIG) image version via the azure_sig transformer, and adjusts the ARM/Bicep template to emit null for dataDisks when no data disks are specified.

Changes:

  • Extend azure_sig transformer configuration to accept either a string VHD URI (back-compat) or an object that can also carry data disk VHD URIs.
  • Validate existence of both OS and data disk blobs and pass data disk sources into SIG image version creation.
  • Update ARM/Bicep templates so dataDisks becomes null (omitted) when data_disks is empty.

Reviewed changes

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

File Description
lisa/sut_orchestrator/azure/transformers.py Accepts structured VHD inputs (OS + data disks), resolves/copies VHD URIs, and validates blob existence before SIG creation.
lisa/sut_orchestrator/azure/common.py Adds optional data_vhd_paths and populates storageProfile.dataDiskImages when creating a SIG image version.
lisa/sut_orchestrator/azure/autogen_arm_template.json Emits null for dataDisks when no data disks are specified (generated output).
lisa/sut_orchestrator/azure/arm_template.bicep Implements the conditional dataDisks: null behavior in source Bicep.

Comment on lines 4 to 7
import re
from dataclasses import dataclass, field
from pathlib import PurePosixPath
from typing import Any, Dict, List, Optional, Type, Union, cast
Comment on lines +736 to +738
def _resolve_vhd_sources(
self, runbook: SigTransformerSchema
) -> tuple[str, List[str]]:
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 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 35.807

LiliDeng
LiliDeng previously approved these changes Jun 10, 2026
@github-actions

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 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 53.243

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.

3 participants