mirror of
https://github.com/imjasonh/gcloud-help
synced 2026-07-08 18:45:13 +00:00
284 lines
12 KiB
Text
284 lines
12 KiB
Text
NAME
|
|
gcloud beta compute commitments create - create Compute Engine commitments
|
|
|
|
SYNOPSIS
|
|
gcloud beta 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]
|
|
[--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-sharing-policy=RESERVATION_SHARING_POLICY
|
|
--reservation-zone=RESERVATION_ZONE
|
|
--accelerator=[count=COUNT],[type=TYPE]
|
|
--local-ssd=[interface=INTERFACE],[size=SIZE]
|
|
--machine-type=MACHINE_TYPE
|
|
--maintenance-interval=MAINTENANCE_INTERVAL
|
|
--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 ...]
|
|
|
|
DESCRIPTION
|
|
(BETA) Create Compute Engine commitments.
|
|
|
|
EXAMPLES
|
|
To create a commitment called commitment-1 in the us-central1 region, with
|
|
a 12-month plan, 9GB of memory and 4 vcpu cores, run:
|
|
|
|
$ gcloud beta compute commitments create commitment-1 \
|
|
--plan=12-month --resources=memory=9GB,vcpu=4 \
|
|
--region=us-central1
|
|
|
|
POSITIONAL ARGUMENTS
|
|
COMMITMENT
|
|
Name of the commitment to create.
|
|
|
|
REQUIRED FLAGS
|
|
--plan=PLAN
|
|
Duration of the commitment. PLAN must be one of: 12-month, 36-month.
|
|
|
|
Manage the commitment for particular resources.
|
|
|
|
At least one of these must be specified:
|
|
|
|
--resources=[local-ssd=LOCAL-SSD],[memory=MEMORY],[vcpu=VCPU]
|
|
Resources to be included in the commitment. For details and examples
|
|
of valid specifications, refer to the custom machine type guide
|
|
(https://cloud.google.com/compute/docs/instances/creating-instance-with-custom-machine-type#specifications).
|
|
memory
|
|
The size of the memory, should include units (e.g. 3072MB or
|
|
9GB). If no units are specified, GB is assumed.
|
|
vcpu
|
|
The number of the vCPU cores.
|
|
local-ssd
|
|
The size of local SSD.
|
|
|
|
--resources-accelerator=[count=COUNT],[type=TYPE]
|
|
Manage the configuration of the type and number of accelerator cards
|
|
to include in the commitment.
|
|
count
|
|
The number of accelerators to include.
|
|
type
|
|
The specific type (e.g. nvidia-tesla-k80 for NVIDIA Tesla K80) of
|
|
the accelerator. Use gcloud compute accelerator-types list to
|
|
learn about all available accelerator types.
|
|
|
|
OPTIONAL FLAGS
|
|
--auto-renew
|
|
Enable auto renewal for the commitment.
|
|
|
|
--custom-end-time=CUSTOM_END_TIME
|
|
Specifies a custom future end date and extends the commitment's ongoing
|
|
term.
|
|
|
|
--merge-source-commitments=MERGE_SOURCE_COMMITMENTS
|
|
Creates the new commitment by merging the specified source commitments
|
|
and combining their resources.
|
|
|
|
--region=REGION
|
|
Region of the commitment to create. 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
|
|
compute/region property:
|
|
|
|
$ gcloud config set compute/region REGION
|
|
|
|
A list of regions can be fetched by running:
|
|
|
|
$ gcloud compute regions list
|
|
|
|
To unset the property, run:
|
|
|
|
$ gcloud config unset compute/region
|
|
|
|
Alternatively, the region can be stored in the environment variable
|
|
CLOUDSDK_COMPUTE_REGION.
|
|
|
|
--split-source-commitment=SPLIT_SOURCE_COMMITMENT
|
|
Creates the new commitment by splitting the specified source commitment
|
|
and redistributing the specified resources.
|
|
|
|
--type=TYPE; default="general-purpose"
|
|
Type of commitment. 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,
|
|
compute-optimized, compute-optimized-c2d, compute-optimized-c3,
|
|
compute-optimized-c3d, compute-optimized-h3, general-purpose,
|
|
general-purpose-c4, general-purpose-c4a, general-purpose-e2,
|
|
general-purpose-n2, general-purpose-n2d, general-purpose-n4,
|
|
general-purpose-t2d, graphics-optimized, memory-optimized,
|
|
memory-optimized-m3, memory-optimized-x4-16tb,
|
|
memory-optimized-x4-24tb, memory-optimized-x4-32tb,
|
|
storage-optimized-z3.
|
|
|
|
Manage the reservations to be created with the commitment.
|
|
|
|
At most one of these can be specified:
|
|
|
|
--existing-reservation=[name=NAME],[zone=ZONE]
|
|
Details of the existing on-demand reservation or auto-created future
|
|
reservation that you want to attach to your commitment. Specify a new
|
|
instance of this flag for every existing reservation that you want to
|
|
attach. The reservations must be in the same region as the
|
|
commitment.
|
|
name
|
|
The name of the reservation.
|
|
zone
|
|
The zone of the reservation. For example, to attach an existing
|
|
reservation named reservation-name in the zone reservation-zone,
|
|
use the following text:
|
|
--existing-reservation=name=reservation-name,zone=reservation-zone
|
|
|
|
--reservations-from-file=PATH_TO_FILE
|
|
Path to a YAML file of multiple reservations' configuration. Use a
|
|
full or relative path to a local file containing the value of
|
|
reservations.
|
|
|
|
Manage the reservation to be created with the commitment.
|
|
|
|
--reservation=RESERVATION
|
|
Name of the reservation to operate on.
|
|
|
|
This flag argument must be specified if any of the other arguments
|
|
in this group are specified.
|
|
|
|
Manage the properties of a reservation sharing policy to create
|
|
|
|
--reservation-sharing-policy=RESERVATION_SHARING_POLICY
|
|
The reservation sharing policy to use for this reservation.
|
|
RESERVATION_SHARING_POLICY must 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 this flag during creation, the default value is
|
|
DISALLOW_ALL.
|
|
|
|
--reservation-zone=RESERVATION_ZONE
|
|
Zone of the reservation to operate on. 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 specific SKU reservation properties to create.
|
|
|
|
--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=[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.
|
|
|
|
--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.
|
|
|
|
--maintenance-interval=MAINTENANCE_INTERVAL
|
|
Specifies how infrastructure upgrades should be applied to the
|
|
VM. MAINTENANCE_INTERVAL must be one of:
|
|
|
|
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.
|
|
RECURRENT
|
|
VMs receive infrastructure and hypervisor updates on a
|
|
periodic basis, minimizing the number of maintenance
|
|
operations (live migrations or terminations) on an individual
|
|
VM. This may mean a VM will take longer to receive an update
|
|
than if it was configured for AS_NEEDED. Security updates
|
|
will still be applied as soonas they are available. RECURRENT
|
|
is used for GEN3 and Sliceof Hardware VMs.
|
|
|
|
--min-cpu-platform=MIN_CPU_PLATFORM
|
|
Optional minimum CPU platform of the reservation to create.
|
|
|
|
--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,...]
|
|
The resource policies to include in this reservation. If you omit
|
|
this flag, no resource policies are added. You can specify any
|
|
string as the key, and specify the name of a resource policy as
|
|
the value.
|
|
|
|
--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].
|
|
|
|
Manage the properties of a shared reservation to create
|
|
|
|
--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.
|
|
|
|
--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 that this
|
|
reservation is shared with. List must contain 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 help for details.
|
|
|
|
NOTES
|
|
This command is currently in beta and might change without notice. These
|
|
variants are also available:
|
|
|
|
$ gcloud compute commitments create
|
|
|
|
$ gcloud alpha compute commitments create
|
|
|