Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to check that GCE Instance is being deleted

Is there a way using gcloud or http://metadata.google.internal/ to check that GCE instance is in state "is being deleted" or "is being verified"?

Solved Solved
0 2 836
1 ACCEPTED SOLUTION

Thanks. I found better solution here: https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups

gcloud compute instance-groups managed list-instances gives output with column "ACTION" and there are statuses like NONE, VERIFYING, DELETING.

View solution in original post

2 REPLIES 2


Is there a way … to check that a GCE instance is in state "is being deleted" …?

Yes, but you would only have between 30 and +90 seconds to see if there are instances being deleted, as normal instances have a shutdown period that usually lasts at least 90 seconds, but it could be l....

To list all VMs and their statuses, use the following command:
gcloud compute instances list

To describe the status of a single instance, use this command:
gcloud compute instances describe example-instance

Thanks. I found better solution here: https://cloud.google.com/compute/docs/instance-groups/rolling-out-updates-to-managed-instance-groups

gcloud compute instance-groups managed list-instances gives output with column "ACTION" and there are statuses like NONE, VERIFYING, DELETING.