1

I'm running into a problem starting my Google Cloud VM instance. I wanted to restart the instance so I hit the stop button but this was just the beginning of a big problem.

start failed with an error that the zone did not have enough capacity. Message:

The zone 'XXX' does not have enough resources available to fulfill the request. Try a different zone, or try again later.

I tried and retried till I decided to move it to another zone and ran:

gcloud compute instances move VM_NAME --destination-zone NEW_ZONE

I then get the error:

Instance cannot be moved while in state: TERMINATED

What am I supposed to do???

I'm assuming that this is a basic enough issue that there's a common way to solve for this.

Thanks

Edit: I have since managed to start the instance but would like to know what to do next time

tr33hous
  • 1,622
  • 1
  • 15
  • 26
  • 1
    see this post https://stackoverflow.com/questions/52684656/the-zone-does-not-have-enough-resources-available-to-fulfill-the-request-the-re/57433015#57433015 – Yev Guyduy May 30 '20 at 14:27

1 Answers1

-1

The correct solution depends on your criteria.

I assume you're using Preemptible instances for their cost economies but -- as you've seen, there's a price -- sometimes non-preemptible resources are given the priority and sometimes (more frequently than for regular cores) there are insufficient preemptible cores available.

While it's reasonable to want to, you cannot move stopped instances between zones in a region.

I think there are a few options:

  • Don't use Preemptible. You'll pay more but you'll get more flexibility.
  • Use Managed Instance Groups (MIGs) to maintain ~1 instance (in the region|zone)
  • (for completeness) consider using containers and perhaps Cloud Run or Kubernetes

You describe wanting to restart your instance. Perhaps this was because you made some changes to it. If this is the case, you may wish to consider treating your instances as more being more disposable.

When you wish to make changes to the workload:

  • IMPORTANT ensure you're preserving any important state outside of the instance
  • create a new instance (at this time, you will be able to find a zone with capacity for it)
  • once the new instance is running correctly, delete the prior version

NB Both options 2 (MIGs) and 3 (Cloud Run|Kubernetes) above implement this practice.

DazWilkin
  • 32,823
  • 5
  • 47
  • 88