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

Alberto Contreras 1563951 at bugs.launchpad.net
Tue Sep 20 08:44:11 UTC 2022


I think cloud-init's unique responsibility in respect to this matter is
to ensure that an instance has a machine-id.

In systemd systems, this is automatically handled by systemd itself [1]:

> When a machine is booted with systemd(1) the ID of the machine will be
established. If systemd.machine_id= or --machine-id= options (see first
section) are specified, this value will be used. Otherwise, the value in
/etc/machine-id will be used. If this file is empty or missing, systemd
will attempt to use the D-Bus machine ID from /var/lib/dbus/machine-id,
the value of the kernel command line option container_uuid, the KVM DMI
product_uuid or the devicetree vm,uuid (on KVM systems), and finally a
randomly generated UUID.

In respect to other init systems, I didn't find documentation about how
the machine-id is generated. But I would assume they do the right thing.

Taking into account that and the lack of activity of this ticket during
4+ years, I don't see any actionable thing to do from a cloud-init's
perspective, so maybe this ticket should be closed.

This discussion was restarted by https://github.com/canonical/cloud-
init/pull/1737.

[1] https://www.freedesktop.org/software/systemd/man/machine-
id.html#Initialization

-- 
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:
  Confirmed
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