You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bootstrap: INSTANCE_ID is empty on Ubuntu (no ec2-metadata), so every tag read and the --command once-marker use an empty ID #1490
The Linux bootstrap gets the instance ID only with ec2-metadata (pkg/launcher/bootstrap.go, INSTANCE_ID=$(ec2-metadata --instance-id | cut -d " " -f 2)). That command comes from amazon-ec2-utils, which Ubuntu does not ship. On an Ubuntu --ami the line therefore fails, cut still exits 0, the bootstrap continues, and INSTANCE_ID is empty for the rest of the script.
Evidence
Code:INSTANCE_ID is used 22 times in pkg/launcher/bootstrap.go. Most are aws ec2 describe-tags --filters "Name=resource-id,Values=$INSTANCE_ID" ... with || echo <default> fallbacks: the session timeout, the job array ID/name/size/index (/etc/profile.d/job-array.sh), the sweep ID/params, spawn:command/spawn:step and the MOTD's TTL/idle/on-complete. One is the --command once-per-instance marker, /var/lib/spawn/command-ran-$INSTANCE_ID, which becomes /var/lib/spawn/command-ran- on Ubuntu.
Package manifests: Canonical's server cloud-image manifests for 22.04 (ubuntu-22.04-server-cloudimg-arm64.manifest) and 24.04 (ubuntu-24.04-server-cloudimg-arm64.manifest) list no amazon-ec2-utils or ec2-utils. They do list curl, cloud-guest-utils and coreutils.
This is not fully assessed. Each tag read falls back to its default instead of the instance's tag. Whether that matters on Ubuntu also depends on whether the aws CLI is present there; it is part of #54's audit.
The MPI user data had the same dependency. Its key owner file was written empty, so pkg/mpicohort (#1338) would never release rank 0's key. #1487's PR reads the ID from IMDSv2 with curl in the MPI fragment only. It leaves the published bootstrap body unchanged.
Suggested fix
In the bootstrap, read the ID with IMDSv2 via curl, which is already used there for the region and token. Either replace ec2-metadata or fall back to curl when it is missing. This changes the published bootstrap body.
Confirmed live on Ubuntu 24.04 and 22.04, and the cause is wider than ec2-metadata
Ran on 2026-11-02 in us-east-1 with c7g.medium arm64, using a CLI built from a local merge of #1489 and #1492 (merge 96a9303a, which reports spawn version 0.154.1-0.20261102045149-96a9303abb35) and --mpi --ttl 1h --on-complete terminate --no-dns.
24.04 ami-09a93d801db0bafae (24.04.5): cluster l1489-u24, instances i-0d5b673b692a3f8f2 and i-0f4ce67ae6be3bf89
22.04 ami-09c99d62ef07e4dd9 (22.04.5): cluster l1489-u22, instances i-0df5efe1a26260ca7 and i-031c66e67d2b54dbd
Each check below gave the same result on all four members.
1. ec2-metadata is absent, so INSTANCE_ID is empty.
$ command -v ec2-metadata -> (nothing)
cloud-init-output.log:96: /var/lib/cloud/instance/scripts/part-001: line 264: ec2-metadata: command not found
part-001:264: INSTANCE_ID=$(ec2-metadata --instance-id | cut -d " " -f 2)
2. There is also no aws CLI on either image.
$ command -v aws -> (nothing)
$ aws --version -> aws: not found
So no describe-tags call in the bootstrap ever runs. It isn't just running with an empty Values=: every call fails on the missing binary, 2>/dev/null hides that, and the || echo <default> fallback takes over. So the fix suggested above (IMDSv2 via curl for INSTANCE_ID) is necessary but not sufficient: on stock Ubuntu, tag reads stay broken until the bootstrap has an aws CLI, or reads tags some other way (IMDS instance tags, or spored). That makes this #54's AWS CLI question too.
3. What visibly breaks:
Hostname from --name is not applied. The Name tag read (part-001 around line 337, the SPAWN_HOSTNAME block) gets nothing back. Ubuntu members keep ip-172-31-42-136 etc. AL2/AL2023 members in the same runs got l1489-al2a-0 etc. It also shows in the MPI output: Ubuntu ranks print ip-… from hostname.
/etc/profile.d/job-array.sh is not written, so JOB_ARRAY_* is missing from login shells (ls: cannot access '/etc/profile.d/job-array.sh').
The MOTD is wrong. It shows Instance: (empty) and TTL: disabled, Idle Timeout: disabled, On Complete: disabled. The real values were spawn:ttl=1h and spawn:on-complete=terminate.
The session timeout was the default 30m, which happens to match the tag here.
Not exercised: the --command once-marker (/var/lib/spawn/command-ran-), because these were --mpi-command runs. Also not exercised: sweep params and spawn:command/spawn:step. They go through the same failing path.
4. What still works:
spored reads its config itself. spored status showed TTL: 58m 15s remaining and On complete: terminate, and every member self-terminated on completion.
Both cohorts recorded {"status": "completed", "exit_code": 0, "source": "mpi"} on every member.
So the impact is cosmetic and environment-level rather than lifecycle-level, because spored covers TTL and on-complete. But the hostname feature and the job-array env are silently missing on Ubuntu.
Activity
scttfrdmn commentedon Nov 2, 2026
Confirmed live on Ubuntu 24.04 and 22.04, and the cause is wider than
ec2-metadataRan on 2026-11-02 in us-east-1 with c7g.medium arm64, using a CLI built from a local merge of #1489 and #1492 (merge
96a9303a, which reportsspawn version0.154.1-0.20261102045149-96a9303abb35) and--mpi --ttl 1h --on-complete terminate --no-dns.ami-09a93d801db0bafae(24.04.5): clusterl1489-u24, instances i-0d5b673b692a3f8f2 and i-0f4ce67ae6be3bf89ami-09c99d62ef07e4dd9(22.04.5): clusterl1489-u22, instances i-0df5efe1a26260ca7 and i-031c66e67d2b54dbdEach check below gave the same result on all four members.
1.
ec2-metadatais absent, soINSTANCE_IDis empty.2. There is also no
awsCLI on either image.So no
describe-tagscall in the bootstrap ever runs. It isn't just running with an emptyValues=: every call fails on the missing binary,2>/dev/nullhides that, and the|| echo <default>fallback takes over. So the fix suggested above (IMDSv2 viacurlforINSTANCE_ID) is necessary but not sufficient: on stock Ubuntu, tag reads stay broken until the bootstrap has anawsCLI, or reads tags some other way (IMDS instance tags, or spored). That makes this #54's AWS CLI question too.3. What visibly breaks:
--nameis not applied. TheNametag read (part-001 around line 337, theSPAWN_HOSTNAMEblock) gets nothing back. Ubuntu members keepip-172-31-42-136etc. AL2/AL2023 members in the same runs gotl1489-al2a-0etc. It also shows in the MPI output: Ubuntu ranks printip-…fromhostname./etc/profile.d/job-array.shis not written, soJOB_ARRAY_*is missing from login shells (ls: cannot access '/etc/profile.d/job-array.sh').Instance:(empty) andTTL: disabled,Idle Timeout: disabled,On Complete: disabled. The real values werespawn:ttl=1handspawn:on-complete=terminate.30m, which happens to match the tag here.--commandonce-marker (/var/lib/spawn/command-ran-), because these were--mpi-commandruns. Also not exercised: sweep params andspawn:command/spawn:step. They go through the same failing path.4. What still works:
spored statusshowedTTL: 58m 15s remainingandOn complete: terminate, and every member self-terminated on completion./root/.ssh/spawn-mpi-key-owneron rank 0 heldi-0d5b673b692a3f8f2(24.04) andi-0df5efe1a26260ca7(22.04).{"status": "completed", "exit_code": 0, "source": "mpi"}on every member.So the impact is cosmetic and environment-level rather than lifecycle-level, because spored covers TTL and on-complete. But the hostname feature and the job-array env are silently missing on Ubuntu.
test(bootstrap): tool inventory and fail-closed gates for #1490
test(bootstrap): run the bootstrap in ubuntu:24.04 and amazonlinux:2 …
test(bootstrap): spawn_need_aws must be defined before the staged fet…
fix(bootstrap): instance ID from IMDSv2, install the AWS CLI when abs…
test(bootstrap): tool inventory and fail-closed gates for #1490
test(bootstrap): run the bootstrap in ubuntu:24.04 and amazonlinux:2 …
test(bootstrap): spawn_need_aws must be defined before the staged fet…
docs(changelog): full body sha (#1490)
fix(bootstrap): instance ID from IMDSv2, install the AWS CLI when abs…
test(bootstrap): tool inventory and fail-closed gates for #1490
test(bootstrap): run the bootstrap in ubuntu:24.04 and amazonlinux:2 …
test(bootstrap): spawn_need_aws must be defined before the staged fet…
docs(changelog): full body sha (#1490)
fix(bootstrap): instance ID from IMDSv2, install the AWS CLI when abs…