3
votes

I have created a virtual machine instance from snapshot taken the production server. SSH key is set. But I am unable to ssh into instance both from the putty and google cloud ssh option from browser.

I have search around and find out that the issue new release which does not set the
default IP gateway for the instance. I have set the IP gateway and restart the instance but instance still showing the same error . I have also check the Firewall rule and port 22 traffic allowed to the instance. All other instance in same zone are working on SSH other than instance newly created using snapshot.

After looking into the logs from the serial port ifup: failed to bring up lo

Image of the error enter image description here

2
Have you tried SSH from the Google Cloud Console? Connect using the serial port 1 from the Google Cloud Console Compute Instances Page. Are any errors in the log?John Hanley
Only these error in log ` /sbin/dhclient-script: 28: .: Can't open /usr/share/sendmail/dynamic segfault at 7f81a189932c ip 00007f81ad1880a9 sp 00007ffca45fd550 error 6`Fahad Abid
If you open a cloud shell and run: gcloud compute --project YOURPROJECT ssh --zone YOURZONE YOURINSTANCE are you able to connect?Kolban
after running command and reading all logs on console . I am able to find error # Failed to start Raise network interfaces.#Failed to start System Logging Service.Any work aroundFahad Abid

2 Answers

1
votes

It seems the issue here is that the network interface of your new instance is not coming up. You can try one of two steps:

1) try connecting through the serial console. This does not connect through port 22 or use SSH. However, if the network card is not coming up at all, this may also fail.

2) Add a startup script to the instance which will run the commands you need to configure the network card

2
votes

@Patrick answer helps me get to answer, explanatory steps

  1. 1) Serial Console.
    • Go to you instance detail and enable serial port.
    • Connect to your instance using serial port and login with the user and password
    • If you do not have user create one by following script as a startup-script
      #!/bin/bash 
        sudo useradd -G sudo user
        sudo echo 'user:password' | chpasswd 
  • sudo systemctl status networking.service to check networking status
  • Remove the /etc/network/interfaces.d/setup file then edit your /etc/network/interfaces
auto lo
iface lo inet loopback
  • Restart networking service by running sudo systemctl status networking.service

2) Following startup script also work for me

#!/bin/bash 
sudo dhclient eth0