Is gcp removed terminated vm logs?

610 Views Asked by At

Is GCP Vm logs are deleted after termination of vm?

I was running a GCE sopt vm with MIG(Managed Instance Group). My VM instance terminated. When i check logs of terminated Vm. I am not able to see logs of it.

1

There are 1 best solutions below

0
On BEST ANSWER

You can check Audit log retention periods in this link.

In my case I was still able to see the terminated spot VM logs in logging for the last 60 days.

You can use the query below to view the logs of the terminated spot VM instance.

Replace the PROJECT_ID with your project id:

resource.type="gce_instance"
projects/PROJECT_ID/logs/cloudaudit.googleapis.com%2Fsystem_event

Then find the log entries with a similar line or statement below:

[email protected] Instance was preempted.

You can read this link for more information about "System Event audit logs"