Brandon
Brandon

Reputation: 14196

Why does Google Cloud Compute API consider a stopped instance a "TERMINATED" status?

Trying to understand what GCP's choice in terminology means - by comparison, in AWS, a terminated instance is gone forever, but a stopped instance can be restarted.

If you stop an instance in GCP console, the status returned by the GCP Compute API for that instance is TERMINATED, however, you can start the instance.

Is this a bug in the way GCP reports instance statuses, or is a TERMINATED status an indication that some resources have actually been terminated/deleted?

Upvotes: 4

Views: 1686

Answers (1)

Jeremy Edwards
Jeremy Edwards

Reputation: 14740

Terminated status is probably how it was when GCE became generally available.

Terminated status means that the VM instance is no longer running (no more writing to disk, no pings etc, it's powered off). The VM instance can be started again which means a new VM process is being created for it. This VM may be configured slightly different (example: different IP address - use static IPs if you want the same one). You are not billed for stopped instances.

VMs can be terminated for 3 reasons:

  • You stopped it.
  • There's some unexpected failure that happened before the VM could be live migrated.
  • If the VM is preemptible, it hit the 24 hour lifetime limit or was preempted.

Docs:

Upvotes: 2

Related Questions