Open antoonhuiskens opened 1 year ago
Below snippet is my from my packer workaround:
provisioner "file" {
destination = "/etc/apt/sources.list.d/bullseye-backports.list"
content = <<-EOF
deb http://deb.debian.org/debian bullseye-backports main
EOF
only = ["lxd.debian-bullseye-cloud"]
}
provisioner "shell" {
inline = [
"dhclient",
"apt update && apt install -y -t bullseye-backports cloud-init",
"systemctl enable systemd-networkd.service",
"shutdown -r now"
]
only = ["lxd.debian-bullseye-cloud"]
pause_after = "5s"
Is this still happening? We have automated daily tests of our images and they've not flagged this image as having an issue.
This may be caused by the debian/11/cloud
image having an incorrect sources.list; unless one installs cloud-init from bullseye-backports, the file /etc/cloud/templates/sources.list.debian.tmpl
will not have logic to handle the /updates
-> -updates
change.
root@d11-cloud:~# grep updates /etc/apt/sources.list
## Major bug fix updates produced after the final release of the
deb http://security.debian.org/ bullseye/updates main
deb-src http://security.debian.org/ bullseye/updates main
deb http://deb.debian.org/debian bullseye-updates main
deb-src http://deb.debian.org/debian bullseye-updates main
root@d11-cloud:~# apt update
Hit:1 http://deb.debian.org/debian bullseye InRelease
Ign:2 http://security.debian.org bullseye/updates InRelease
Hit:3 http://deb.debian.org/debian bullseye-updates InRelease
Err:4 http://security.debian.org bullseye/updates Release
404 Not Found [IP: 199.232.30.132 80]
Hit:5 http://deb.debian.org/debian bullseye-backports InRelease
Reading package lists... Done
E: The repository 'http://security.debian.org bullseye/updates Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Hi, I tend to run images with lxd on non-lxd managed networks (unmanaged networks in lxd speak).
With Debian/11/cloud (bullseye/cloud) I run into the situation that networking doesn't come up, which seems to be related to the fact that cloud-init doesn't run, when compared to e.g. debian/12/cloud (bookworm/cloud).
Here's my environment:
Note that at this stage I'm not passing in any cloud-init yet. (that happens in images that derive from this).
Now when I launch "vanilla" cloud images from both, I observe (in addition to networking being down) that cloud-init is disabled on bullseye but not on bookworm:
This behaviour is triggered by the systemd generator for cloud-init:
whereas the debian/12/cloud image reports this:
Similarly:
In short: I think my woes are due to the fact that cloud-init is disabled due to a failing cloud-init datasource identification in bullseye, that works in bookworm.
Upon further investigation:
And really, there's no lxd datasource capability defined:
My current take is that this lack of lxd capability is due to the cloud-init version:
When I install cloud-init from bullseye-backports and reboot (in order to trigger the systemd generator for cloud-init), it all starts to work as expected and consistent with bookworm:
Summed up, I'd like to make the case for setting up debian/11/cloud with cloud-init 22.2 from bullseye-backports since that version includes support for LXD environments (i.e. cloud-init is broken for bullseye) and will have consistent cloud-init behaviour across os families.
To the very least I hope the above documents the work around well enough, though implementing the workaround requires a reboot of the container in my packer build pipeline which is a bit of a burden.