machine-id is not reset when instance-id changes
Bug #2003121 reported by
Robie Basak
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
As discussed in #ubuntu-server just now, it's expected that cloud-init will ensure that machine-id is not carried over when a VM is cloned and this is detectable by an instance-id change.
This would align behaviour with ssh host key regeneration behaviour.
Actual behaviour: currently if a VM is cloned and the instance-id changes, /etc/machine-id remains the same.
To post a comment you must log in.
While experimenting with this, I found that systemd-networkd uses /etc/machine-id to determine the DHCP client identifier, and dnsmasq reissues the same lease if the client identifier is the same. So starting two cloud images using libvirt with its dnsmasq DHCP support from the same "golden image", without cloud-init resetting /etc/machine-id, results in an IP conflict between those two VMs.