Skip to content

feat: experimental azure report ready#8935

Draft
awesomenix wants to merge 1 commit into
mainfrom
nishp/experimental/skip
Draft

feat: experimental azure report ready#8935
awesomenix wants to merge 1 commit into
mainfrom
nishp/experimental/skip

Conversation

@awesomenix

Copy link
Copy Markdown
Contributor

NOTHING TO LOOK HERE

Copilot AI review requested due to automatic review settings July 14, 2026 11:29

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 introduces an experimental “report ready/failure to Azure fabric” flow intended for Ubuntu images by (a) shipping a standalone Python reporter into the VHD, (b) patching Ubuntu cloud-init’s Azure datasource to optionally skip its built-in ready report based on user-data, and (c) updating e2e VMSS plumbing to optionally skip CustomScript extension/status handling.

Changes:

  • Add a new cloud-init provisioning status reporter script and attempt to invoke it from cse_start.sh after provisioning completes.
  • Patch Ubuntu cloud-init (DataSourceAzure.py) during VHD build to treat a # azure-skip-ready-report user-data marker as an additional condition to skip the built-in report.
  • Add an e2e SkipCustomScriptExtensionStatus flag and use it to alter VMSS extension behavior and status parsing.

Reviewed changes

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

Show a summary per file
File Description
vhdbuilder/packer/vhd-image-builder-cvm.json Adds a new artifact to the Packer file provisioner list.
vhdbuilder/packer/vhd-image-builder-base.json Adds a new artifact to the Packer file provisioner list.
vhdbuilder/packer/vhd-image-builder-arm64-gen2.json Adds a new artifact to the Packer file provisioner list.
vhdbuilder/packer/vhd-image-builder-arm64-gb.json Adds a new artifact to the Packer file provisioner list.
vhdbuilder/packer/packer_source.sh Copies the new reporter script into /opt/azure/containers/ during image build.
vhdbuilder/packer/install-dependencies.sh Patches Ubuntu cloud-init Azure datasource to support the new “skip ready report” marker.
parts/linux/cloud-init/artifacts/cse_start.sh Attempts to invoke the reporter script to send Ready/NotReady after CSE finishes.
parts/linux/cloud-init/artifacts/clout_init_report_ready.py New Python implementation of Ready/NotReady reporting to wireserver/KVP.
e2e/vmss.go Adds conditional logic to avoid CSE extension status parsing when skipped.
e2e/test_helpers.go Adds conditional logic around fetching CustomScript extension status.
e2e/config/vhd.go Introduces SkipCustomScriptExtensionStatus in the Image config and enables it for several Ubuntu images.
Comments suppressed due to low confidence (1)

vhdbuilder/packer/vhd-image-builder-arm64-gen2.json:246

  • The added file provisioner references parts/linux/cloud-init/artifacts/cloud_init_report_ready.py, but that file does not exist in the repo (the new script is clout_init_report_ready.py). This will break Packer builds until the filename and all references are made consistent.
      "source": "parts/linux/cloud-init/artifacts/cse_send_logs.py",
      "destination": "/home/packer/cse_send_logs.py"
    },
    {
      "type": "file",

Comment on lines +238 to +242
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/cloud_init_report_ready.py",
"destination": "/home/packer/cloud_init_report_ready.py"
},
Comment on lines +250 to +254
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/cloud_init_report_ready.py",
"destination": "/home/packer/cloud_init_report_ready.py"
},
Comment on lines +242 to +246
{
"type": "file",
"source": "parts/linux/cloud-init/artifacts/cloud_init_report_ready.py",
"destination": "/home/packer/cloud_init_report_ready.py"
},
Comment on lines +155 to +159
if isUbuntu "$OS"; then
CSE_CLOUD_INIT_REPORT_READY_SRC=/home/packer/cloud_init_report_ready.py
CSE_CLOUD_INIT_REPORT_READY_DEST=/opt/azure/containers/cloud_init_report_ready.py
cpAndMode $CSE_CLOUD_INIT_REPORT_READY_SRC $CSE_CLOUD_INIT_REPORT_READY_DEST 0744
fi
Comment thread parts/linux/cloud-init/artifacts/cse_start.sh Outdated
Comment on lines +89 to +91
# When this file exists, cloud-init is handling the ready report itself,
# so this script should not send a duplicate report to the wireserver.
REPORT_MARKER = "/var/lib/waagent/experimental_skip_ready_report"
Comment on lines +343 to +345
Skipped if the experimental_skip_ready_report marker exists, which
indicates cloud-init is handling the report itself.
"""
Comment on lines +377 to +378
Skipped if the experimental_skip_ready_report marker exists.
"""
Comment thread e2e/vmss.go
Comment on lines +127 to 135
if !s.VHD.SkipCustomScriptExtensionStatus {
exitCode, ok := getLinuxCSEExitCode(ctx, s)
if !ok || exitCode != cseExitCodeOutboundConnFail {
return vm, err
}
}

