简体   繁体   English

如何从谷歌云实例访问启动盘

[英]How can I access boot disk from google cloud instance

My google cloud instance got a problem and it's preventing me to access the ssh.我的谷歌云实例出现问题,它阻止我访问 ssh。 I would like to access the boot disk image from gcloud shell to download my files.我想从 gcloud shell 访问启动磁盘映像以下载我的文件。 How can I do that?我怎样才能做到这一点?

Thanks in advance提前致谢

Create a new VM with a brand new disk.使用全新的磁盘创建一个新的 VM。 Add the problematic boot disk as additional disk.将有问题的启动磁盘添加为附加磁盘。 Start your new VM, log into it, and browse the additional disk to get your files.启动您的新 VM,登录它,然后浏览额外的磁盘以获取您的文件。

If you need to recover data from your existing boot disk of the problematic VM instance, you can detach the boot disk and then attach that disk as a secondary disk on a new instance so that you can have access to the data.如果您需要从有问题的 VM 实例的现有启动磁盘中恢复数据,您可以分离启动磁盘,然后将该磁盘作为辅助磁盘附加到新实例上,以便您可以访问数据。

  1. Detach the boot disk from the existing VM instance by running the following command.通过运行以下命令从现有 VM 实例分离启动磁盘

     gcloud compute instances detach-disk [INSTANCE_NAME] --disk=my-disk
  2. Create a new VM with your old VM's boot disk by the following command.通过以下命令使用旧 VM 的启动磁盘创建一个新 VM。

     gcloud compute instances create [NEW_VM_NAME] --disk name=BOOT_DISK_NAME,boot=yes,auto-delete=no
  3. Connect to your new VM using SSH:使用 SSH 连接到新 VM:

     gcloud compute ssh [NEW_VM_NAME]

Refer to the documentation that describes common errors that you may run into, when connecting to virtual machine (VM) instances using SSH, also ways to resolve errors for diagnosing failed SSH connections.请参阅描述使用 SSH 连接到虚拟机 (VM) 实例时可能遇到的常见错误的文档,以及解决用于诊断 SSH 连接失败的错误的方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试创建Google Cloud实例时,我无法更改启动磁盘 - I can't change the boot disk when I try to create a Google Cloud Instance 如何将我的 Google Cloud Platform(GCP) 实例的额外磁盘空间分配给我的 R 服务器 - How can I allocate extra disk space of my Google Cloud Platform(GCP) instance to my R server 使用Plesk减少Google云端实例上启动磁盘的大小 - Reducing the size of boot disk on google cloud instance with Plesk 如何从谷歌云实例 ping ipv6 - How can I ping ipv6 from a google cloud instance 无法访问 Google Cloud 实例 - Can not access Google Cloud Instance 如何在谷歌计算引擎中访问启动盘作为数据盘 - How to access boot disk as data disk in google compute engine 我如何从谷歌 kubernetes 引擎访问云 sql - how can i access cloud sql from google kubernetes engine 如何使用 Google Cloud Function 将文件从 Cloud Storage 存储桶推送到实例中? - How can I use a Google Cloud Function to push a file from a Cloud Storage bucket into an instance? Google云端:无法将磁盘添加到具有写许可权的实例模板 - Google Cloud: can't add disk to instance template with write permission 无法访问谷歌云计算实例外部 IP(启动 fedora35) - Can't access Google Cloud Compute Instance External IP (boot fedora35)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM