区域没有足够的可用资源来满足请求/资源没有准备好

我无法启动我的实例(通过网络浏览器) ,它给了我一个错误:

“‘ project/XXXXX/zone/europe-west 4-b’区域没有足够的资源 可用于满足请求的资源。请尝试不同的区域,或 稍后再试”

一开始我以为是配额的问题,但检查完我的配额后,一切都很好。事实上,我列出了可用区域,欧洲西部4B 区可用,但我还是试着移动了区域。然后我尝试了 "gcloud compute instances move XXXX --zone europe-west4-b --destination-zone europe-west4-c",但仍然失败,弹出错误:

”错误: (gclod.compute.instances.move)当 状态: 终止”

好的,终止... 然后我试图通过 "gcloud compute instances reset XXX"重新启动它,错误显示的方式是:

错误: 无法获取资源: - 资源“ project/XXXXX/zone/europe-west 4-b/instance/XXX” 还没准备好

我搜索了错误,有些人通过删除磁盘解决了这个问题。虽然我不想清除记忆,但是我怎样才能解决这个问题呢?

顺便说一下,我只有一个实例,附加了一个持久磁盘。

88536 次浏览

Even I'm getting the same error. I have waited for 24 hours and tried. But still no luck. For me, it's not transient.The zone 'projects/XXXX/zones/europe-west2-c' does not have enough resources available to fulfill the request. Try a different zone, or try again later. I had to create entirely new instance to come over it.

To have a more up to date answer, today I had the same issue with the zone us-central1-a. I was getting the error message "The zone 'projects//zones/us-central1-a' does not have enough resources available to fulfill the request. '(resource type:compute)'.". Fortunatelly the error was overcome by just waiting 5 minutes and trying again.

So I had the same issue for over 24 hours.

I tried to move my VM to another zone, but since it was in the terminated state and I couldn't restart it due to not having enough resources in my region, I couldn't move it.

Okay, but then per my understanding, your persistent disk attached to your VM is another story and you can copy it without starting your VM.

So I went around this issue by:

  1. Going to my Google Cloud Platform >>> Compute Engine
  2. Went to Snapshots >>> created a snapshot >>> Select your Compute Engine instance
  3. Once snapshot was completed I clicked on my snapshot.
  4. Ended up under "snapshot details". There, on the top, just click create instance. Here you are basically creating an instance with a copy of your disk.
  5. Select your new zone, don't forget to attach GPUs, all previous setting, create new name.
  6. Click create, that's it, your image should now be running in your new zone

As others have noted, this occurs when a GCP zone is oversubscribed, and its generally temporary. There is something that you can do to defend against it happening to you in the future though.

What it almost certainly won't resolve the error while the zone has insufficient resources, you can prevent this error in the future by Reserving Zonal Resources in advance -- effectively guaranteeing that the resources will be available for you when you need them.

Of course, as you are asking GCP to hold computing resources for your future use, you are billed for the instance reservation as if it was a fully running instance (but there isn't an additional charge while your instance is actually running). They also qualify for sustained use and committed use discounts like any VM instance.

There's a lot of configurability in what you can reserve, but the minimal gcloud command to reserve a single instance might look something like this:

gcloud compute reservations create my-reservation --machine-type=n1-standard-1 --zone=us-central1-a --vm-count=1

And to delete it when you are done:

gcloud compute reservations delete my-reservation

You can also do this through the console, on the 'Compute Engine > Commited use discounts > Reservations' tab.

Happened to me over the weekend when I wanted to swap the K80 to a new P100 instance.

My setup:

  • 'GPUS_ALL_REGIONS' quota is set to 1.
  • A single GPU (K80) instance on europe-west1 (zone: europe-west1-b)

Steps that produced the error:

  1. Deleted the K80 instance.
  2. After deleting I had a total of 0 instances running.
  3. Each attempt to create a new instance in the same region produced the error message.

Any instance created on other regions with the same zone identifier ('b', from europe-west1-b) produced this error as well.


How to resolve this issue:

Create a GPU instance on a different region and a different zone identifier ('a', 'c', 'd', ...). That's it.

Starting the instance using the GUI instead worked for me. Seems like a bug in gcloud.