9

I am using Google Compute engine to host couple of sites but I resize the disk and then restarted the instance and now I am unable to connect both from gcs and putty. ( Connection Refused )

Serial console output: http://pastebin.com/BZicx7JN

how can I troubleshoot this ?.

Zaid
  • 91
  • 1
  • 1
  • 2
  • 1
    Before checking the console output I would wait for it to finish booting. – Michael Hampton Jan 01 '17 at 06:52
  • The output of the serial console does look incomplete. Did you follow [these steps](https://cloud.google.com/compute/docs/disks/add-persistent-disk) to resize the disk? Did you get any errors or did anything differently? I would suggest confirming that you have a valid file system and MBR record as explained [in this article](https://cloud.google.com/compute/docs/troubleshooting#pdboot) – Carlos Jan 03 '17 at 19:39
  • have you checked you firewall rules, i think you have delteed the rule that give access to to your instance at port 22. – Sudhanshu Gaur Jan 26 '17 at 17:17
  • 1
    Were you ever able to solve this issue? If so please consider posting a self-answer so the community can benefit. – Faizan Feb 03 '17 at 20:22
  • Try by using different internet connection. Your ISP might not allowing port 22. – Nishant Jun 16 '18 at 12:55

2 Answers2

16

I had the same issue with one of my GCP VM instance. My solution was:

  1. Shut down the instance
  2. Click 'Edit' for the instance
  3. Under 'Custom Metadata' section, add 'startup-script' key, with value:
#! /bin/bash
sudo ufw allow 22
  1. Click 'Save'
  2. Start the instance again, and SSH into it

Hope it helps!

Quang Trần
  • 161
  • 1
  • 3
4

General recommendation to troubleshot this issue.

  • Make sure the disk resize is done properly. Detailed steps are documented here.
  • Confirm the instance has fully booted up. You can confirm this through VM serial console output.
  • Once the instance is booted confirm if ssh daemon is running. Serial console output will have information about ssh daemon. If ssh service is not running you can use interactive serial console to start the service.
  • Make sure you have firewall rule configured in GCE network to allow ssh port.
  • Make sure firewall on the instance(e.g. iptables) is allowing the ssh port. You can use interactive serial console to disable firewall on the VM, if required.
Faizan
  • 1,438
  • 10
  • 18
  • What information In VM serial console output can confirm the instance has fully booted up? What information In VM serial console output can confirm the daemon is running? – niaomingjian Jan 12 '18 at 02:24