1

I unable to connect to my VM instance named "g14" while it already running under project id "vernal-dispatch-280822" using SSH on port 22 (PS attached).also i can't connect over RDP or using VNC viewer.

Issue occurred after i reboot mentioned VM instance then start it again after take effect of mount my Storage bucket named "torky_bucket" as file system to my VM instance "g14" using the open source tool named "gcsfuse".

so please support me to recover my VM instance.and in case you need to remove mount point, please go ahead in case it is cause of issue.

BR, Torky

enter image description here

user580061
  • 11
  • 1
  • 1
    You need to use your VPS provider console option to log in to the VPS and see what is failing during startup. – Tero Kilkanen Jun 21 '20 at 07:20
  • 1
    You can use the serial console to connect to the VM and change the configuration even if it is disconnected from networking: https://cloud.google.com/compute/docs/instances/interacting-with-serial-console – Mircea Vutcovici Jun 21 '20 at 11:56
  • Please update your question with boot log collected at [serial console](https://cloud.google.com/compute/docs/instances/interacting-with-serial-console) port. In addition, have a look at the documentation [Troubleshooting SSH](https://cloud.google.com/compute/docs/troubleshooting/troubleshooting-ssh). – Serhii Rohoza Jun 22 '20 at 12:39

1 Answers1

0

At first, you should collect logs:

  1. Go to Compute Engine -> VM instances -> click on NAME_OF_YOUR_VM -> at the VM instance details find section Logs and click on Serial port 1 (console)
  2. Reboot your VM instance again.
  3. Check full boot log for any errors or/and warnings.

If your VM instance doesn't start up verify that your disk has a valid file system and a valid master boot record (MBR) by following the documentation General troubleshooting.

If you found errors/warning related to disk space you can try to resize it accordingly to the documentation Resizing a zonal persistent disk, also accordingly to the article Recovering an inaccessible instance or a full boot disk:

If an instance is completely out of disk space or if it is not running a Linux guest environment, then automatically resizing your root filesystem isn't possible, even after you've increased the size of the persistent disk that backs it. If you can't connect to your instance, or your boot disk is full and you can't resize it, you must create a new instance and recreate the boot disk from a snapshot to resize it.

Otherwise try to troubleshoot your VM instance via serial console:

  1. Enable serial console connection with gcloud command:

     gcloud compute instances add-metadata NAME_OF_YOUR_VM_INSTANCE \
     --metadata serial-port-enable=TRUE
    

or go to Compute Engine -> VM instances -> click on NAME_OF_YOUR_VM_INSTANCE -> click on EDIT -> go to section Remote access and check Enable connecting to serial ports

  1. Create temporary user and password to login: shutdown your VM and set a startup script by adding at the section Custom metadata key startup-script and value:

     #!/bin/bash
     useradd --groups google_sudoers tempuser
     echo "tempuser:password" | chpasswd
    

and then start your VM.

  1. Connect to your VM via serial port with gcloud command:

     gcloud compute connect-to-serial-port NAME_OF_YOUR_VM_INSTANCE
    

    or go to Compute Engine -> VM instances -> click on NAME_OF_YOUR_VM_INSTANCE -> and click on Connect to serial console

  2. Check what went wrong.

  3. Disable access via serial port with gcloud command:

     gcloud compute instances add-metadata NAME_OF_YOUR_VM_INSTANCE \
     --metadata serial-port-enable=FALSE
    

or go to Compute Engine -> VM instances -> click on NAME_OF_YOUR_VM_INSTANCE -> click on EDIT -> go to section Remote access and uncheck Enable connecting to serial ports. Keep in mind that accordingly to the documentation Interacting with the serial console:

Caution: The interactive serial console does not support IP-based access restrictions such as IP whitelists. If you enable the interactive serial console on an instance, clients can attempt to connect to that instance from any IP address. Anybody can connect to that instance if they know the correct SSH key, username, project ID, zone, and instance name. Use firewall rules to control access to your network and specific ports.

If you weren't able to connect via serial console, try follow the documentation Troubleshooting SSH section Inspect the VM instance without shutting it down and inspect the disk of your VM on another VM. Same way you can transfer your data to another working VM instance.

Serhii Rohoza
  • 1,354
  • 2
  • 4
  • 14