0

In GCP Compute Engine, after changing a VM's machine type from for example, from e2-medium-2 to e2-standard-4, is there a way to list exactly when the machine type was changed from which type to which type.

Maybe if there is some kind of way to list the change events that would be helpful for audit purposes.

Thank you

I tried to check in the gcloud command interface and cloud logging but unable find machine type update events.

bpg168
  • 15
  • 1
  • 6
  • 1
    Google Cloud Audit Logging records events such as metadata changes to resources. https://cloud.google.com/logging/docs/audit#admin-activity – John Hanley Dec 19 '22 at 17:51
  • hi, @JohnHanley yep it works.. (sorry for delays :pray) Can you maybe post this as answer, I will accept :smile – bpg168 Jan 04 '23 at 11:06
  • The log explorer query could be,`protoPayload.request.@type="type.googleapis.com/compute.instances.setMachineType"`. In the log entry, there is a `protoPayload.request.machineType`, example value is, `projects//zones/us-central1-a/machineTypes/e2-micro`. However in the single log entry it is not possible to find the previous machine type. So we need to find the previous log entries for `setMachineType` to get chronological events. For the first ever configuration, we need to find the create event, query like, `protoPayload.methodName="beta.compute.instances.insert"`. – bpg168 Jan 04 '23 at 13:32

0 Answers0