Hello ashishbhatia
As per Mahboob from StackOverflow
As per GCP documentation if you see the Booting from Hard Disk 0... at the serial console then you must troubleshot the issues from compute engine environment. Most importantly you need to check the file system for your problematic vm’s. To do this please follow the steps:
Step1- Detach the disk from the instance
gcloud compute instances delete old-instance --keep-disks boot
Step2- Create a new instance with latest Google provided image
gcloud compute instances create debug-instance
Step3- Attach the disk to the new-vm as a secondary disk and don’t mount the disk at all
gcloud compute instances attach-disk debug-instance
--disk DISK
--device-name debug-disk
Step4- Connect to new instance
gcloud compute ssh debug-instance
Step5- look for the secondary disk, it might be sdb1
lsblk
step6- Check the file system using the command
sudo fsck /dev/sdb1
Step7: Mount the file system
sudo mkdir /mydisk
sudo mount /dev/sdb1 /mydisk
Step8: check that disk has kernel files:
ls /mydisk/boot/vmlinuz-*
At the end please check the MBR is valid using the command:
sudo parted /dev/sdb print
If MBR valid it will show information about file system:
Disk /dev/sdb: 10.7GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 2097kB 10.7GB 10.7GB primary ext4 boot
Now detach the secondary disk from the new instance and attach it to old VM as a boot disk or create a image from the disk to create new instance from the image.