[Ubuntu] Cap Azure resource disk mount timeout to avoid boot delay - #14753
Open
v-davit-ioramashvili wants to merge 2 commits into
Open
v-davit-ioramashvili wants to merge 2 commits into
v-davit-ioramashvili wants to merge 2 commits into
Conversation
VMs booted from an ephemeral OS disk have no Azure resource disk, but the image still ships cloud-init's default /mnt mount for it. At boot, systemd waits ~90s for the missing device before giving up (nofail), delaying the transition to "running". Add a cloud-init drop-in that caps the wait with x-systemd.device-timeout=1s. It is set through cloud-init rather than editing /etc/fstab directly because cloud-init (cc_mounts) rewrites fstab on every boot and would drop a direct edit. When the resource disk is present it is detected early and mounts as before; the 1s cap only takes effect when the disk is absent.
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Tests should verify that cloud-init generates the /mnt fstab entry with the 1-second timeout.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a cloud-init override to cap missing Azure resource disk mount waits at one second.
Changes:
- Writes the resource disk timeout configuration.
- Adds tests for the configuration and timeout value.
File summaries
| File | Description |
|---|---|
images/ubuntu/scripts/build/configure-environment.sh |
Creates the cloud-init resource disk timeout configuration. |
images/ubuntu/scripts/tests/System.Tests.ps1 |
Tests the configuration file and timeout setting. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+20
to
+22
| It "caps the resource-disk mount wait so boot is not delayed when the disk is absent" { | ||
| $content = Get-Content $configFile -Raw | ||
| $content | Should -Match 'x-systemd\.device-timeout=1s' |
Inline the config path inside each It block. In Pester v5 a variable set in the Describe body is only available during discovery, not inside It at run time, so both assertions ran against a null path and failed on the image build. Matches the adjacent ReadAhead test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Improvement.
Ubuntu VMs booted from an ephemeral OS disk have no Azure resource disk, but the image still ships cloud-init's default
/mntmount for it. At boot, systemd waits ~90s for the missing device before giving up (nofail), delaying the transition to "running".Fix: a cloud-init drop-in (
/etc/cloud/cloud.cfg.d/99-azure-resource-disk-timeout.cfg, written byconfigure-environment.sh) caps the wait withx-systemd.device-timeout=1s. It is set through cloud-init rather than editing/etc/fstabdirectly, because cloud-init (cc_mounts) rewrites fstab on every boot and would drop a direct edit. When the resource disk is present it is detected early and mounts as before; the 1s cap only takes effect when the disk is absent.Validated on fork CI for ubuntu-22.04 / 24.04 / 26.04: systemd abandons a missing device at the configured timeout (~1s, vs ~5s with a 5s control), and cloud-init regenerates the
/mntline carryingdevice-timeout=1s. https://github.com/v-davit-ioramashvili/runner-images/actions/runs/35228383511Related issue:
github/hosted-runners-images#967
Check list