gcloud compute sole-tenancy node-templates create

NAME
gcloud compute sole-tenancy node-templates create - create a Compute Engine node template
SYNOPSIS
gcloud compute sole-tenancy node-templates createNAME(--node-requirements=[localSSD=LOCALSSD],[memory=MEMORY],[vCPU=VCPU]    |--node-type=NODE_TYPE)[--accelerator=[count=COUNT],[type=TYPE]][--cpu-overcommit-type=CPU_OVERCOMMIT_TYPE][--description=DESCRIPTION][--disk=[count=COUNT],[size=SIZE],[type=TYPE]][--node-affinity-labels=[KEY=VALUE,…]][--region=REGION][--server-binding=SERVER_BINDING; default="restart-node-on-any-server"][GCLOUD_WIDE_FLAG]
DESCRIPTION
Create a Compute Engine node template.
EXAMPLES
To create a node template of typen1-node-96-624, run:
gcloudcomputesole-tenancynode-templatescreatemy-node-template--node-type=n1-node-96-624
POSITIONAL ARGUMENTS
NAME
Name of the node templates to operate on.
REQUIRED FLAGS
Exactly one of these must be specified:
--node-requirements=[localSSD=LOCALSSD],[memory=MEMORY],[vCPU=VCPU]
The requirements for nodes. Google Compute Engine will automatically choose anode type that fits the requirements on Node Group creation. If multiple nodetypes match your defined criteria, the NodeType with the least amount of eachresource will be selected. You can specify 'any' to indicate any non-zero valuefor a certain resource.

The following keys are allowed:

vCPU
The number of committed cores available to the node.
memory
The amount of memory available to the node. This value should include unit (eg.3072MB or 9GB). If no units are specified,MB is assumed.
localSSD
Optional. The amount of SSD space available on the node. This value shouldinclude unit (eg. 3072MB or 9GB). If no units are specified,GB isassumed. If this key is not specified, local SSD is unconstrained.
--node-type=NODE_TYPE
The node type to use for nodes in node groups using this template. The type of anode determines what resources are available to instances running on the node.

See the following for more information:

gcloudcomputesole-tenancynode-typeslist
OPTIONAL FLAGS
--accelerator=[count=COUNT],[type=TYPE]
Attaches accelerators (e.g. GPUs) to the node template.
type
The specific type (e.g. nvidia-tesla-k80 for nVidia Tesla K80) of accelerator toattach to the node template. Use 'gcloud compute accelerator-types list' tolearn about all available accelerator types.
count
Number of accelerators to attach to each node template. The default value is 1.
--cpu-overcommit-type=CPU_OVERCOMMIT_TYPE
CPU overcommit type for nodes created based on this template. To overcommit CPUson a VM, set --cpu-overcommit-type equal to either standard or none, and thenwhen creating a VM, specify a value for the --min-node-cpu flag. Lower valuesfor --min-node-cpu specify a higher overcommit ratio, that is, proportionallymore vCPUs in relation to physical CPUs. You can only overcommit CPUs on VMsthat are scheduled on nodes that support it.CPU_OVERCOMMIT_TYPE must be one of:enabled,none.
--description=DESCRIPTION
An optional description of this resource.
--disk=[count=COUNT],[size=SIZE],[type=TYPE]
Option to specify disk properties. It is mutually exclusive with'--node-requirements=[localSSD=LOCALSSD]' but'--node-requirements=[memory=MEMORY],[vCPU=VCPU],any' are still available.
type
Specifies the desired disk type on the node. This disk type must be a localstorage type. This should be the name of the disk type. Currently onlylocal-ssd is allowed.
size
The size of the disk in GiB. Currently you can specify only 375 GiB or no valueat all.
count
Specifies the number of such disks. Set to16 or24.
--node-affinity-labels=[KEY=VALUE,…]
Labels to use for node affinity, which will be used in instance scheduling. Thiscorresponds to the--node-affinity flag oncompute instancescreate andcompute instance-templates create.
--region=REGION
Region of the node templates to operate on. If not specified, you might beprompted to select a region (interactive mode only).

To avoid prompting when this flag is omitted, you can set thecompute/region property:

gcloudconfigsetcompute/regionREGION

A list of regions can be fetched by running:

gcloudcomputeregionslist

To unset the property, run:

gcloudconfigunsetcompute/region

Alternatively, the region can be stored in the environment variableCLOUDSDK_COMPUTE_REGION.

--server-binding=SERVER_BINDING; default="restart-node-on-any-server"
The server binding policy for nodes using this template, which determines wherethe nodes should restart following a maintenance event.SERVER_BINDING must be one of:
restart-node-on-any-server
Nodes using this template will restart on any physical server following amaintenance event.
restart-node-on-minimal-servers
Nodes using this template will restart on the same physical server following amaintenance event, instead of being live migrated to or restarted on a newphysical server. This means that VMs on such nodes will experience outages whilemaintenance is applied. This option may be useful if you are using softwarelicenses tied to the underlying server characteristics such as physical socketsor cores, to avoid the need for additional licenses when maintenance occurs.

Note that in some cases, Google Compute Engine may need to move your VMs to anew underlying server. During these situations your VMs will be restarted on anew physical server and assigned a new sole tenant physical server ID.

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
These variants are also available:
gcloudalphacomputesole-tenancynode-templatescreate
gcloudbetacomputesole-tenancynode-templatescreate

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.