[Bug 1563951] Re: Cloud-init does not initialize systemd machine id

eblock@nde.ag 1563951 at bugs.launchpad.net
Mon Jan 9 15:31:28 UTC 2023


I'd like to propose a change regarding the machine-id setup, but I'm not
sure how to reopen this bug. If you just remove the file /etc/machine-id
(for example via 'cloud-init clean --machine-id') it won't regenerated
during startup but error messages are displayed (here in Ubuntu 20.04):

---snip---
Jan  9 14:49:48 control-4 kernel: [    3.482774] systemd[1]: System cannot boot: Missing /etc/machine-id and /etc is mounted read-only.
Jan  9 14:49:48 control-4 kernel: [    3.484066] systemd[1]: Booting up is supported only when:
Jan  9 14:49:48 control-4 kernel: [    3.485226] systemd[1]: 1) /etc/machine-id exists and is populated.
Jan  9 14:49:48 control-4 kernel: [    3.485861] systemd[1]: 2) /etc/machine-id exists and is empty.
Jan  9 14:49:48 control-4 kernel: [    3.486569] systemd[1]: 3) /etc/machine-id is missing and /etc is writable.
Jan  9 14:49:48 control-4 kernel: [    4.247850] systemd[1]: Failed to populate /etc with preset unit settings, ignoring: Read-only file system
---snip---

If you just truncate the files to size 0 the boot works fine:

root at control-4:~# truncate -s0 /etc/machine-id /var/lib/dbus/machine-id

I haven't tested many scenarios but this change might help a bit when
creating VM images.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to livecd-rootfs in Ubuntu.
https://bugs.launchpad.net/bugs/1563951

Title:
  Cloud-init does not initialize systemd machine id

Status in cloud-init package in Ubuntu:
  Won't Fix
Status in livecd-rootfs package in Ubuntu:
  Invalid

Bug description:
  Systemd uses /etc/machine-id file to uniquely identify the machine and
  to provide machine ID to D-Bus. This file is generated with `systemd-
  machine-id-setup` command that should be run on system installation
  (or at least when a system is provisioned). However, cloud-init does
  not do this.

  As far as I can see, all Wily Werewolf VMs provisioned in EC2 have the
  same machine-id ff1bed6402c14c57ac03a074cdb7479e.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1563951/+subscriptions




More information about the foundations-bugs mailing list