Conversation
On Photon OS 5.0 subrelease 92, cloud-init does not run at boot. The systemd
generator terminates with exit status 3, no datasource is identified, and the
six cloud-* units remain inactive although they are enabled. No unit enters a
failed state, so systemctl --failed reports no error.
Sep 09 21:20:46 (sd-exec-[614]: /usr/lib/systemd/system-generators/
cloud-init-generator failed with exit status 3.
Instance configuration normally applied by cloud-init - SSH key injection,
hostname assignment, user-data processing and network configuration - is
therefore not applied.
Two path mismatches are responsible, both introduced when the package moved to
a meson build.
1. systemd/cloud-init-generator.tmpl resolves ds-identify from a path selected
by build variant. photon is not a member of the list that selects
libexecdir, so the template renders the else branch:
{% if variant in ["almalinux", ..., "rhel", "rocky", ...] %}
dsidentify="/usr/libexec/cloud-init/ds-identify"
{% else %}
dsidentify="/usr/lib/cloud-init/ds-identify"
while %{meson_install} places the binary in /usr/libexec/cloud-init.
Rendering the template confirms the branch selection:
--variant photon -> /usr/lib/cloud-init/ds-identify
--variant rhel -> /usr/libexec/cloud-init/ds-identify
2. cloudinit/distros/photon.py does not override Distro.usr_lib_exec, which
defaults to /usr/lib in cloudinit/distros/__init__.py:132. rhel.py:30 sets
/usr/libexec. The attribute is read by cc_keys_to_console.py:36 and
distros/__init__.py:1406, so both resolve to /usr/lib/cloud-init while the
package installs write-ssh-key-fingerprints and hook-hotplug under
/usr/libexec/cloud-init.
Both patches align cloud-init's expectations with the location the package
already installs to. Photon OS is an RPM distribution whose meson build
installs helpers to libexecdir, consistent with the variants already listed.
Introduced by cd1c1ff (25.1.3-11 -> 26.2-1), which changed %py3_install to
%{meson_install} and relocated the payload from %{_libdir}/%{name} to
%{_libexecdir}/%{name}. The %files section was updated accordingly; the
generator template and photon.py were not. 25.1.3-11 was internally
consistent: it installed ds-identify under /usr/lib/cloud-init and the
generator resolved the same path.
The currently published 26.2-2 is affected. Its changelog entry covers the
python3-configobj dependency and modifies neither path.
Affected releases: Photon OS 5.0 subrelease 92 only. cloud-init.spec carries
%global build_if %{photon_subrelease} >= 92, and SPECS/91 (25.1.3-11.1),
SPECS/90 (25.1.3-4.1.1), 4.0 (25.1.3-3) and dev (24.4-1) remain on releases
that install helpers under %{_libdir}, where the generator's expected path is
correct. This change raises the mainline package to 26.2-3.
Runtime evidence from four guest installations produced by the same automated
harness, differing only in the cloud-init version on the installation media:
25.1.3-11 reports "done" on both, 26.2-1 and 26.2-2 report "not started" on
both.
Change-Id: Icd2715fd307cd045865a081e1ef20298d878b3a7
Signed-off-by: Daniel Casota <dcasota@gmail.com>
Contributor
Author
|
Hi @prashant1221 , could you please review the PR? Thank you in advance for a short comment. Best wishes, Daniel |
dcasota
pushed a commit
to dcasota/photonos-scripts
that referenced
this pull request
Sep 11, 2026
`fix/cloud-init-generator-libexecdir` (dcasota/photon#32, vmware/photon#1676) is now part of the branch set both installer variants are built from, so every ISO the matrix builds carries cloud-init 26.2-3 rather than 26.2-2. Without it the generator resolves ds-identify under /usr/lib while the meson install puts it in /usr/libexec, exits 3, and every 26.2 guest reports "status: not started" where a 25.1.3 guest reports "done". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Summary
On Photon OS 5.0 subrelease 92,
cloud-initdoes not run at boot. The systemd generator terminates with exit status 3, no datasource is identified, and the sixcloud-*units remain inactive although they are enabled. No systemd unit enters a failed state, sosystemctl --failedreports no error.The consequence is that instance configuration normally applied by cloud-init — SSH key injection, hostname assignment, user-data processing and network configuration — is not applied.
Affected releases
SPECS/)26.2-1,26.2-2SPECS/91/)25.1.3-11.1SPECS/90/)25.1.3-4.1.125.1.3-324.4-1cloud-init.speccarries%global build_if %{photon_subrelease} >= 92, so the package is built for subrelease 92 only. The other trees remain on cloud-init 25.1.3 or earlier, which installs its helper binaries under%{_libdir}, where the generator's expected path is correct.This change raises the mainline package to
26.2-3.Observed behaviour
Root cause
Two independent path mismatches, both introduced when the package moved to a meson build.
1. The systemd generator
The generator resolves
ds-identifyfrom a path selected by build variant insystemd/cloud-init-generator.tmpl:photonis not a member of the first list, so the template renders theelsebranch. The meson install places the binary inlibexecdir:Rendering the template directly confirms the branch selection:
meson.buildrenders the generator without an explicit--variant, sotools/render-templateuses its default ofutil.system_info()["variant"], which isphotonon a Photon build host.Reading
systemd/cloud-init-generator.tmpl, an absent$dsidentifyyields exit status 127, which matches none of the handled values 0, 1 or 2. Control reaches the fallback branch, which setsret=3. Nomulti-user.target.wantssymlink is created and neither the enabled nor the disabled marker is written under/run.2.
Distro.usr_lib_execcloudinit/distros/__init__.py:132definesusr_lib_exec = "/usr/lib"as the default.cloudinit/distros/rhel.py:30overrides it with/usr/libexec;cloudinit/distros/photon.pydoes not, so Photon inherits the default.The attribute is consumed by
cloudinit/config/cc_keys_to_console.py:36andcloudinit/distros/__init__.py:1406. Both therefore resolve to/usr/lib/cloud-init, while the package installs:This is the same mismatch as above, expressed in Python rather than in a rendered shell script.
Origin
Commit
cd1c1fff9, "92: cloud-init, open-vm-tools: version upgrades", upgraded the package from25.1.3-11to26.2-1and changed the install method:meson installs helper binaries to
libexecdir. The%filessection was updated accordingly; the generator template andphoton.pywere not.The preceding package was internally consistent:
ds-identifyat25.1.3-11/usr/lib/cloud-init//usr/lib/cloud-init/26.2-1/usr/libexec/cloud-init//usr/lib/cloud-init/26.2-2/usr/libexec/cloud-init//usr/lib/cloud-init/26.2-2does not address this. Its changelog entry covers thepython3-configobjdependency, and no commit underSPECS/cloud-init/has modified either path (git log -Sreturns no results forlibexec/cloud-initorlib/cloud-init/ds-identify). Both RPMs were extracted and compared: the generator is identical in each, including line 18.Changes
0011-generator-photon-uses-libexecdir.patchaddsphotonto the variant list that resolvesds-identifyunderlibexecdir.0012-photon-usr-lib-exec-is-libexecdir.patchsetsusr_lib_exec = "/usr/libexec"incloudinit/distros/photon.py, matchingrhel.py.Both align cloud-init's expectations with the location the package already installs to, rather than relocating the payload. Photon OS is an RPM distribution whose meson build installs helpers to
libexecdir, consistent with the variants already present in that list.Verification
Template rendering after the change is limited to the
photonvariant:Both patches apply to the released 26.2 source archive at
--fuzz=0.support/spec-checker/check_spec.pyexits 0.cloud-init-26.2-3.ph5.noarch.rpmwas built from this branch and extracted:Runtime evidence
Four guest installations, produced by the same automated harness and differing only in the cloud-init version present on the installation media:
cloud-init status25.1.3-11done25.1.3-11done26.2-2not started26.2-1not startedBoth guests running 25.1.3 complete successfully; both guests running 26.2 do not.
c01carries26.2-2, confirming that the currently published build is affected.Guest installation with 26.2-3
A minimal installation ISO carrying
cloud-init-26.2-3.ph5was built from this branch and installed. The automated row reports 37 checks, 18 pass, 0 fail.26.2-1/26.2-226.2-3statusnot starteddoneboot_status_codeunknownenabled-by-generatordetailSystemd generator may not have run yet.DataSourceNoneboot_status_code: enabled-by-generatoris written only when the generator runs to completion and creates the enable marker under/run. The journal confirms all four stages ran:detail: DataSourceNoneis expected on this guest and is not a regression. No cloud-init datasource is provisioned on it: the installer's kickstart is delivered through a separate guestinfo key, not through cloud-init'sguestinfo.metadata/guestinfo.userdata, sods-identifycorrectly identifies no datasource and theNoneentry configured indatasource_listby0004-Add-default-DS-list-few-other-changes-to-cloud.cfg.patchis used.extended_status: degraded donereflects the single recoverable warning that accompanies it,Used fallback datasource.Upstream
The same two changes are applicable to cloud-init upstream.
canonical/cloud-initPR canonical/cloud-init#6874 (merged 2026-06-09) made the equivalent addition for Azure Linux. Issue canonical/cloud-init#6329 records the same generator failure for openEuler, where the maintainer's stated preference is that packaging retain/usr/libexecand the variant list be extended. Issue canonical/cloud-init#6588 describes theusr_lib_execclass of mismatch.Photon OS support was added upstream in PR canonical/cloud-init#909 (2021), which did not include the generator template, although five RPM distributions merged in the same period did.
Not covered by this change
meson.buildrenders templates using the build host's variant, becausetools/render-templateis invoked without--variantand falls back toutil.system_info()["variant"]. A build performed on a non-Photon host would therefore omit the Photon branches. This does not affect builds on Photon and is not addressed here.Unrelated observation
cloud-init statusreportslast_update: Thu, 01 Jan 1970 00:00:10 +0000on the verified guest.cloudinit/cmd/status.py:486formatsdatetime.fromtimestamp(latest_event), whereget_latest_event()takes the maximum stagestart/finishedvalue recorded in/run/cloud-init/status.json. Those values correspond to uptime rather than wall-clock time — the journal shows the same run finishing atThu, 10 Sep 2026 18:06:44 +0000afterUp 10.65 seconds, and00:00:10matches the uptime. The system clock was correct throughout.This is present independently of this change and is not addressed by it. Recorded here because it makes the timestamp in
cloud-init statusunreliable for diagnosis.