gcloud compute reservations create

gcloud compute reservations create - create a Compute Engine reservation
gcloud compute reservations create RESERVATION (--machine-type=MACHINE_TYPE --vm-count=VM_COUNT : --accelerator=[count=COUNT],[type=TYPE] --local-ssd=[interface=INTERFACE],[size=SIZE] --min-cpu-platform=MIN_CPU_PLATFORM --require-specific-reservation) [--description=DESCRIPTION] [--zone=ZONE] [GCLOUD_WIDE_FLAG]
Create a Compute Engine reservation.
Name of the reservation to create.
Manage the specific SKU reservation properties to create This must be specified.
The type of machine (name only) which has a fixed number of vCPUs and a fixed amount of memory. This also includes specifying custom machine type following custom-number_of_CPUs-amount_of_memory pattern, e.g. custom-32-29440. This flag must be specified if any of the other arguments in this group are specified.
The number of VM instances that are allocated to this reservation. The value of this field must be an int in the range [1, 1000]. This flag must be specified if any of the other arguments in this group are specified.
Manage the configuration of the type and number of accelerator cards attached.
The number of accelerators to attach to each instance in the reservation.
The specific type (e.g. nvidia-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.
Manage the size and the interface of local SSD to use. See https://cloud.google.com/compute/docs/disks/local-ssd for more information.
The kind of disk interface exposed to the VM for this SSD. Valid values are scsi and nvme. SCSI is the default and is supported by more guest operating systems. NVME may provide higher performance.
The size of the local SSD in base-2 GB.
Optional minimum CPU platform of the reservation to create.
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=specific can consume from this reservation.
An optional description of the reservation to create.
Zone of the reservation to create. If not specified and the compute/zone property isn't set, you may be prompted to select a zone (interactive mode only).

To avoid prompting when this flag is omitted, you can set the compute/zone property:

gcloud config set compute/zone ZONE

A list of zones can be fetched by running:

gcloud compute zones list

To unset the property, run:

gcloud config unset compute/zone

Alternatively, the zone can be stored in the environment variable CLOUDSDK_COMPUTE_ZONE.

These flags are available to all commands: --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.

To create a Compute Engine reservation, run:
gcloud compute reservations create my-reservation  --zone=fake-zone --vm-count=1 --machine-type=n1-standard-1  --min-cpu-platform="Intel Haswell"
These variants are also available:
gcloud alpha compute reservations create
gcloud beta compute reservations create