Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: skip cloud-init ready report and add standalone report_ready sc…
…ript

   Bake experimental_skip_ready_report into VHD via cloud.cfg.d to skip
   cloud-init's built-in health ready report to Azure fabric. Add a
   standalone Python script (report_ready.py) that can be invoked from
   CSE to report ready at the appropriate time during node provisioning.

   Depends on canonical/cloud-init#6771.

   Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
  • Loading branch information
awesomenix committed Mar 11, 2026
commit 5d3d2c2dc6f4018eaee63983f70aaf8b887c37e8
10 changes: 10 additions & 0 deletions parts/linux/cloud-init/artifacts/cse_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -851,4 +851,14 @@ datasource:
EOF
}

skipCloudInitReadyReport() {
local config_filepath="/etc/cloud/cloud.cfg.d/81_azure_skip_ready_report.cfg"
mkdir -p "$(dirname "${config_filepath}")"
cat <<EOF >"${config_filepath}"
datasource:
Azure:
experimental_skip_ready_report: true
EOF
}

#EOF
9 changes: 9 additions & 0 deletions parts/linux/cloud-init/artifacts/cse_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,15 @@ EVENT_JSON=$( jq -n \
)
echo ${EVENT_JSON} > ${EVENTS_LOGGING_DIR}${EVENTS_FILE_NAME}.json


if [ -x /opt/azure/containers/report_ready.py ]; then
if [ "$EXIT_CODE" -eq 0 ]; then
python3 /opt/azure/containers/report_ready.py -v || echo "WARNING: Failed to report ready to Azure fabric"
else
python3 /opt/azure/containers/report_ready.py -v --failure --description "ExitCode: ${EXIT_CODE}, ${message_string}" || echo "WARNING: Failed to report failure to Azure fabric"
fi
Comment on lines +101 to +106
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This report_ready.py invocation runs synchronously before log upload/exit, and can block provisioning for up to ~100s on wireserver timeouts/retries (GET/POST timeouts are 30s with multiple retries). If this is intended to be best-effort (as suggested by || echo "WARNING"), consider running it in the background on success and/or moving it after upload_logs (especially on failure) or passing tighter retry/timeout settings to avoid delaying provisioning and log upload.

Copilot uses AI. Check for mistakes.
Comment on lines +101 to +106
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This change updates cloud-init/CSE scripts under parts/, which are covered by snapshot-style golden tests in pkg/agent/testdata/* (e.g., baker_test.go reads ./testdata/<folder>/CustomData). Please run make generate (or regenerate the testdata via the repo’s standard workflow) and include the updated golden files in this PR; otherwise CI is likely to fail due to mismatched expected CustomData/CSE outputs.

Copilot uses AI. Check for mistakes.
fi

# force a log upload to the host after the provisioning script finishes
# if we failed, wait for the upload to complete so that we don't remove
# the VM before it finishes. if we succeeded, upload in the background
Expand Down
Loading