gcloud compute commitments create COMMITMENT --plan=PLAN (--resources=[local-ssd=LOCAL-SSD],[memory=MEMORY],[vcpu=VCPU] --resources-accelerator=[count=COUNT],[type=TYPE]) [--auto-renew] [--custom-end-time=CUSTOM_END_TIME] [--merge-source-commitments=MERGE_SOURCE_COMMITMENTS] [--region=REGION] [--resource-manager-tags=[KEY=VALUE,…]] [--split-source-commitment=SPLIT_SOURCE_COMMITMENT] [--type=TYPE; default="general-purpose"] [--existing-reservation=[name=NAME],[zone=ZONE] | --reservations-from-file=PATH_TO_FILE | [--reservation=RESERVATION : --reservation-zone=RESERVATION_ZONE --accelerator=[count=COUNT],[type=TYPE] --local-ssd=[interface=INTERFACE],[size=SIZE] --machine-type=MACHINE_TYPE --min-cpu-platform=MIN_CPU_PLATFORM --require-specific-reservation --resource-policies=[KEY=VALUE,…] --vm-count=VM_COUNT --share-setting=SHARE_SETTING --share-with=SHARE_WITH,[SHARE_WITH,…]]] [GCLOUD_WIDE_FLAG …]
commitment-1
in the us-central1 region, with a
12-month plan,
9GB of memory and 4 vcpu cores, run:
gcloud compute commitments create commitment-1 --plan=12-month --resources=memory=9GB,vcpu=4 --region=us-central1COMMITMENT--plan=PLANPLAN must be one of:
12-month, 36-month.
--resources=[local-ssd=LOCAL-SSD],[memory=MEMORY],[vcpu=VCPU]memoryvcpulocal-ssd--resources-accelerator=[count=COUNT],[type=TYPE]counttypegcloud compute
accelerator-types list to learn about all available accelerator
types.
--auto-renew--custom-end-time=CUSTOM_END_TIME--merge-source-commitments=MERGE_SOURCE_COMMITMENTS--region=REGION
To avoid prompting when this flag is omitted, you can set the
property:
compute/region
gcloud 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/regionCLOUDSDK_COMPUTE_REGION.
--resource-manager-tags=[KEY=VALUE,…]--split-source-commitment=SPLIT_SOURCE_COMMITMENT--type=TYPE; default="general-purpose"memory-optimized indicates that the commitment
is for memory-optimized VMs. TYPE must be one of:
accelerator-optimized, accelerator-optimized-a3,
accelerator-optimized-a3-mega,
accelerator-optimized-a3-ultra,
accelerator-optimized-a4, compute-optimized,
compute-optimized-c2d, compute-optimized-c3,
compute-optimized-c3d, compute-optimized-h3,
compute-optimized-h4d, general-purpose,
general-purpose-c4, general-purpose-c4a,
general-purpose-c4d, general-purpose-e2,
general-purpose-n2, general-purpose-n2d,
general-purpose-n4, general-purpose-n4a,
general-purpose-n4d, general-purpose-t2d,
graphics-optimized, graphics-optimized-g4,
graphics-optimized-g4-vgpu, memory-optimized,
memory-optimized-m3, memory-optimized-m4,
memory-optimized-m4-6tb, memory-optimized-x4-1440-24t,
memory-optimized-x4-16tb,
memory-optimized-x4-1920-32t,
memory-optimized-x4-24tb, memory-optimized-x4-32tb,
memory-optimized-x4-480-6t,
memory-optimized-x4-480-8t,
memory-optimized-x4-960-12t,
memory-optimized-x4-960-16t, network-optimized-c4n,
storage-optimized-z3.
--existing-reservation=[name=NAME],[zone=ZONE]namezone--reservations-from-file=PATH_TO_FILE--reservation=RESERVATION--reservation-zone=RESERVATION_ZONEcompute/zone property isn't set, you might
be prompted to select a zone (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
property:
compute/zone
gcloud config set compute/zone ZONEA list of zones can be fetched by running:
gcloud compute zones listTo unset the property, run:
gcloud config unset compute/zoneCLOUDSDK_COMPUTE_ZONE.
--accelerator=[count=COUNT],[type=TYPE]counttypenvidia-tesla-k80 for nVidia Tesla K80) of
accelerator to attach to instances in the reservation. Use gcloud compute
accelerator-types list to learn about all available accelerator
types.
--local-ssd=[interface=INTERFACE],[size=SIZE]interfacescsi and nvme. SCSI is the default and is supported by
more guest operating systems. NVME may provide higher performance.
size--machine-type=MACHINE_TYPEcustom-number_of_CPUs-amount_of_memory-for example,
custom-32-29440.
--min-cpu-platform=MIN_CPU_PLATFORM--require-specific-reservation--reservation-affinity=specific can consume from this reservation.
--resource-policies=[KEY=VALUE,…]--vm-count=VM_COUNT--share-setting=SHARE_SETTINGSHARE_SETTING
must be one of:
localprojects--share-with=SHARE_WITH,[SHARE_WITH,…]--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 help for details.
gcloud alpha compute commitments creategcloud beta compute commitments creategcloud preview compute commitments create
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-07-21 UTC.