- NAME
-
- gcloud alpha compute advice capacity - get capacity advice for Compute Engine resources
- SYNOPSIS
-
-
gcloud alpha compute advice capacity--provisioning-model=PROVISIONING_MODEL--size=SIZE--target-distribution-shape=TARGET_DISTRIBUTION_SHAPE(--instance-selection=INSTANCE_SELECTION--instance-selection-machine-types=[MACHINE_TYPE,…]) [--region=REGION] [--zones=[ZONE,…]] [GCLOUD_WIDE_FLAG …]
-
- DESCRIPTION
-
(ALPHA)Get capacity advice for Compute Engine resources.This command helps you view future resource availability for a specific number of VM instances, machine type, provisioning model, and zone. After you confirm resource availability, you can specify those configurations when you create VM instances. This action improves the success rate of your VM instance creation request.
- EXAMPLES
-
To check the availability of 100
n2-standard-32Spot VMs in any single zone in theus-central1region, run the following command:gcloud alpha compute advice capacity --region="us-central1" --provisioning-model="SPOT" --size=100 --instance-selection-machine-types="n2-standard-32" --target-distribution-shape="any-single-zone"To check the availability of 50 Spot VMs, allowing either
e2-standard-8ore2-standard-16machine types, distributed acrossus-central1-aandus-central1-b, run the following command:gcloud alpha compute advice capacity --region="us-central1" --provisioning-model="SPOT" --size=50 --instance-selection="name=my-selection,machine-type=e2-standard-8,machine-type=e2-standard-16" --target-distribution-shape="any" --zones="us-central1-a,us-central1-b" - REQUIRED FLAGS
-
--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.
--size=SIZE- The total number of VMs being requested in the capacity query.
--target-distribution-shape=TARGET_DISTRIBUTION_SHAPE-
Defines the distribution requirement for the requested VMs.
TARGET_DISTRIBUTION_SHAPEmust be one of:ANY- When you specify ANY for VM instance creation across multiple zones, you specify that you want to create your VM instances in one or more zones based on resource availability, and to use any unused, matching reservation in your project. Use ANY for batch workloads that don't require high availability.
ANY_SINGLE_ZONE- When you specify ANY_SINGLE_ZONE for VM instance creation, you specify that you want to create all VM instances in a single available zone. Compute Engine selects this zone based on resource availability and on any unused, matching reservation in your project. However, zonal resource availability constraints might prevent Compute Engine from creating all your requested VM instances. Use ANY_SINGLE_ZONE when the VM instances in your workloads need to frequently communicate among each other.
-
Specifies the machine types for which advice is being sought.
At least one of these must be specified:
--instance-selection=INSTANCE_SELECTION- Named selection of machine types. For example, --instance-selection="name=instance-selection-1,machine-type=e2-standard-8,machine-type=t2d-standard-8".
--instance-selection-machine-types=[MACHINE_TYPE,…]- Specifies a comma-separated list of preferred machine types for creating virtual machines.
- OPTIONAL FLAGS
-
--region=REGION-
Region of the resources to get advice on. 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 --zones=[ZONE,…]-
A comma-separated list of zones to query within the specified region, for
example,
us-central1-a,us-central1-b. If you omit this flag, then you view availability for your requested capacity 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
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-02-10 UTC.