Google Compute Engine:如何为VM的磁盘快照 [英] Google Compute Engine: How to snapshot a VM's disk

查看:92
本文介绍了Google Compute Engine:如何为VM的磁盘快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试按照以下说明进行操作: https://cloud.google.com/compute/docs/disks#creating_snapshots

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

如果我应该从个人计算机或通过SSH在VM上运行"gcloud计算磁盘快照DISK"命令,这对我来说并不明显. 我尝试了前者,但我想不出DISK可行的论据. 所以我通过SSH进入了机器并运行

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 /

我将该程序运行了几个小时,却没有看到任何进展的迹象. 现在,当我尝试通过SSH进入计算机时,我无法:

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

推荐答案

您可以在任一台计算机上运行命令.从外部运行它可以为您提供更大的灵活性,而从计算机内部运行则可以更轻松地基于计算机事件触发快照. 必须将"DISK"替换为Google Compute Engine中的磁盘名称.这是您用于创建磁盘的名称,如果是根磁盘,则与实例名称相同.您可以使用以下命令找到项目中的磁盘列表:

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

或者,您可以在"/dev/disk/by-id/google- *"中找到磁盘名称.

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

这篇关于Google Compute Engine:如何为VM的磁盘快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