<story><title>Ubuntu 22.04 LTS servers and phased apt updates</title><url>https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2204ServerPhasedUpdates</url></story><parent_chain><item><author>nyx</author><text>Ahh, &amp;#x2F;etc&amp;#x2F;machine-id, we meet again... Last time I met you, you were causing my cloned VM to get the same DHCP address as its original and blow up my VM network, despite libvirt&amp;#x27;s virt-clone utility properly randomizing vNIC MAC addresses, because netplan defaults to using you as the DHCP client identifier. If only we could meet under more pleasant circumstances.</text></item></parent_chain><comment><author>kstenerud</author><text>NixOS has a related problem in that you can&amp;#x27;t set the machine&amp;#x27;s MAC address without a hack:&lt;p&gt;&lt;pre&gt;&lt;code&gt;      # Hack: Change the default MAC address after network but before dhcpcd runs
      systemd.services.setmacaddr = {
        script = &amp;#x27;&amp;#x27;
          &amp;#x2F;run&amp;#x2F;current-system&amp;#x2F;sw&amp;#x2F;bin&amp;#x2F;ip link set dev eth0 address ${macaddr}
          &amp;#x2F;run&amp;#x2F;current-system&amp;#x2F;sw&amp;#x2F;bin&amp;#x2F;systemctl stop dhcpcd.service
          &amp;#x2F;run&amp;#x2F;current-system&amp;#x2F;sw&amp;#x2F;bin&amp;#x2F;ip addr flush eth0
          &amp;#x2F;run&amp;#x2F;current-system&amp;#x2F;sw&amp;#x2F;bin&amp;#x2F;systemctl start dhcpcd.service
        &amp;#x27;&amp;#x27;;
        wantedBy = [ &amp;quot;basic.target&amp;quot; ];
        after = [ &amp;quot;dhcpcd.service&amp;quot; ];
      };
&lt;/code&gt;&lt;/pre&gt;
If you don&amp;#x27;t do this, it uses some black magic to decide the MAC address based on various hardware, making system migration and maintenance a nightmare.</text></comment>
<story><title>Ubuntu 22.04 LTS servers and phased apt updates</title><url>https://utcc.utoronto.ca/~cks/space/blog/linux/Ubuntu2204ServerPhasedUpdates</url></story><parent_chain><item><author>nyx</author><text>Ahh, &amp;#x2F;etc&amp;#x2F;machine-id, we meet again... Last time I met you, you were causing my cloned VM to get the same DHCP address as its original and blow up my VM network, despite libvirt&amp;#x27;s virt-clone utility properly randomizing vNIC MAC addresses, because netplan defaults to using you as the DHCP client identifier. If only we could meet under more pleasant circumstances.</text></item></parent_chain><comment><author>lima</author><text>virt-clone only takes care of the libvirt config but won&amp;#x27;t touch unique identifiers in your disk image.&lt;p&gt;&amp;#x2F;etc&amp;#x2F;machine-id isn&amp;#x27;t the only thing to worry about when duplicating a VM - think SSH host key, DHCP leases, various filesystem UUIDs, log files, MAC addresses in ifcfg-* files and udev-persistent-net rules...&lt;p&gt;You can use virt-sysprep[1] to clean up a disk image.&lt;p&gt;[1]: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;www.libguestfs.org&amp;#x2F;virt-sysprep.1.html&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;www.libguestfs.org&amp;#x2F;virt-sysprep.1.html&lt;/a&gt;</text></comment>