ds-identify: fails to recognize NoCloud datasource on boot cause it does not have /sbin in $PATH and thus does not find blkid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Low
|
Unassigned | ||
cloud-init (openSUSE) |
Fix Released
|
Medium
|
Bug Description
cloud-init 18.2 from http://
On SLES 12 SP3 NoCloud data source was not working, despite
slestemplate:~ # blkid -c /dev/null -o export
[…]
DEVNAME=/dev/sr0
UUID=2018-
LABEL=cidata
TYPE=iso9660
[…]
with necessary files on it. blkid gives 0 as returncode
Why?
I only kept parts of the output:
slestemplate:
[up 8.63s] ds-identify
policy loaded: mode=search report=false found=all maybe=all notfound=disabled
no datasource_list found, using default: MAAS ConfigDrive NoCloud AltCloud Azure Bigstep CloudSigma CloudStack DigitalOcean AliYun Ec2 GCE OpenNebula OpenStack OVF SmartOS Scaleway Hetzner IBMCloud
ERROR: failed running [127]: blkid -c /dev/null -o export
[…]
FS_LABELS=
ISO9660_
It might have been that I did not yet add the CloudInit drive in Proxmox yet.
A subsequent call to
slestemplate:~ # /usr/lib/
did not yet yield a different result.
Only by analysing the source I found that it caches results and I can use the `--force` option to override this. I did this and the NoCloud datasource got detected properly. Apparently this is cached now.
The tool would only inform of the caching as a DEBUG message. However I set logging to INFO for all parts of Cloud Init as the FileHandler clutters the log with tons of messages how many bytes it read from each file. Sure, I could use INFO only for FileHandler.
Several issues reduce the ease of administration here:
1. Don´t cache errors. Really… just… don´t.
2. Don´t cache errors almost *silently* (just as a debug message).
3. Decide wisely what is a debug message and what is not.
4. A search for `ds-identify` in the documentation available at https:/
5. And in general: Keep it short and simple.
IMHO the first is the most important: Don´t cache errors. If the resource now is there, recognize it, without further discussion.
Related bugs:
* bug 1791691: [systemd] PATH broken in systemd units
Related branches
- Ryan Harper: Approve
- Server Team CI bot: Approve (continuous-integration)
- Robert Schweikert (community): Approve
-
Diff: 70 lines (+33/-1)2 files modifiedtests/unittests/test_ds_identify.py (+22/-1)
tools/ds-identify (+11/-0)
Changed in cloud-init (openSUSE): | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in cloud-init (openSUSE): | |
status: | Confirmed → Fix Released |
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → Low |
Changed in cloud-init (openSUSE): | |
status: | Fix Released → Confirmed |
Changed in cloud-init (openSUSE): | |
status: | Confirmed → Fix Released |
description: | updated |
I now cloned a VM from the Cloud Init image that I "fixed" by running ds-identify --force, but I am running into the same thing again:
Cloud Init is disabled again, since ds-identify fails to run blkid command:
slestemplate:~ # cat /run/cloud- init/ds- identify. log NAME=Standard PC (i440FX + PIIX, 1996) UUID=0CE53BB3- A48E-44F7- 9EC7-3C339E9C80 D3 NAME=unavailabl e ASSET_TAG= unavailable: error DEVS=unavailabl e:error CMDLINE= BOOT_IMAGE= /boot/vmlinuz- 4.4.73- 5-default root=/dev/ mapper/ sys0-rootfs splash=silent quiet showopts console=tty0 console= ttyS0,115200 NAME=Linux RELEASE= 4.4.73- 5-default VERSION= #1 SMP Tue Jul 4 15:33:39 UTC 2017 (b7ce4e4) x86_64 slestemplate _SYSTEM= GNU/Linux disabled
[… Hostname should have been changed to sles1 by Cloud Init …]
[up 11.01s] ds-identify
policy loaded: mode=search report=false found=all maybe=all notfound=disabled
no datasource_list found, using default: MAAS ConfigDrive NoCloud AltCloud Azure Bigstep CloudSigma CloudStack DigitalOcean AliYun Ec2 GCE OpenNebula OpenStack OVF SmartOS Scaleway Hetzner IBMCloud
ERROR: failed running [127]: blkid -c /dev/null -o export
DMI_PRODUCT_
DMI_SYS_VENDOR=QEMU
DMI_PRODUCT_SERIAL=
DMI_PRODUCT_
PID_1_PRODUCT_
DMI_CHASSIS_
FS_LABELS=
ISO9660_
KERNEL_
VIRT=kvm
UNAME_KERNEL_
UNAME_KERNEL_
UNAME_KERNEL_
UNAME_MACHINE=
UNAME_NODENAME=
UNAME_OPERATING
DSNAME=
DSLIST=MAAS ConfigDrive NoCloud AltCloud Azure Bigstep CloudSigma CloudStack DigitalOcean AliYun Ec2 GCE OpenNebula OpenStack OVF SmartOS Scaleway Hetzner IBMCloud
MODE=search
ON_FOUND=all
ON_MAYBE=all
ON_NOTFOUND=
pid=1138 ppid=1133
is_container=false
ec2 platform is 'Unknown'.
No ds found [mode=search, notfound=disabled]. Disabled cloud-init [1]
[up 11.05s] returning 1
Which leads to: init/cloud- init-generator. log systemd/ system- generators/ cloud-init- generator normal= /run/systemd/ generator early=/ run/systemd/ generator. early late=/run/ systemd/ generator. late /boot/vmlinuz- 4.4.73- 5-default root=/dev/ mapper/ sys0-rootfs splash=silent quiet showopts console=tty0 console= ttyS0,115200 generator. early/multi- user.target. wants/cloud- init.target
slestemplate:~ # cat /run/cloud-
/usr/lib/
kernel command line (/proc/cmdline): BOOT_IMAGE=
kernel_cmdline found unset
etc_file found unset
default found enabled
checking for datasource
ds-identify rc=1
ds-identify _RET=notfound
cloud-init is enabled but no datasource found, disabling
already disabled: no change needed [no /run/systemd/
However just using it again with the force option fixes the issue:
slestemplate:~ # /usr/lib/ cloud-init/ ds-identify --force init/ds- identify. log NAME=Standard PC (i440FX + PIIX, 1996) UUID=0CE53BB3- A48E-44F7- 9EC7-3C339E9C80 D3 NAME=unavailabl e ASSET_TAG= unavailable: error DEVS=unavaila. ..
slestemplate:~ # cat /run/cloud-
[up 11.01s] ds-identify
policy loaded: mode=search report=false found=all maybe=all notfound=disabled
no datasource_list found, using default: MAAS ConfigDrive NoCloud AltCloud Azure Bigstep CloudSigma CloudStack DigitalOcean AliYun Ec2 GCE OpenNebula OpenStack OVF SmartOS Scaleway Hetzner IBMCloud
ERROR: failed running [127]: blkid -c /dev/null -o export
DMI_PRODUCT_
DMI_SYS_VENDOR=QEMU
DMI_PRODUCT_SERIAL=
DMI_PRODUCT_
PID_1_PRODUCT_
DMI_CHASSIS_
FS_LABELS=
ISO9660_