toolkit.Logf(ctx, "CSE failed with ERR_OUTBOUND_CONN_FAIL (exit %s) on VMSS %q: known transient e2e outbound flake, recreating node (attempt %d/%d)", exitCode, s.Runtime.VMSSName, attempt+1, maxOutboundCSERetries)
// Close this attempt's bastion tunnel before recreating: the SSH client is established
Comment thread e2e/test_helpers.go
Comment on lines +365 to +368
if s.VHD.SkipCustomScriptExtensionStatus {
err = getCustomScriptExtensionStatus(s, scenarioVM.VM)
require.NoError(s.T, err)
}
@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=172153655
Failed job/stage/task: build stage: representative Build VHD jobs, exit code 2.

Detective summary: Build VHD failed before image creation because init-packer reached the local preflight error SKU_NAME must be set for linux VHD builds. Downstream Test/Scan cleanup reported missing SIG image versions because the build step never produced an image.

Likely cause / signature: $skuSig.

Confidence: High for immediate cause; medium for source of variable loss.

Recommended owner/action: AgentBaker Linux VHD build pipeline/template owner should inspect definition 119535 matrix/variable generation and restore SKU_NAME for Linux VHD jobs. No PR author action unless PR #8935 changed pipeline templates or SKU wiring.

Strongest alternative: SIG image lookup race after successful build; less likely because the earlier Build VHD step aborts before image creation with missing SKU_NAME.

Evidence: Timeline shows Build VHD failures across multiple jobs; logs show POOL_NAME is set to nodesig-test-pool, then SKU_NAME must be set for linux VHD builds, followed by make errors; Test/Scan ResourceNotFound is downstream.

Wiki signature: $skuSig

Copilot AI review requested due to automatic review settings July 14, 2026 13:15
@awesomenix awesomenix force-pushed the nishp/experimental/skip branch from 2411223 to ade310f Compare July 14, 2026 13:15

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

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

Comment thread e2e/vmss.go
Comment on lines +127 to 134
if !s.VHD.SkipCustomScriptExtensionStatus {
exitCode, ok := getLinuxCSEExitCode(ctx, s)
if !ok || exitCode != cseExitCodeOutboundConnFail {
return vm, err
}
}

toolkit.Logf(ctx, "CSE failed with ERR_OUTBOUND_CONN_FAIL (exit %s) on VMSS %q: known transient e2e outbound flake, recreating node (attempt %d/%d)", exitCode, s.Runtime.VMSSName, attempt+1, maxOutboundCSERetries)
Comment thread e2e/test_helpers.go
Comment on lines +365 to +368
if s.VHD.SkipCustomScriptExtensionStatus {
err = getCustomScriptExtensionStatus(s, scenarioVM.VM)
require.NoError(s.T, err)
}
Comment on lines +64 to +66
else
python3 /opt/azure/containers/cloud_init_report_ready.py -v --failure --description "ExitCode: ${EXIT_CODE}, ${message_string}" || echo "WARNING: Failed to report failure to Azure fabric"
fi
Comment on lines +61 to +63
if [ -x /opt/azure/containers/cloud_init_report_ready.py ]; then
if [ "$EXIT_CODE" -eq 0 ]; then
python3 /opt/azure/containers/cloud_init_report_ready.py -v || echo "WARNING: Failed to report ready to Azure fabric"
Comment on lines +343 to +345
Skipped if the experimental_skip_ready_report marker exists, which
indicates cloud-init is handling the report itself.
"""
Comment on lines +377 to +378
Skipped if the experimental_skip_ready_report marker exists.
"""
@aks-node-assistant

Copy link
Copy Markdown
Contributor

AgentBaker Linux gate detective

Run: https://msazure.visualstudio.com/CloudNativeCompute/_build/results?buildId=172164489
Failed job/stage/task: build / representative Build VHD jobs, exit code 2.

Detective summary: Build VHD now gets past the previous SKU_NAME issue but fails during Packer provisioning. The representative failure is a cloud-init patch precondition: Expected condition not found exactly once in /usr/lib/python3/dist-packages/cloudinit/sources/DataSourceAzure.py, after trying to patch the experimental_skip_ready_report line. Downstream Test/Scan and artifact failures are consequences of no image being produced.

Likely cause / signature: $sig.

Confidence: High; PR author action recommended.

Recommended owner/action: PR author/VHD builder reviewers should make the DataSourceAzure patch cloud-init-version-aware or avoid patching distro-owned cloud-init internals; validate Ubuntu 20.04, 22.04, 24.04 and arm64 paths before rerun.

Strongest alternative: Base image cloud-init changed unexpectedly; less likely as an independent infra issue because the newly added patch assumes an exact source line and fails deterministically when it is absent or not unique.

Evidence: ADO timeline shows Build VHD failures across multiple lanes; representative Packer log shows the DataSourceAzure precondition failure and cleanup provisioner start.

Wiki signature: $sig

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.

2 participants