Cloud-init inconsistently uses config
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
On boot, cloud-init is able to pass cloud-config via userdata_raw, a useful feature when testing behavior on a datasource that doesn't have its own way of retrieving userdata.
system_info:
datasource:
None:
This works during boot as one might expect:
2023-03-03 21:15:59,255 - modules.py[DEBUG]: Running module grub-dpkg (<module 'cloudinit.
usr/lib/
2023-03-03 21:15:59,256 - handlers.py[DEBUG]: start: modules-
However, cloud-init's single subcommand clearly uses a different configuration, since the following fails to run the same module with the same config:
```
cloud-init --debug --force single --frequency always --name cc_grub_dpkg
```
Furthermore, this userdata_raw isn't included in /run/cloud-
Alarmingly, an invalid config provided via userdata_raw is not warned of by cloud-init schema --system:
```
system_info:
# This will affect which distro class gets used
datasource:
NoCloud:
grub_dpkg:
enabled: true
```
output:
```
# cloud-init schema --system
Found cloud-config data types: user-data, vendor-data
1. user-data at /var/lib/
Valid cloud-config: user-data
2. vendor-data at /var/lib/
Valid cloud-config: vendor-data
```
These details reveal inconsistency in cloud-init config handling, and all contribute to a confusing user experience when using userdata_raw.
There may be other inconsistencies too - configs passed directly on the kernel commandline (cc: <config> end_cc), and configs sourced from a url via the kernel commandline (cloud-config-url=) are both used during boot - but I haven't looked to see whether they behave correctly with (schema|
Changed in cloud-init: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Tracked in Github Issues as https:/ /github. com/canonical/ cloud-init/ issues/ 4086