在区域之间移动 Google 个云计算实例

Move Google Cloud Compute instance between zones

我在 Google 区域 europe-west3-c 上的云上有一个 Compute Engine 实例。在过去的几天里,当我尝试启动它时,我收到以下消息:

The zone 'projects/PROJECT/zones/europe-west3-c' does not have enough resources available to fulfill the request. Try a different zone, or try again later.

由于我已经尝试连接好几天了,所以我决定在区域之间移动实例。我试过这个API:https://cloud.google.com/compute/docs/reference/rest/v1/projects/moveInstance

但是我得到这个错误:

404: Invalid resource usage: 'Instance is a UEFI-enabled instance and does not support MoveInstance.'.

我的工作确实需要这个计算实例,因此非常感谢任何快速帮助!

使用以下 gcloud 命令,您可以 move an instance automatically. However, When possible, use the moveInstances API to save yourself some work, but there are some scenarios where using the moveInstances API is not 一个选项。

gcloud compute instances move example-instance-1 --zone us-central1-b --destination-zone us-central1-f

尽可能使用 moveInstance API 自动移动实例,它会为您处理移动实例的所有步骤。但是,如果您不能使用 API,则可以执行 move manually.

您可以创建 image or snapshot from the instance disk then you can create new instance from the image or also you can create instance from snapshot。您可以在任何 region/zone.

中创建新的 VM

您可以使用以下 gcloud 命令 detaching VM 磁盘的另一种方法:

gcloud compute instances detach-disk Instance-Name --disk=Disk-Name --zone Disk-zone

现在,如果您转到 Compute Engine > Disks > 单击 VM 磁盘的名称 > Manage disk > CREATE INSTANCE;创建新实例,您可以将 VM 实例更改或移动到您选择的 region/zone.