gcloud alpha compute tpus tpu-vm create Stay organized with collections Save and categorize content based on your preferences.
- NAME
- gcloud alpha compute tpus tpu-vm create - create a new Cloud TPU VM node
- SYNOPSIS
gcloud alpha compute tpus tpu-vm create(TPU:--zone=ZONE)--version=VERSION[--async][--autocheckpoint-enabled][--boot-disk=[KEY=VALUE,…]][--data-disk=[mode=MODE],[source=SOURCE]][--description=DESCRIPTION][--image=IMAGE][--internal-ips][--labels=[KEY=VALUE,…]][--metadata=[KEY=VALUE,…]][--metadata-from-file=[KEY=VALUE,…]][--network=NETWORK; default="default"][--preemptible][--provisioning-model=PROVISIONING_MODEL][--queue-count=QUEUE_COUNT][--range=RANGE][--reservation=RESERVATION][--reserved][--scopes=[SCOPES,…]][--service-account=SERVICE_ACCOUNT][--shielded-secure-boot][--spot][--subnetwork=SUBNETWORK][--tags=[TAGS,…]][--accelerator-type=ACCELERATOR_TYPE; default="v2-8" |--topology=TOPOLOGY--type=TYPE][GCLOUD_WIDE_FLAG …]
- DESCRIPTION
(ALPHA)Create a new Cloud TPU VM node.- EXAMPLES
- To create a TPU VM node with ID
my-tpuin the default user project,network and compute/zone (with other defaults supplied by API), run: To create a TPU VM node in a specific network, run:gcloudalphacomputetpustpu-vmcreatemy-tpugcloudalphacomputetpustpu-vmcreatemy-tpu--zone=us-central1-a--network=my-tf-network--description='My TPU VM'--version='v2-alpha'To create a small TPU VM v2 pod, run:
gcloudalphacomputetpustpu-vmcreatemy-tpu--zone=us-central1-a--accelerator-type='v2-32'--description='My TPU VM'--version='v2-alpha' - POSITIONAL ARGUMENTS
- Tpu resource - Name of the Cloud TPU VM node to create. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
To set the
projectattribute:- provide the argument
tpuon the command line with a fully specifiedname; - provide the argument
--projecton the command line; - set the property
core/project.
This must be specified.
TPU- ID of the tpu or fully qualified identifier for the tpu.
To set the
tpuattribute:- provide the argument
tpuon the command line.
This positional argument must be specified if any of the other arguments in thisgroup are specified.
- provide the argument
--zone=ZONE- Zone of the Cloud TPU.
If not specified, will use
defaultcompute/zone.To set thezoneattribute:- provide the argument
tpuon the command line with a fully specifiedname; - provide the argument
--zoneon the command line; - set the property
compute/zone.
- provide the argument
- provide the argument
- Tpu resource - Name of the Cloud TPU VM node to create. The arguments in thisgroup can be used to specify the attributes of this resource. (NOTE) Someattributes are not given arguments in this group but can be set in other ways.
- REQUIRED FLAGS
--version=VERSION- Runtime version for the TPU, such as
2.3.For a list of available versions run:
- OPTIONAL FLAGS
--async- Return immediately, without waiting for the operation in progress to complete.
--autocheckpoint-enabled- If specified, the TPU node is created with the Autocheckpoint feature enabled.
--boot-disk=[KEY=VALUE,…]- Specifies the boot disk configuration.
gcloudalphacomputetpustpu-vmcreate--boot-diskconfidential-compute=True,kms-key=<full_kms_key_name_here>The following keys are allowed:
confidential-compute- Create the boot disk in confidential compute mode. CMEK layer is required.
kms-key- Specifies the fully qualified Cloud KMS cryptokey name which will be used toprotect the disk. KMS cryptokey name format:projects/<kms-project>/locations/<kms-location>/keyRings/<kms-keyring>/cryptoKeys/<key-name>
--data-disk=[mode=MODE],[source=SOURCE]- Additional data disks for the TPU VM.
This flag must be repeated to provide multiple data disks. For example:
gcloudalphacomputetpustpu-vmcreate--data-disksource=projects/my-project/zones/us-central1-c/disks/my-disk,mode=read-onlyThe following keys are allowed:
source- Specifies the full path to an existing disk. Required. The disk must be in thesame zone.
mode- Specifies the mode in which to attach this disk. Valid options are 'read-write','read-only'. If not specified, the default is 'read-write'.
--description=DESCRIPTION- Text description of the TPU.
--image=IMAGE- Specifies the full URI of the machine image to use for creating the TPU VM'sboot disk. If specified, this will override the boot image that would normallybe used by the specified
--runtime-version. --internal-ips- Indicate that the IP addresses for the node should be internal. The default isthat external IP addresses will be associated with the TPU workers.
--labels=[KEY=VALUE,…]- Resource labels to represent user-provided metadata. Seehttps://cloud.google.com/compute/docs/labeling-resourcesfor details.
--metadata=[KEY=VALUE,…]- List of comma-separated metadata key-value pairs for the Cloud TPU VM node.Example:
--metadata='key1=value1,key2=value2' --metadata-from-file=[KEY=VALUE,…]- Same as
--metadataexcept the value for the entry will be read froma local file. Example:--metadata-from-file='key1=value1.txt' --network=NETWORK; default="default"- Network that this TPU will be a part of.
--preemptible- If provided, the TPU will be preemptible and time-limited. It may be preemptedto free up resources for standard TPUs, and will only be able to run for alimited amount of time.
Preemptible TPUs cannot be restarted.
--provisioning-model=PROVISIONING_MODEL- The provisioning model of the TPU node. One of [standard, spot,reservation-bound]. Setting
--provisioning-model=spotisfunctionally equivalent to setting--spot. --queue-count=QUEUE_COUNT- Specifies the networking queue count for TPU VM instances. Both Rx and Tx queueswill be set to this number. If it's not specified, a default queue count will beassigned. For Virtio-net, each interface will get min(floor(#vCPU / #vNIC), 32)queues. For gVNIC, each interface will get min(floor(#vCPU / #vNIC / 2), 16)queues.
--range=RANGE- CIDR Range for the TPU.
The IP range that the TPU will select an IP address from. Must be in CIDRnotation and a
/29range, for example192.168.0.0/29.Errors will occur if the CIDR range has already been used for a currentlyexisting TPU, the CIDR range conflicts with any networks in the user's providednetwork, or the provided network is peered with another network that is usingthat CIDR range. --reservation=RESERVATION- The name of the reservation. This can either be the full name or just the name.However, a full name is required if the reservation is not in the defaultproject.
Full reservation name format is:
projects/<project>/reservations/<reservation-name>
--reserved- When specified, will attempt to create the TPU node under reservations made inthe current project. The reservations can be made separately but used inaggregated form. i.e., the user can make a reservation of 128 V2 TPUs and lateron make another reservation of 128 V2 TPUs then creates a v2-256 TPU instance.If there exists no reservation or not sufficient amount of reserved cores underthe project, the request will fail due to lack of capacity.
--scopes=[SCOPES,…]- List of comma-separated scopes to be made available for the service account.
--service-account=SERVICE_ACCOUNT- Email address of the service account. If empty, default Google Compute Engineservice account will be used.
--shielded-secure-boot- Specifies that the TPU instances are created with secure boot enabled. Thisimplicitly makes them Shielded VM instances.
--spot- If specified, create this VM as a spot VM. Spot VMs make unused capacityavailable at highly discounted rates. Spot VMs may be preempted at any time ifthe capacity is needed, but unless preempted there is no limit on runtimeduration. Spot VM TPUs cannot be restarted, and must be recreated again.
--subnetwork=SUBNETWORK- Subnetwork that this TPU will be a part of.
--tags=[TAGS,…]- Tags to apply to the TPU Node. Tags are used to identify valid sources ortargets for network firewalls. Seehttps://cloud.google.com/vpc/docs/add-remove-network-tagsfor more details.
- Specify a TPU node in either chips or cores
At most one of these can be specified:
- Core based TPU configuration
--accelerator-type=ACCELERATOR_TYPE; default="v2-8"- TPU accelerator type for the TPU. If not specified, this defaults to
v2-8.For a list of available accelerator types run:
- Chip based TPU configuration
--topology=TOPOLOGY- Chip topology for TPU.
This flag argument must be specified if any of the other arguments in this groupare specified.
--type=TYPE- Type of TPU.
TYPEmust be one of:v2,v3,v4,v5litepod,v5p,v6e.This flag argument must be specified if any of the other arguments in this groupare specified.
- Core based TPU configuration
- 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. - API REFERENCE
- This command uses the
tpu/v2alpha1API. The full documentation forthis API can be found at:https://cloud.google.com/tpu/ - NOTES
- This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. This variant is also available:
gcloudcomputetpustpu-vmcreate
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-09-16 UTC.