View Compute Engine operations

Linux Windows

When you call a Compute Engine API that mutates a resource, Compute Engine adds an entryto the list of operations. For example, when you make an update to a VM thatmutates (alters) data, or when ahost eventoccurs that changes the state of a VM, operations are created. This pagedescribes how you can view a list of Compute Engine operations byusing theGoogle Cloud console, theGoogle Cloud CLI,orREST.

Remember that operations can take some time to complete, so you may findincomplete operations while viewing. When you want to see the final status ofincomplete operations, repeatedly viewing operations is not recommended;instead, you shouldwait for operations to be done.

Before you begin

Operation Retention Period

While querying operations, keep in mind that completed operations areautomatically removed from the database after a certain period.

Compute Engine retains completed operations for at least the minimumretention period of 1 hour, and up to the maximum retention period of 14 days.Although projects often observe a retention period for completed operations thatis longer than the minimum of 1 hour, depending on the additional retentionperiod is not recommended.

Note that the retention periods don't apply to operations deleted by the usersthroughOperations.delete method.

Viewing operations

To view a list of operations for your project, perform the following steps:

Console

  1. In the Google Cloud console, go to theOperations page.

    Go to Operations

  2. For more details on an operation, click the operation summary. Forexample, to view the migration details for themy-instance VM,click theAutomatically migrate an instance operation.

The operations page showing a live migration.Live migration details.

gcloud

To view a list of operations for your projectusinggcloud compute, use theoperations listsub-command.

To view the list of operations in a specified zone, add the--filter flag.

gcloud compute operations list --filter="zone:(ZONE)"

ReplaceZONE with the zone where you want to view a list ofoperations. For example, to view the list of operations inus-cental1-c,run the following command:

gcloud compute operations list --filter="zone:(us-central1-c)"

The output is similar to the following:

NAME                            TYPE                                        TARGET                                HTTP_STATUS  STATUS  TIMESTAMPsystemevent-1543845145000...    compute.instances.migrateOnHostMaintenance  us-central1-c/instances/my-instance   200          DONE    2018-12-03T05:52:25.000-08:00

REST

API requests for operations must be specified at either theglobal,region, orzone level.Live migration, VM stopping, and automatic restarts are all zone-level operations.

For zone operations, make aGET request to thezoneOperations.list method.

GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/operations

Replace the following:

  • PROJECT_ID: the project ID for this request
  • ZONE: the zone for this request

Leave the request body empty.

The following is a sample output for a zone operation request. In thisoutput, details for a host migration displays.

{ "kind": "compute#operation", "id": "3216798767364213712", "name": "systemevent-1543845145000-57c1e7574b840-a195b637-5ff74d9b", "zone": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c", "operationType": "compute.instances.migrateOnHostMaintenance", "targetLink": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/instances/my-instance", "targetId": "3070988523247098025", "status": "DONE", "statusMessage": "Instance migrated during Compute Engine maintenance.", "user": "system", "progress": 100, "insertTime": "2018-12-03T05:52:25.000-08:00", "startTime": "2018-12-03T05:52:25.000-08:00", "endTime": "2018-12-03T05:52:25.000-08:00", "selfLink": "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/operations/systemevent-1543845145000-57c1e7574b840-a195b637-5ff74d9b"}

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-09 UTC.