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! Go to 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.
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.