I don't believe your reproducer is valid - cloud-init is not installed anymore, as autopkgtest-buildvm-ubuntu-cloud removes it when building the VM, whereas it remains on the cloud images, as it's needed there to actually get the IP address during boot.
Removing the DefaultDependencies=no means that ufw.service is After=basic.target After=sysinit.target. cloud-init.service has Before=sysinit.target, so would have to run before ufw.service. It is After=systemd-networkd-wait-online.service though which is After=systemd-networkd which is After=network-pre.target. So there's the cycle, we need to run cloud-init After=network-pre (hence After ufw), but determined before that cloud-init needs to run before sysinit.target, which needs to run before ufw.service. I can't reproduce the issue in a VM right now, though, because um, cloud-init does not seem to start at all during second boot despite seemingly being enabled. ** Also affects: cloud-init (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1950039 Title: ufw 0.36.1-3 introduces ordering cycle, breaking network To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1950039/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs