109

I failed to start my instance (through the web browser), it gave me the error:

"The zone 'projects/XXXXX/zones/europe-west4-b' does not have enough resources available to fulfill the request. Try a different zone, or try again later."

I thought it might be the quota problem at first, after checking my quota, it showed all good. Actually, I listed the available zones, europe-west4-b was available, but I still gave a shot to move the zone. Then I tried "gcloud compute instances move XXXX --zone europe-west4-b --destination-zone europe-west4-c", however, it still failed, popped up the error:

"ERROR: (gcloud.compute.instances.move) Instance cannot be moved while in state: TERMINATED"

Okay, terminated... then I tried to restart it by "gcloud compute instances reset XXX", the error showed in the way:

ERROR: (gcloud.compute.instances.reset) Could not fetch resource: - The resource 'projects/XXXXX/zones/europe-west4-b/instances/XXX' is not ready

I searched the error, some people solved this problem by deleting the disk. While I don't want to wipe the memory, how could I solve this problem?

BTW, I only have one instance, with one persistent disk attached.

ShadeBai
  • 1,115
  • 2
  • 7
  • 4
  • 5
    I tried it 6 hours later, then it works fine. = = – ShadeBai Oct 07 '18 at 10:01
  • 2
    This is the best way to reslove this error https://stackoverflow.com/a/45126763/9243066 – honi raf Nov 09 '18 at 20:58
  • Still 4 years on, same problem. BTW very legitimate question. Expect Google to provide a solution for this issue. – W.M. Nov 23 '22 at 16:01
  • 1
    @W.M. I’m guessing you got screwed today too? The easiest thing I came up with was to click the instance, click “create similar” and then choose a different location. I now have them as backups in case this happens again. – Andy Danger Gagne Nov 24 '22 at 00:26
  • Yes, that was the "solution". To create it in another region. – W.M. Nov 25 '22 at 06:05

6 Answers6

52

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.

Raya Sudhakar
  • 521
  • 1
  • 3
  • 3
  • 9
    I upvoted because you gave a solution to my problem, but this is the kind of bug someone on the GCloud really ought to fix. All love to Google and the people providing the service: I'm very grateful for it. But I really don't want to have to redo these hours of work – Nathan majicvr.com Aug 14 '19 at 17:31
37

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
inishchith
  • 13
  • 5
Yev Guyduy
  • 1,371
  • 12
  • 13
  • Do you need to remove the snapshot afterwards to avoid any storage charges associated with it? – qAp Aug 09 '19 at 17:07
  • 1
    from what I understand depending where (which region) you create your snapshot in, you may incur network costs when you redeploy. --- https://cloud.google.com/compute/docs/disks/create-snapshots then regrading storing your snapshot on persistent disk attached to your VM, from what I see, I think you will be charged (per GB/month stored), according to this pricing list: https://cloud.google.com/persistent-disk/ – Yev Guyduy Aug 09 '19 at 20:32
  • 1
    Selecting your snapshot storage location is vital to minimizing network costs. If you store your snapshot in the same region as your source disk there is no network charge when you access that snapshot from the same region. If you access the snapshot from a different region, there is a network cost. . As of 08/16 Snapshot storage (GB/MONTH) = $0.026 Multi-regional snapshot storage in each multi-region = $0.026 – Yev Guyduy Aug 16 '19 at 21:12
  • I ran into the same problem today and this answer saved me. Thanks! – Jack Tsai Dec 27 '19 at 09:10
  • Note: when I did this, I lost permissions to my gcloud storage buckets – Nathan majicvr.com Apr 30 '20 at 17:12
  • @AbdullahTahan did you select "new" zone? What didn't work? Perhaps have to try multiple zones before you find one that has available capacity. – Yev Guyduy Oct 21 '20 at 14:47
  • i had really stuck in that as we were using regional ip and was used in the mobile app so we need the same or new instance in that region but google didn't allow me todo that so that solution didn't work if i want to create new instance from snapshop to that region – Abdullah Tahan Oct 22 '20 at 02:45
11

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.

robsiemb
  • 6,157
  • 7
  • 32
  • 46
3

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.

David
  • 2,109
  • 1
  • 22
  • 27
1

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

Joe Silverstein
  • 406
  • 5
  • 7
0

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.

  • I just had this same issue with the same zone, my solution was to downgrade the number of CPUs from 2 --> 1. I tried all day with 2 CPUs and I just lowered to 1 CPU and it started without issue. I have GPU enabled. – rajan Sep 11 '19 at 05:47