When you call a Compute Engine API that mutates a resource, Compute Engine adds an entry
to the list of operations. For example, when you make an update to a VM that
mutates (alters) data, or when a host event
occurs that changes the state of a VM, operations are created. This page
describes how you can view a list of Compute Engine operations by
using the Trusted Cloud console, the Google Cloud CLI,
or REST.
Remember that operations can take some time to complete, so you may find
incomplete operations while viewing. When you want to see the final status of
incomplete operations, repeatedly viewing operations is not recommended;
instead, you should wait for operations to be done.
Before you begin
Operation Retention Period
While querying operations, keep in mind that completed operations are
automatically removed from the database after a certain period.
Compute Engine retains completed operations for at least the minimum
retention period of 1 hour, and up to the maximum retention period of 14 days.
Although projects often observe a retention period for completed operations that
is longer than the minimum of 1 hour, depending on the additional retention
period is not recommended.
Note that the retention periods don't apply to operations deleted by the users
through Operations.delete
method.
Viewing operations
To view a list of operations for your project, perform the following steps:
Console
In the Trusted Cloud console, go to the Operations page.
Go to Operations
For more details on an operation, click the operation summary. For
example, to view the migration details for the my-instance
VM,
click the Automatically migrate an instance operation.
gcloud
To view a list of operations for your project
using gcloud compute
, use the operations list
sub-command.
To view the list of operations in a specified zone, add the --filter
flag.
gcloud compute operations list --filter="zone:(ZONE)"
Replace ZONE
with the zone where you want to view a list of
operations. For example, to view the list of operations in us-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 TIMESTAMP
systemevent-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 the global,
region, or zone level.
Live migration, VM stopping, and automatic restarts are all zone-level operations.
For zone operations, make a GET
request to the zoneOperations.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 this
output, 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 the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[[["\u003cp\u003eCompute Engine operations are logged when a resource is mutated, such as during VM updates or host events, which alter the state of a VM.\u003c/p\u003e\n"],["\u003cp\u003eOperations can be viewed using the Google Cloud console, the Google Cloud CLI (gcloud), or REST, and they may be incomplete upon initial viewing.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication is only needed for gcloud or REST usage, and the provided steps outline the necessary commands for both.\u003c/p\u003e\n"],["\u003cp\u003eCompleted operations are retained for a period ranging from a minimum of 1 hour to a maximum of 14 days, during which time they are available for viewing.\u003c/p\u003e\n"],["\u003cp\u003eTo view operations, you must specify the scope of the request as either global, region, or zone level using gcloud or REST.\u003c/p\u003e\n"]]],[],null,["# View Compute Engine operations\n\nLinux Windows\n\n*** ** * ** ***\n\nWhen you call a Compute Engine API that mutates a resource, Compute Engine adds an entry\nto the list of operations. For example, when you make an update to a VM that\nmutates (alters) data, or when a [host event](/compute/docs/instances/host-maintenance-overview)\noccurs that changes the state of a VM, operations are created. This page\ndescribes how you can view a list of Compute Engine operations by\nusing the [Google Cloud console](https://console.cloud.google.com/), the [Google Cloud CLI](/compute/docs/gcloud-compute),\nor [REST](/compute/docs/reference/rest/v1).\n\nRemember that operations can take some time to complete, so you may find\nincomplete operations while viewing. When you want to see the final status of\nincomplete operations, repeatedly viewing operations is not recommended;\ninstead, you should [wait for operations to be done](/compute/docs/api/best-practices#wait-for-operations).\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n ### REST\n\n\n To use the REST API samples on this page in a local development environment, you use the\n credentials you provide to the gcloud CLI.\n 1. [Install](/sdk/docs/install) the Google Cloud CLI. After installation, [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command: \n\n ```bash\n gcloud init\n ```\n 2. If you're using an external identity provider (IdP), you must first [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n\n\n For more information, see\n [Authenticate for using REST](/docs/authentication/rest)\n in the Google Cloud authentication documentation.\n\nOperation Retention Period\n--------------------------\n\nWhile querying operations, keep in mind that completed operations are\nautomatically removed from the database after a certain period.\n\nCompute Engine retains completed operations for at least the minimum\nretention period of 1 hour, and up to the maximum retention period of 14 days.\nAlthough projects often observe a retention period for completed operations that\nis longer than the minimum of 1 hour, depending on the additional retention\nperiod is not recommended.\n\nNote that the retention periods don't apply to operations deleted by the users\nthrough `Operations.delete` method.\n\nViewing operations\n------------------\n\nTo view a list of operations for your project, perform the following steps: \n\n### Console\n\n1. In the Google Cloud console, go to the **Operations** page.\n\n [Go to Operations](https://console.cloud.google.com/compute/operations)\n2. For more details on an operation, click the operation summary. For\n example, to view the migration details for the `my-instance` VM,\n click the **Automatically migrate an instance** operation.\n\n\n### gcloud\n\nTo view a list of operations for your project\nusing `gcloud compute`, use the [`operations list`](/sdk/gcloud/reference/compute/operations/list)\nsub-command.\n\nTo view the list of operations in a specified zone, add the `--filter` flag.\n\n\u003cbr /\u003e\n\n```\ngcloud compute operations list --filter=\"zone:(ZONE)\"\n```\n\n\u003cbr /\u003e\n\nReplace \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e with the zone where you want to view a list of\noperations. For example, to view the list of operations in `us-cental1-c`,\nrun the following command: \n\n```\ngcloud compute operations list --filter=\"zone:(us-central1-c)\"\n```\n\nThe output is similar to the following: \n\n```\nNAME TYPE TARGET HTTP_STATUS STATUS TIMESTAMP\nsystemevent-1543845145000... compute.instances.migrateOnHostMaintenance us-central1-c/instances/my-instance 200 DONE 2018-12-03T05:52:25.000-08:00\n```\n\n\u003cbr /\u003e\n\n### REST\n\nAPI requests for operations must be specified at either the [global](/compute/docs/reference/rest/v1/globalOperations/list),\n[region](/compute/docs/reference/rest/v1/regionOperations/list), or [zone](/compute/docs/reference/rest/v1/zoneOperations/list) level.\nLive migration, VM stopping, and automatic restarts are all zone-level operations.\n\nFor zone operations, make a `GET` request to the [`zoneOperations.list`](/compute/docs/reference/rest/v1/zoneOperations/list) method. \n\n```\nGET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/zones/ZONE/operations\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID for this request\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone for this request\n\nLeave the request body empty.\n\nThe following is a sample output for a zone operation request. In this\noutput, details for a host migration displays. \n\n```\n{\n \"kind\": \"compute#operation\",\n \"id\": \"3216798767364213712\",\n \"name\": \"systemevent-1543845145000-57c1e7574b840-a195b637-5ff74d9b\",\n \"zone\": \"https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c\",\n \"operationType\": \"compute.instances.migrateOnHostMaintenance\",\n \"targetLink\": \"https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/instances/my-instance\",\n \"targetId\": \"3070988523247098025\",\n \"status\": \"DONE\",\n \"statusMessage\": \"Instance migrated during Compute Engine maintenance.\",\n \"user\": \"system\",\n \"progress\": 100,\n \"insertTime\": \"2018-12-03T05:52:25.000-08:00\",\n \"startTime\": \"2018-12-03T05:52:25.000-08:00\",\n \"endTime\": \"2018-12-03T05:52:25.000-08:00\",\n \"selfLink\": \"https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-c/operations/systemevent-1543845145000-57c1e7574b840-a195b637-5ff74d9b\"\n}\n```"]]