ds-identify cannot detect seed defined in cfg file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
High
|
Unassigned |
Bug Description
Cloud-init version 20.1-10-
I added a file called 98_nocloud.cfg that looks like this:
----------
#cloud-config
datasource_list: [ NoCloud, None ]
datasource:
NoCloud:
user-data: |
#cloud-config
users:
- name: ubuntu
- <MY_SSH_KEY>
homedir: /home/ubuntu
sudo: ALL=(ALL) NOPASSWD:ALL
shell: /bin/bash
meta-data: |
instance_id: cloud-image
----------
== Reproducing ==
1. create a usb stick, or kvm image for core20
2. place the above file in the ubuntu-seed partition under /data/etc/
=================
When I boot, the datasource is not used and cloud-init does not process it *unless* I also include this line at the top:
datasource_list: [ NoCloud, None ]
This was surprising though, because another existing file in /etc/cloud/
# to update this file, run dpkg-reconfigure cloud-init
datasource_list: [ NoCloud, ConfigDrive, OpenNebula, DigitalOcean, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Bigstep, Scaleway, AliYun, Ec2, CloudStack, Hetzner, IBMCloud, Oracle, Exoscale, RbxCloud, None ]
Here are the contents of /run/cloud-
[up 4.57s] ds-identify
policy loaded: mode=search report=false found=first maybe=none notfound=disabled
/etc/cloud/
DMI_PRODUCT_
DMI_SYS_VENDOR=QEMU
DMI_PRODUCT_SERIAL=
DMI_PRODUCT_
PID_1_PRODUCT_
DMI_CHASSIS_
FS_LABELS=
ISO9660_DEVS=
KERNEL_
VIRT=kvm
UNAME_KERNEL_
UNAME_KERNEL_
UNAME_KERNEL_
UNAME_MACHINE=
UNAME_NODENAME=
UNAME_OPERATING
DSNAME=
DSLIST=NoCloud ConfigDrive OpenNebula DigitalOcean Azure AltCloud OVF MAAS GCE OpenStack CloudSigma SmartOS Bigstep Scaleway AliYun Ec2 CloudStack Hetzner IBMCloud Oracle Exoscale RbxCloud None
MODE=search
ON_FOUND=first
ON_MAYBE=none
ON_NOTFOUND=
pid=607 ppid=591
is_container=false
is_ds_enabled(
is_ds_enabled(
ec2 platform is 'Unknown'.
No ds found [mode=search, notfound=disabled]. Disabled cloud-init [1]
[up 4.76s] returning 1
Changed in cloud-init: | |
status: | Triaged → Fix Committed |
Thanks for filing this.
I believe we can use check_config in ds-identify to see if datasource: NoCloud is present, just like we do for MAAS.
Optionally, we can decide if we should generally check for the dsname value in config as well.