I understand that your Ubuntu 18.04 is not accessible, and you found the above errors in the logs. Thanks for providing the detailed log message.
This issue can happen if you are running an old version of netplan. To resolve this issue you will need to upgrade the version of netplan. Since the VM is not accessible you will need do this via a rescue VM. I am including the steps here:
Stop or deallocate the affected VM.
Create a rescue VM of the same generation, same OS version, Ubuntu 18.04, in same resource group and location using managed disk.
Use the Azure portal to take a snapshot of the affected virtual machine's OS disk.
Create a disk out of the snapshot of the OS disk, and attach it to the rescue VM.
Once the disk has been created, troubleshoot the chroot environment in the rescue VM.
Access your VM as the root user by using the following command:
sudo su -
Find the disk using dmesg
(the method you use to discover your new disk may vary). The following example uses dmesg
to filter on Small Computer Systems Interface (SCSI) disks:
dmesg | grep SCSI
The command output is similar to the following example. In this example, the /dev/sdc disk is what you want:
[ 0.294784] SCSI subsystem initialized
[ 0.573458] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[ 7.110271] sd 2:0:0:0: [sda] Attached SCSI disk
[ 8.079653] sd 3:0:1:0: [sdb] Attached SCSI disk
[ 1828.162306] sd 5:0:0:0: [sdc] Attached SCSI disk
Use the following commands to access the chroot environment:
mkdir /rescue
mount /dev/sdc1 /rescue
mount /dev/sdc15 /rescue/boot/efi
mount -t proc /proc /rescue/proc
mount -t sysfs /sys /rescue/sys
mount -o bind /dev /rescue/dev
mount -o bind /dev/pts /rescue/dev/pts
mount -o bind /run /rescue/run
chroot /rescue
Install the netplan package in chroot environment
apt-get update
apt install netplan.io
Use the following commands to exit the chroot environment:
exit
umount /rescue/proc/
umount /rescue/sys/
umount /rescue/dev/pts
umount /rescue/dev/
umount /rescue/run
cd /
umount /rescue/boot/efi
umount /rescue
Note
If you receive the error message "unable to unmount /rescue," add the -l
option to the umount
command, for example, umount -l /rescue
.
Detach the disk from the rescue VM and perform a disk swap with the original VM.
Start the original VM and check its connectivity.
Hope this helps! Let me know if you have any follow-up questions or are still facing issues.
If you still have questions, please let us know in the "comments" and we would be happy to help you. Comment is the fastest way of notifying the experts.
If the answer has been helpful, we appreciate hearing from you and would love to help others who may have the same question. Accepting answers helps increase visibility of this question for other members of the Microsoft Q&A community.
Thank you for helping to improve Microsoft Q&A!