LXD: ubuntu-minimal images 18.04 and 20.04 ignore cloud config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-images |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
when creating containers with ubuntu-minimal repository, the 18.04 and 20.04 versions of the container completely ignores cloud_init directives supplied with the profile during the container creation and operation.
When I create a container from the ubuntu-minimal image store the cloud-init components are completely ignored by 18.04, 20.04 and 22.04 images. I have my cloud_init in a separate profile and I init the containers as follows:
lxd init ubuntu-
lxd init ubuntu-
lxd init ubuntu-
The cloud_init profile has the following directives:
config:
cloud-
#cloud-config
locale: C.UTF-8
timezone: Europe/Moscow
runcmd:
- [apt-get, -y, update]
- [apt-get, -y, upgrade]
- [apt, -y, autoremove]
- [touch, /tmp/simos_
users:
- name: alex
- name: ansctl
write_files:
- content: |
path: /etc/sudoers.
description: General settings for instances
devices: {}
name: cloud_init
The config works for 22.04 minimal and for all of the full-sized images from the "ubuntu" repository
This doesn't seem specific to minimal images, just related to old ubuntu versions.
cloud-init. user-data is a relatively recent config key. The version of LXD shipped with 18.04 (v3) didn't have it. Images of that release also don't have that config in their nocloud template.
However, older images support the "user.user-data", which still works with newer images (and will work as long as lxd supports it). So it's not a regression.
The question becomes if we should consider starting to add forward-compatible lxd config keys to old lxd images nocloud metadata templates. I anticipate regressions. And that's more of a feature request than a bug. Triaging as wishlist.
TLDR workaround, use "user.user-data"