How to launch a TPU VM on Google Cloud

Hey everyone,

Navigating the TPU landscape on Compute Engine can be tricky with different machine type naming conventions, chip allocations, and behind-the-scenes OS provisioning.

Below is an end-to-end breakdown covering machine types, how the dynamic first-boot works, zonal availability, and a walkthrough deploying a workload (OpenClaw).


1. TPU Machine Types & Chip Allocation

TPU instances define machine types based on hardware generations and chip counts:

  • v6e (Trillium / AMD EPYC host):

    • ct6e-standard-1t (1 TPU chip)

    • ct6e-standard-4t (4 TPU chips)

    • ct6e-standard-8t (8 TPU chips)

  • v5e (AMD EPYC host):

    • ct5l-hightpu-1t, ct5l-hightpu-4t, ct5l-hightpu-8t

    • ct5lp-hightpu-1t, ct5lp-hightpu-4t, ct5lp-hightpu-8t

  • v5p (Intel Xeon host):

    • ct5p-hightpu-4t (4 TPU chips)
  • TPU7x (Ironwood / Intel Xeon host):

    • tpu7x-standard-4t (4 TPU chips)
  • Legacy / Unsupported Types:

    • ct3-hightpu-4t, ct3p-hightpu-4t (No longer supported)

2. Under the Hood: The Dynamic First-Boot Architecture

The modern Ubuntu TPU images are designed to provide a completely hands-off setup:

  1. Pre-installation: Packages and ML-enabling libraries are pre-staged directly on the disk image during build time.

  2. Unified Base Images: A unified base image covers multiple TPU generations under the hood, but images are published under clear target names/tags for usability.

  3. Dynamic First-Boot (Cloud-init): When an instance boots for the first time:

    • An init service reads platform and hardware metadata to identify the exact TPU generation.

    • It dynamically shuffles and applies the appropriate pre-installed configuration files.

  4. Persistence: Once applied, the configuration persists to disk. Subsequent boots skip this discovery phase for fast start times.

  5. GKE Considerations: While GKE is moving toward these new Ubuntu TPU images, container runtimes like containerd, runc, and specific orchestration packages must be added or layered on top.


3. Quick Reference: Zonal Availability

Availability varies depending on generation:

Machine Family Primary Zones
tpu7x-standard-4t europe-west2-a, us-central1-c
ct6e-standard-[1t, 4t, 8t] asia-east1-c, asia-northeast1-b, asia-south1-[b,c], asia-southeast1-b, europe-west4-a, southamerica-east1-c, southamerica-west1-a, us-central1-[a,b,c], us-east1-d, us-east4-[a,b], us-east5-[a,b,c], us-west1-c
ct5p-hightpu-4t europe-west1-[b,c,d], europe-west4-b, us-central1-a, us-east1-d, us-east5-[a,b,c], us-south1-a
ct5lp-hightpu-[1t, 4t, 8t] Broad availability across asia-east1, asia-northeast1, asia-southeast1, europe-north1, europe-west1/3/4, northamerica-northeast1, southamerica-west1, us-central1, us-east1/4/5, us-south1, us-west1/4
ct5l-hightpu-[1t, 4t, 8t] europe-west4-b, us-central1-a

4. Hands-on Tutorial: Launching a TPU VM & Setting up OpenClaw

Here is an example spinning up a ct5lp-hightpu-1t instance using standard Ubuntu Noble (24.04) with FLEX_START provisioning.

Step 1: Create the Instance

gcloud alpha compute instances create openclaw-gateway \
    --project=ubuntu-os-cloud-testing \
    --zone=us-west4-a \
    --machine-type=ct5lp-hightpu-1t \
    --image-project=ubuntu-os-cloud \
    --image=ubuntu-2404-noble-amd64-v20260225 \
    --provisioning-model=FLEX_START \
    --max-run-duration=2h \
    --instance-termination-action=DELETE \
    --on-host-maintenance=TERMINATE \
    --metadata=VmDnsSetting=ZonalOnly

Step 2: SSH into the Instance

gcloud compute ssh openclaw-gateway --zone=us-west4-a

Step 3: Install Docker & Compose

Run the following inside the VM:

sudo apt-get update
sudo apt-get install -y git curl ca-certificates
curl -fsSL https://get.docker.com | sudo sh
sudo usermod -aG docker $USER

Log out and reconnect for group permissions to take effect:

exit
gcloud compute ssh openclaw-gateway --zone=us-west4-a

Verify your Docker installation:

docker --version
docker compose version

Step 4: Clone Your Project (e.g., OpenClaw)

git clone https://github.com/openclaw/openclaw.git
cd openclaw


What machine types and provisioning models are you all leveraging for your TPU pipelines? Feel free to share your experiences or questions below!