gcloud beta compute reservations create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud beta compute reservations create - create a Compute Engine reservation
- SYNOPSIS
gcloud beta compute reservations createRESERVATION(--vm-count=VM_COUNT(--source-instance-template=SOURCE_INSTANCE_TEMPLATE| [--machine-type=MACHINE_TYPE:--accelerator=[count=COUNT],[type=TYPE]--local-ssd=[count=COUNT],[interface=INTERFACE],[size=SIZE]--min-cpu-platform=MIN_CPU_PLATFORM]) :--require-specific-reservation--resource-policies=[KEY=VALUE,…])[--description=DESCRIPTION][--reservation-sharing-policy=RESERVATION_SHARING_POLICY][--zone=ZONE][--delete-after-duration=DELETE_AFTER_DURATION|--delete-at-time=DELETE_AT_TIME][--share-setting=SHARE_SETTING--share-with=SHARE_WITH,[SHARE_WITH,…]][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(BETA)Create a Compute Engine reservation.- EXAMPLES
- To create a Compute Engine reservation by specifying VM properties using aninstance template, run:
gcloudbetacomputereservationscreatemy-reservation--vm-count=1--source-instance-template=example-instance-template--zone=fake-zoneTo create a Compute Engine reservation by directly specifying VM properties,run:
gcloudbetacomputereservationscreatemy-reservation--vm-count=1--machine-type=custom-8-10240--min-cpu-platform="Intel Haswell"--accelerator=count=2,type=nvidia-tesla-v100--local-ssd=size=375,interface=scsi--zone=fake-zone - POSITIONAL ARGUMENTS
RESERVATION- Name of the reservation to create.
- REQUIRED FLAGS
- Manage the SpecificSKU reservation properties.
This must be specified.
--vm-count=VM_COUNT- The number of VM instances that are allocated to this reservation. The value ofthis field must be an int in the range [1, 1000].
This flag argument must be specified if any of the other arguments in this groupare specified.
--require-specific-reservation- Indicates whether the reservation can be consumed by VMs with "any reservation"defined. If enabled, then only VMs that target this reservation by name using
--reservation-affinity=specificcan consume from this reservation. --resource-policies=[KEY=VALUE,…]- The resource policies to include in this reservation. If you omit this flag, noresource policies are added. You can specify any string as the key, and specifythe name of a resource policy as the value.
- Manage the instance properties for the SpecificSKU reservation.
Exactly one of these must be specified:
--source-instance-template=SOURCE_INSTANCE_TEMPLATE- The url of the instance template that will be used to populate the fields of thereservation. Instance properties can not be defined in addition to sourceinstance template.
- Define the individual instance properties for the SpecificSKU reservation.
--machine-type=MACHINE_TYPE- The type of machine (name only) that has a fixed number of vCPUs and a fixedamount of memory. You can also specify a custom machine type by using thepattern
custom-number_of_CPUs-amount_of_memory-for example,custom-32-29440.This flag argument must be specified if any of the other arguments in this groupare specified.
--accelerator=[count=COUNT],[type=TYPE]- Manage the configuration of the type and number of accelerator cards attached.
count- The number of accelerators to attach to each instance in the reservation.
type- The specific type (e.g.
nvidia-tesla-k80for nVidia Tesla K80) ofaccelerator to attach to instances in the reservation. Usegcloud computeaccelerator-types listto learn about all available acceleratortypes.
--local-ssd=[count=COUNT],[interface=INTERFACE],[size=SIZE]- Manage the size and the interface of local SSD to use. Seehttps://cloud.google.com/compute/docs/disks/local-ssdfor more information.
interface- The kind of disk interface exposed to the VM for this SSD. Valid values are
scsiandnvme. SCSI is the default and is supported bymore guest operating systems. NVME may provide higher performance. size- The size of the local SSD in base-2 GB.
count- The number of local SSD to use per VM. If you don't specify this argument, thenthe default value is 1.
--min-cpu-platform=MIN_CPU_PLATFORM- Optional minimum CPU platform of the reservation to create.
- Manage the SpecificSKU reservation properties.
- OPTIONAL FLAGS
--description=DESCRIPTION- An optional description of the reservation to create.
--reservation-sharing-policy=RESERVATION_SHARING_POLICY- The reservation sharing policy to use for this reservation.
RESERVATION_SHARING_POLICYmust be one of:ALLOW_ALL- The reservation can be shared with Google Cloud services.
DISALLOW_ALL- The reservation won't be shared with Google Cloud services. If you omit thisflag during creation, the default value is DISALLOW_ALL.
--zone=ZONE- Zone of the reservation to create. If not specified and the
property isn't set, you mightbe prompted to select a zone (interactive mode only).compute/zoneTo avoid prompting when this flag is omitted, you can set the
property:compute/zonegcloudconfigsetcompute/zoneZONEA list of zones can be fetched by running:
gcloudcomputezoneslistTo unset the property, run:
gcloudconfigunsetcompute/zoneAlternatively, the zone can be stored in the environment variable
.CLOUDSDK_COMPUTE_ZONE - Manage auto-delete properties for reservations.
At most one of these can be specified:
--delete-after-duration=DELETE_AFTER_DURATION- Automatically deletes the reservations after a specified number of days, hours,minutes, or seconds from its creation. For example, specify 30m for 30 minutes,or 1d2h3m4s for 1 day, 2 hours, 3 minutes, and 4 seconds. For more information,see $gcloud topicdatetimes.
--delete-at-time=DELETE_AT_TIME- Automatically deletes the reservation at a specific time from its creation. Thespecified time must be an RFC3339 timestamp, which must be formatted as"YYYY-MM-DDTHH:MM:SSZ" where YYYY = year, MM = month, DD = day, HH = hours, MM =minutes, SS = seconds, and Z = time zone in Coordinated Universal Time (UTC).For example, specify 2021-11-20T07:00:00Z.
- Manage the properties of a shared reservation.
--share-setting=SHARE_SETTING- The projects that can use the reservation.
SHARE_SETTINGmust be one of:local- Only your project can use the reservation. This is the default value.
projects- Your project and up to 100 other projects within your project's organization canuse the reservation. If you specify this value, then you must also include the--share-with flag in the command.
--share-with=SHARE_WITH,[SHARE_WITH,…]- If this reservation is shared (--share-setting=projects), then specify acomma-separated list of projects to share the reservation with. List projectsusing project IDs or project numbers.
- 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 beta and might change without notice. Thesevariants are also available:
gcloudcomputereservationscreategcloudalphacomputereservationscreate
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-05-07 UTC.