-
Notifications
You must be signed in to change notification settings - Fork 933
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: ubuntu-minimal VM images do not support cloud-init as claimed #14605
Comments
Which image os version did you use? |
@holmanb @blackboxsw this does appear to be a problem with the I've confirmed the issue doesn't affect ubuntu-minimal:22.04 and ubuntu:24.04 VM images. Any ideas what could be going on here? Is cloud-init broken in the 24.04 minimal image somehow? |
I was able to reproduce the issue with the example failing image. Using a modified version of cloud-init's python detection code: def is_platform_viable() -> bool:
"""Return True when this platform appears to have an LXD socket."""
if not os.path.exists(LXD_SOCKET_PATH):
LOG.warning(f"{LXD_SOCKET_PATH} does not exist")
return False
if not stat.S_ISSOCK(os.lstat(LXD_SOCKET_PATH).st_mode):
LOG.warning(f"{LXD_SOCKET_PATH} is not a socket: {os.lstat(LXD_SOCKET_PATH).st_mode}")
return False
return True I see the issue logged:
It looks like the lxd socket doesn't exist when cloud-init's Python code is running. ds-identify correctly identifies LXD as the datasource as a systemd-generator, but the later python code doesn't see it there. In the lxd agent logs I notice that pam is logging an error:
I'm not sure if that is related. Does the lxd agent modify or remove the socket after generators run? Possibly this fails due to a missing dependency which causes the above error? |
It doesnt explain why it works in ubuntu:24.04 though, they should be the same from lxds perspective. |
Maybe @simondeziel might know a difference in ubuntu 24.04 minimal |
@tomponline I also noticed that the agent doesn't even appear to run on non-minimal images:
vs a minimal vm:
|
@simondeziel as youre familiar with the lxd-agent package please can you take a look at this, looks like its units are not firing right (although i can get in fine) and potentially starting too late for lxd. |
Here with LXD
That's using the current default image (Noble,
Now trying with the exact image you tried (
@rptb1 I added a |
Here is an exact paste of me reproducing the issue just now. If there is anything more I can do locally to help debug this please let me know.
|
@rptb1 I still cannot reproduce despite using the same base OS, 22.04 with the same kernel and same LXD rev:
|
ubuntu-minimal VM images do not support cloud-init.
I do not know whether this is a documentation issue, or a bug with the image builds.
If they're meant to support cloud-init, then it's a bug in the image builds, in which case please forward this or direct me to where I can report that. Otherwise the documentation is wrong.
Reproduction:
lxc launch ubuntu-minimal: test-container --profile default --profile test-profile
. Wait a bit. Trylxc exec test-container -- ls /run
and note that "cloud.init.ran" exists. It works in containers.lxc launch --vm ubuntu-minimal: test-container2 --profile default --profile test-profile
. Wait a bit. Trylxc exec test-container2 -- ls /run
and note that "cloud.init.ran" does not exist. It doesn't work in minimal VM.lxc launch --vm ubuntu: test-container3 --profile default --profile test-profile
. Wait a bit. Trylxc exec test-container3 -- ls /run
and note that "cloud.init.ran" exists. It does work in non-minimal VM.An example non-working image is 526b11bb926ebe8a1d05e5f69b02d4a311b311a9a9acfe760f210ef8d45c2bc6 .
Document: reference/remote_image_servers.md
The text was updated successfully, but these errors were encountered: