从GCE VM分离启动磁盘 [英] Detach Boot Disk from GCE VM

查看:63
本文介绍了从GCE VM分离启动磁盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从GCE VM分离启动盘.由于虚拟机已停止,因此应该允许我分离它,但它会返回此错误

I am trying to detach the Boot Disk from a GCE VM. As the VM is stopped so it should allow me to detach it but it's returning this error

UNSUPPORTED_OPERATION: Hot-remove of the root disk is not supported.

有什么建议吗?

推荐答案

更新的答案

2019年1月24日起,GCE已添加了以下功能:从GA中已停止的VMs 分离并重新附加启动磁盘

Updated answer

As of 24 Jan 2019, GCE added the ability to detach and reattach boot disks from stopped VMs in GA.

如果从停止的VM分离启动磁盘,则无法重新启动VM备份,因此该操作没有意义.

If you detach the boot disk from a stopped VM, there's no way to restart the VM back up, so that operation does not make sense.

因此,您需要禁用选项>自动删除启动磁盘" 并删除虚拟机:

Thus, you would need to disable the option "auto-delete boot disk" and delete the VM:

要在gcloud compute中设置永久磁盘的自动删除状态,请使用

To set the auto delete state of a persistent disk in gcloud compute, use the gcloud compute instances set-disk-auto-delete command:

gcloud compute instances set-disk-auto-delete INSTANCE \

    [--auto-delete | --no-auto-delete] --disk DISK --zone ZONE

或者,您也可以在Developers Console的VM详细信息页面上通过单击VM实例名称,然后取消选中此选项来更改此设置:

Alternatively, you can also change this setting on the VM details page from the Developers Console by clicking on the VM instance name, and then unchecking this option:

☐删除实例后删除引导磁盘

☐ Delete boot disk when instance is deleted

这篇关于从GCE VM分离启动磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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