- INFORMATION
-
gcloud alpha compute advice capacity-historyis not available in universe domainuniverse. - NAME
-
- gcloud alpha compute advice capacity-history - show historical data on Spot VMs preemption and price
- SYNOPSIS
-
-
gcloud alpha compute advice capacity-history--machine-type=MACHINE_TYPE--provisioning-model=PROVISIONING_MODEL--types=HISTORY_TYPE,[…] (--region=REGION|--zone=ZONE) [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(ALPHA)Show historical data on Spot VMs preemption and price.Use this command to retrieve historical data on Spot VM preemption and price for a specific machine type and location. By analyzing historical trends, you can choose configurations for creating new VM instances that increase stability or lower your costs.
- EXAMPLES
-
To check recent price history for
n2-standard-32Spot VMs inus-central1, run the following command:gcloud alpha compute advice capacity-history --provisioning-model=SPOT --machine-type=n2-standard-32 --types=PRICE --region=us-central1To check recent preemption and price history for
n2-standard-32Spot VMs inus-central1-a, run the following command:gcloud alpha compute advice capacity-history --provisioning-model=SPOT --machine-type=n2-standard-32 --types=PREEMPTION,PRICE --zone=us-central1-a - REQUIRED FLAGS
-
--machine-type=MACHINE_TYPE-
The machine type for the VM, such as
n2-standard-4. --provisioning-model=PROVISIONING_MODEL-
Specifies the provisioning model.
PROVISIONING_MODELmust be (only one value is supported):SPOT- Compute Engine may preempt a Spot VM whenever it needs capacity. Because Spot VMs don't have a guaranteed runtime, they come at a discounted price.
--types=HISTORY_TYPE,[…]-
Specifies types of the request query.
HISTORY_TYPEmust be one of:PREEMPTION- Historical preemption rates for Spot VMs, calculated as the number of Spot VMs preempted by Compute Engine divided by the total number of Spot VMs suspended, stopped, or deleted by users, or stopped or deleted resulting from preemption. The rate is expressed in decimal numbers. For more information about the preemption process, see: https://docs.cloud.google.com/compute/docs/instances/spot#preemption
PRICE- Historical Spot VMs prices in USD. For more information about Spot VMs pricing, see: https://docs.cloud.google.com/compute/docs/instances/spot#pricing
-
Exactly one of these must be specified:
--region=REGION-
Region of the advice to get history. If not specified, you might be prompted to
select a region (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
property:compute/regiongcloud config set compute/region REGIONA list of regions can be fetched by running:
gcloud compute regions listTo unset the property, run:
gcloud config unset compute/regionAlternatively, the region can be stored in the environment variable
.CLOUDSDK_COMPUTE_REGION --zone=ZONE-
The zone to query within the specified region, for example,
us-central1-a. If omitted, you will view history across all zones in the region.
- GCLOUD WIDE FLAGS
-
These flags are available to all commands:
--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.Run
$ gcloud helpfor details. - NOTES
- This command is currently in alpha and might change without notice. If this command fails with API permission errors despite specifying the correct project, you might be trying to access an API with an invitation-only early access allowlist.
gcloud alpha compute advice capacity-history
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 2026-04-07 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 2026-04-07 UTC."],[],[]]