I had a Ubuntu VM that lost its ability to get an IP. I have no idea why but I finally found the issue and it seems that the interface name changed.
Maybe its a bug : https://bugs.launchpad.net/ubuntu/+source/netplan.io/+bug/1881832
So I found out that the network interface that was trying to do DHCP did not exist. You’ll find this in /etc/netplan/50-cloud-init.yaml . For some reason, it showed that my interface was enp1s0 but it wasn’t, it was enp3s0. So I modified the file and rebooted the server. Everything is fine now.