gcloud alpha compute reservations create - create a Compute Engine reservation
gcloud alpha compute reservations create RESERVATION (--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] --maintenance-freeze-duration=MAINTENANCE_FREEZE_DURATION --maintenance-interval=MAINTENANCE_INTERVAL --min-cpu-platform=MIN_CPU_PLATFORM]) : --require-specific-reservation --resource-policies=[KEY=VALUE,...]) [--description=DESCRIPTION] [--zone=ZONE] [--share-setting=SHARE_SETTING --share-with=SHARE_WITH,[SHARE_WITH,...]] [GCLOUD_WIDE_FLAG ...]
(ALPHA) Create a Compute Engine reservation.
To create a Compute Engine reservation by specifying VM properties using an instance template, run:
$ gcloud alpha compute reservations create my-reservation \ --vm-count=1 \ --source-instance-template=example-instance-template \ --zone=fake-zone
To create a Compute Engine reservation by directly specifying VM properties, run:
$ gcloud alpha compute reservations create my-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
- RESERVATION
Name of the reservation to create.
- 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 of this field must be an int in the range [1, 1000].
This flag argument must be specified if any of the other arguments in this group are 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=specific can consume from this reservation.
- --resource-policies=[KEY=VALUE,...]
Specify if this is reservation with resource policy. If you omit this flag, no resource policy will be added to this reservation.
- 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 the reservation. Instance properties can not be defined in addition to source instance 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 fixed amount of memory. You can also specify a custom machine type by using the pattern 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 group are 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-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=[count=COUNT],[interface=INTERFACE],[size=SIZE]
Manage the size and the interface of local SSD to use. See https://cloud.google.com/compute/docs/disks/local-ssd for more information.
- interface
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.
- size
The size of the local SSD in base-2 GB.
- count
The number of local SSD to use per VM. Default value is 1.
- --maintenance-freeze-duration=MAINTENANCE_FREEZE_DURATION
Specifies the amount of hours after instance creation where the instance won't be scheduled for maintenance, e.g. 4h, 2d6h. See $ gcloud topic datetimes for information on duration formats.
- --maintenance-interval=MAINTENANCE_INTERVAL
Specifies how infrastructure upgrades should be applied to the VM. MAINTENANCE_INTERVAL must be (currently only one value is supported):
- PERIODIC
VMs receive infrastructure and hypervisor updates on a periodic basis, minimizing the number of maintenance operations (live migrations or terminations) on an individual VM. Security updates will still be applied as soon as they are available.
- --min-cpu-platform=MIN_CPU_PLATFORM
Optional minimum CPU platform of the reservation to create.
- --description=DESCRIPTION
An optional description of the reservation to create.
- --zone=ZONE
Zone of the reservation to create. If not specified and the compute/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 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.
- Manage the properties of a shared reservation.
- --share-setting=SHARE_SETTING
Specify if this reservation is shared, and if so, the type of sharing. If you omit this flag, this value is local (not shared) by default. SHARE_SETTING must be one of: local, projects, folders.
- --share-with=SHARE_WITH,[SHARE_WITH,...]
If this reservation is shared (--share-setting is not local), provide a list of all of the specific projects or folders that this reservation is shared with. List must contain project IDs or project numbers or folder IDs.
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 help for details.
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. These variants are also available:
$ gcloud compute reservations create
$ gcloud beta compute reservations create