1
votes

I'm trying to follow these instructions: https://cloud.google.com/compute/docs/disks#creating_snapshots

It's not obvious to me if I'm supposed to run the "gcloud compute disks snapshot DISK" command from my personal machine, or on the VM over SSH. I tried the former and I couldn't figure out an argument for DISK that worked. So I SSH'ed into the machine and ran

$ gcloud compute disks snapshot /

I left that running for several hours, without seeing any indication of progress. Now when I try to SSH into the machine, I can't:

$ gcloud compute ssh foo
Timeout, server foo not responding.
ERROR: (gcloud.compute.ssh) [/usr/bin/ssh] exited with return code [255].

So I assume I've done something wrong, but I don't know what or how to fix it. Thanks

2
I had a similar experience first time I tried making snapshots. Check in the Google API console and see if you can see the CPU load. It maybe at 100% indicating the snapshot is still being built. It took several hours the first time for me, and failed as the image didn't have enough disk space to hold the snapshot.MarkeD

2 Answers

0
votes

You can run the command on either machine. Running it from the outside gives you more flexibility, while running from within the machine allows you to trigger snapshots based on machine events more easily. 'DISK' must be replaced with the disk name in Google Compute Engine. This is the same name you used to create the disk or, in case of root disks, it's the same as instance name. You can find the list of disks in your project with:

gcloud compute disks list

Alternatively, you can find disk names in '/dev/disk/by-id/google-*'.

0
votes

Timeout, server is not responding.

This is related to your SSH connection timeout issues. You need to enable and increase your server alive interval value in your ~/.ssh/config (or /etc/ssh/ssh_config), e.g.

Host *
  ServerAliveInterval 30
  ServerAliveCountMax 6

See: What the options ServerAliveInterval and ClientAliveInterval mean?