Fluiddocs

Google Cloud

Connect a Google Cloud project so Fluid can run jobs on Compute Engine VMs, spot or standard, CPU or GPU.

Warnings and limits

  • Fluid asks Google for a 120 s notice before a spot VM is preempted. If Google refuses that request, Fluid starts the VM without it and plans with 25 s.
  • Compute Engine automatically deletes each VM at its fixed lifetime, 24 hours by default. An Owner can set 1 to 2880 hours for Standard VMs. Flex-start uses the shorter of that setting and 24 hours from VM start. Fluid checkpoints and suspends single-machine jobs 30 minutes before the limit. For a multi-node job, request a live move before the source VMs expire.
  • Google Cloud quotes check your project's quotas (CPUs, GPUs and preemptible GPUs per region, by machine family) and list an offer that does not fit as unavailable, with the quota named. A quota Fluid cannot read is reported as unknown in the offer's note, never as room. Newer projects do not list the all-regions GPU quota or the H100 quotas where Fluid reads quotas: Fluid does not check those, and Google refuses a start that would cross them. See Quotas and capacity.
  • A machine series is quoted only in the regions that sell it. Among the default quote regions, A2 Ultra (A100 80 GB) is in us-central1 and us-east4, A2 High (A100 40 GB) in us-central1, us-east1 and us-west1, and A3 High (H100) in us-central1, us-east4 and us-west1.
  • H100 machines (A3 High) are offered as spot only.
  • A spot quote shows Google's Spot capacity advice when the connection's service account may read it. That takes the permission compute.advice.capacity, which Fluid's role does not carry. Without it the quote says so and the capacity stays unknown. The advice is an estimate and never refuses a launch. See Capacity estimates.
  • A stopped VM still bills for its persistent disk until the disk is deleted. Boot disks default to 50 GB for CPU VMs and 200 GB for single-GPU VMs. Multi-GPU machines get larger boot disks. An eight-GPU A2 Ultra gets a 904 GB boot disk in addition to its Local SSD. Boot disks, public IPv4 and NAT have separate charges. The A2 Ultra Flex-start rate includes the required Local SSD.
  • Fluid connects Google Cloud without a key by default: your project trusts your workspace's own identity, and Fluid stores nothing that could be replayed. See Keyless connection.
  • If your organization restricts which identity providers a project may trust (the policy constraints/iam.workloadIdentityPoolProviders) or forbids making service accounts (constraints/iam.disableServiceAccountCreation), connecting stops before it makes anything and says what an organization policy administrator has to allow: see Organization policies.
  • If your organization forbids service account keys (the policy constraints/iam.disableServiceAccountKeyCreation), connect keyless, which is the default and makes no key. Only --keys needs keys to be allowed: see Service account keys.
  • After you remove the keyless trust in Google Cloud, Google issues Fluid no new token, but a token already issued lasts up to an hour.
  • If your organization denies VMs external IPs (the policy constraints/compute.vmExternalIpAccess), Fluid's VMs need Cloud NAT and private networking: see External IPs.

Connect

fluid connect gcp --from-cli --project my-project

--from-cli uses your gcloud login. It prints every step and asks before it makes anything: a service account for Fluid with one custom role, and a keyless trust between your project and your Fluid workspace. No service account key is made. The default region is us-central1; set another with --region.

OptionWhat it does
noneconnects keyless
--federatedrequires the keyless connection: if it cannot be made, the command stops and says why. It never makes a key.
--keysmakes a service account key instead, sealed on Fluid's side and never shown again: see Service account keys

Google Cloud shows a new service account, or a new workload identity pool, to its other services only after a moment. The steps that name one wait for it, up to 3 minutes, and the save waits up to 2 minutes for a new trust to work. Each says so while it waits. If a step fails, the output gives gcloud's own reason and what was made before it. Run the same command again: it reuses what was made.

The project needs the Compute Engine API. --from-cli turns it on; a pasted key turns it on too when its service account may enable services (Owner, Editor or Service Usage Admin), and the save waits for Google to finish. A key that may not is refused with the project named and the page that enables the API; enable it there, then connect again.

Keyless connection

Your project trusts your Fluid workspace's own identity through Workload Identity Federation, the way an Azure federated credential does. --from-cli makes this in your project:

WhatWhat it is for
a custom role and a service accountFluid's access to Compute Engine. The service account holds that one role and nothing else.
a workload identity pool with one provider, portal-oidcThe provider trusts your workspace and nothing else: your workspace's issuer, its one subject, and one audience, which is the provider's own name.
one binding on the service accountLets that one subject act as the service account (roles/iam.workloadIdentityUser). Nothing is granted on the project to the pool.

The plan prints the issuer, the subject and the provider's name before you agree.

What Fluid stores. The project ID, the provider's name and the service account's email. They are identifiers: a copy of them is of no use to anyone else, because Google issues a token only to your workspace's identity.

How Fluid signs in. For each token your workspace signs an assertion that lives five minutes, Google exchanges it, and Google issues the service account's access token for one hour. When the hour is over Fluid asks again the same way, so a job that runs for days needs nothing else. An assertion made for Google Cloud is of no use at Azure, and the other way round.

To end it, remove the binding, the provider, the pool or the service account in Google Cloud. No new token is issued after that, and a token already issued lasts an hour at most. fluid disconnect gcp deletes what Fluid stored and leaves your project as it is.

Run it again whenever you like: it reuses what it made. It reuses the pool and the provider only when they are exactly this trust. If the provider was changed, the command stops and says what differs; Fluid changes no pool or provider it finds. Google Cloud keeps a deleted pool or provider for 30 days, and no other of that name can be made meanwhile: the command stops with the undelete command that restores it.

If the connection had a key. Connecting again without --keys makes it keyless. Fluid deletes the old key, as the last step, only when all of this holds: Fluid names the key it held, that key is on the connection's own service account, and the keyless connection is saved and verified. Otherwise it deletes nothing and prints the commands that list and delete the key.

Organization policies

Two organization policies can forbid the keyless connection. The plan reads your project's effective policy for both, before it makes anything:

The policyWhat Fluid does
allows it, or is not setconnects
restricts identity providers and does not allow your workspace's issuer (constraints/iam.workloadIdentityPoolProviders, or its managed form constraints/iam.managed.workloadIdentityPoolProviders)stops, creates nothing, and prints the exact issuer for an organization policy administrator to allow on the project
forbids making service accounts (constraints/iam.disableServiceAccountCreation, or its managed form), when Fluid's service account does not exist yetstops, creates nothing, and says to ask an administrator to allow service account creation on the project
cannot be readsays so once and goes on. If Google Cloud then refuses a step, the output gives Google's reason and what was made.

Reading a policy needs the permission orgpolicy.policy.get and the Organization Policy API (orgpolicy.googleapis.com). When that API is off, the plan turns it on first and reads the policies before any other step. A keyless plan does not read the policy on service account keys. Fluid never changes an organization policy.

Service account keys

--keys connects with a service account key instead of the keyless trust. The key is sealed on Fluid's side and never shown again. A plan also makes a key when the Fluid you are signed in to offers no keyless connection.

To use a key you already have, pass the service account JSON file:

fluid connect gcp --file key.json

or paste it on the console's Connect page.

Many organizations forbid service account keys with the organization policy constraints/iam.disableServiceAccountKeyCreation, or its managed form constraints/iam.managed.disableServiceAccountKeyCreation, and new organizations often forbid them from the start. Google Cloud then refuses a new key with "Key creation is not allowed on this service account".

A plan that would make a key reads the project's effective policy first, before it makes anything:

The policyWhat Fluid does
allows keys, or is not setconnects with a new key
forbids keysstops, creates nothing, and says the ways out
cannot be readsays so once and goes on. If Google Cloud then refuses the key, the output says the same ways out and what stays in the project.

The ways out: connect keyless, which needs no key; the output gives the command. Or ask an organization policy administrator to allow service account key creation on the project, then connect again. Or ask them for a key of a service account they approve, and connect with fluid connect gcp --file key.json.

--keys on a connection that is keyless makes a key and leaves the pool, the provider and the binding in your project. The output says how to remove them.

Networks

By default Fluid uses a network of its own in your project that admits no inbound traffic; its daemons only dial out. To use an existing network instead:

OptionWhat it does
--network Nreuse this network (a name or a resource path)
--subnetwork San existing subnetwork in --region
--private-networkstart VMs without external IPs; your network must provide NAT or another way out

External IPs

Each VM gets an ephemeral external IP by default. It is how the VM reaches Fluid, installs packages and saves checkpoints: Fluid's VMs only dial out. Many organizations deny VMs external IPs with the organization policy constraints/compute.vmExternalIpAccess, or its managed form constraints/compute.managed.vmExternalIpAccess, and new organizations often deny them all from the start. Google Cloud then refuses every VM with "Constraint constraints/compute.vmExternalIpAccess violated".

When you connect without --private-network or --no-private-network, Fluid reads the project's effective policy:

The policyWhat Fluid does
allows external IPs, or is not setconnects as before
denies them, and Cloud NAT serves the network in the connection's regionuses private networking: VMs get no external IP and go out through that NAT. fluid connect and the MCP tools say so.
denies them, and no Cloud NAT serves the networkrefuses the connection, creates nothing, and prints the commands below with your project, region and network filled in
cannot be readwarns once, naming the permission it needs, and connects as before

Reading the policy needs the permission orgpolicy.policy.get and the Organization Policy API (orgpolicy.googleapis.com). --from-cli reads it with your gcloud login; when that API or Compute Engine is off, the plan turns them on first and reads the policy before it makes anything else. Fluid reads it again with the connection's own role, which has orgpolicy.policy.get and compute.routers.list. A connection made before October 31, 2026 gets both by connecting again with fluid connect gcp --from-cli, which updates the role.

To give the VMs a way out without external IPs, create a Cloud Router and Cloud NAT in the connection's region, then connect with --private-network:

gcloud compute routers create portal-nat-router --project=PROJECT --region=REGION --network=soma-net
gcloud compute routers nats create portal-nat --project=PROJECT --region=REGION --router=portal-nat-router --auto-allocate-nat-external-ips --nat-custom-subnet-ip-ranges=soma-net
fluid connect gcp --from-cli --private-network --project PROJECT --region REGION

When Fluid's network soma-net does not exist yet, create it first, the way Fluid makes it:

gcloud compute networks create soma-net --project=PROJECT --subnet-mode=auto --description=soma:managed=true

With your own network (--network), put its name in place of soma-net, and its subnetwork's name in --nat-custom-subnet-ip-ranges. Google Cloud bills Cloud NAT; quotes leave it out.

The other way out: an organization policy administrator allows external IPs on the project. Fluid never changes an organization policy.

If a launch still meets the policy, for a connection made before Fluid checked it or a policy set later, the job's events carry the same commands (fluid explain JOB), and Fluid tries the job's next offer when it has one.

Machines

SeriesGPU
E2, N2, N2 highmem, C3none
N1NVIDIA T4
G2NVIDIA L4
A2 HighNVIDIA A100 40 GB
A2 UltraNVIDIA A100 80 GB
A3 HighNVIDIA H100 (spot only)

For a GPU job on one GCE machine, Fluid supports one rank. For several ranks on a single machine, use AWS, Modal, Lambda Cloud or your own machine.

GPU groups

In the dedicated Google Cloud project that hosts the VMs, create a separate VPC for rank traffic. Auto-mode and custom-mode networks both work when the target region contains exactly one eligible subnet. Use a subnet with purpose PRIVATE or PRIVATE_RFC_1918, an IPv4-only stack, and an RFC 1918 primary range. The VPC must belong to the project and be separate from the connection's ordinary VPC, soma-net, and default. To preview a connection whose VMs use private addresses for outbound traffic, name the rank VPC and choose private networking.

fluid connect gcp --from-cli --project PROJECT --region REGION --rank-network NETWORK --private-network --json

Use gcp.NAME in place of gcp for a named connection. NETWORK can be its short name or its same-project network resource path. The MCP equivalent is connect_from_cli(provider="gcp", project=PROJECT, region=REGION, rank_network=NETWORK, private_network=True), with connection="gcp.NAME" for a named connection. Review the project, VPC and changes to the service account's role. This preview makes no changes. Applying the reviewed plan enables the Cloud Resource Manager API if needed, adds the rank-network permissions to the role and records the VPC on the connection. Reconnecting without the option retains the rank-network grants. Fluid checks the service account's effective project permissions before using the network.

Permission added for rank groupsPurpose
compute.firewalls.create, compute.firewalls.deleteCreate the generation's peer firewall rule and remove it when its members are gone
compute.networks.updatePolicy, compute.instances.setTagsApply the peer rule to the rank VPC and tag only the member VMs
compute.firewalls.get, compute.networks.getRegionEffectiveFirewallsInspect the peer rule and the effective firewall rules in the selected region
compute.globalOperations.listCheck the network operation in Google Cloud

Private egress for rank machines

A private member VM reaches the Fluid gateway, package repositories and checkpoint storage through Google Cloud Public NAT. The operator supplies a Cloud Router and Public NAT in the rank VPC and target region. The NAT must serve VM endpoints and cover the primary IPv4 range of the selected rank subnet. On a move, check the destination subnet and region as well. The ordinary connection VPC and its NAT serve a different network.

If the rank subnet already has suitable NAT, reuse it. Otherwise, the project operator can create it with the commands below. Substitute the actual project, region, rank VPC and subnet names. If a Cloud Router already exists on that VPC in that region, use its name in the second command. Google Cloud CLI subnet range options

gcloud compute routers create portal-rank-router --project=PROJECT --region=REGION --network=NETWORK
gcloud compute routers nats create portal-rank-nat --project=PROJECT --region=REGION \
  --router=portal-rank-router --type=PUBLIC --auto-allocate-nat-external-ips \
  --nat-custom-subnet-ip-ranges=RANK_SUBNET

With --private-network, each member receives only its internal address. Without that choice, Fluid reads the project's effective external-IP policy. A denial selects private egress and requires a serving NAT. An allowance permits an ephemeral external IPv4 address on each member for outbound access. If Fluid cannot determine the policy, choose private networking explicitly. Fluid checks the private route before launching member VMs. A NAT on a different subnet, a NAT covering secondary ranges alone, or a Private NAT for traffic between VPCs cannot supply that route.

For Standard VMs, the group rate covers compute across all members. The quote lists boot disk, Local SSD and VM external IPv4 estimates separately. The boot disk estimate uses the region's rate for a balanced persistent disk, divided by 730 hours. extra.boot_disk_pricing gives that rate per GiB-month and its source. A source of unverified_region_default means Fluid has not verified the region's rate and used $0.10, so the real charge can differ. A private member's external IPv4 charge is zero. For private egress the quote also lists NAT rates. Google bills gateway usage by VM-hours, shared NAT addresses by address-hours, traffic processed by GiB, and applicable data transfer. The actual charges depend on the gateway's usage and traffic. The NAT and router remain available after the job. Google Cloud NAT pricing

Regardless of the outbound mode, ranks exchange traffic on their private addresses. Every member of a generation runs in one zone. Its ingress rule uses the same generation tag for sources and destinations, keeping the old and new groups separate during a move. Fluid removes that peer rule after all its members are gone.

Quote four machines

Each generation uses one VM type. Standard provisioning supports all three types. They have 96 vCPUs and eight GPUs per machine.

Machine typeGPU per rankGPU memory per rankCLI selector
g2-standard-96NVIDIA L424 GB--gpu L4
a2-highgpu-8gNVIDIA A10040 GB--gpu A100-40GB
a2-ultragpu-8gNVIDIA A10080 GB--gpu A100-80GB

To quote 32 ranks on four A2 Ultra machines, run this command in the script directory.

fluid run train.py --gpu A100-80GB --gpus 8 --nodes 4 --ranks 32 --providers gcp --regions us-central1 --no-spot --plan --json

Use --gpu A100 to consider either A100 size. Select the exact spec from an eligible offer and pass it with --on and a project name. A group of four consumes 32 GPUs and 384 vCPUs. A live move preserves the node count and global rank assignments. It provisions the full destination while the source still runs. Check quota and any existing spend cap for that overlap. Each destination GPU must fit its rank's state. Train on several GPUs

Each A2 Ultra VM comes with 3,000 GiB of Local SSD scratch storage. Four VMs have 12,000 GiB. Google bills this storage for the life of the VMs and deletes it with them. The Standard quote identifies the regional storage SKU and rate per GiB-month in extra.local_ssd_pricing when available. The hourly estimate for all four VMs is extra.ancillary_estimates_per_hour.local_ssd, calculated as 12,000 times the regional monthly rate divided by 730. Add this estimate to price_per_hour and the other applicable charges when comparing offers. A null storage estimate means the regional price is unknown and the charge still applies. Fluid keeps migration checkpoints in object storage.

At the default 24-hour VM lifetime, Standard GPU VMs can use granted preemptible GPU quota. Fluid checks that pool when the configured maximum is seven days or less and the pool has a positive limit. With a longer maximum or no grant, it checks standard GPU quota. The offer shows the quota pool checked and the on-demand compute rate. Google Cloud VM time limits

Quote a G2 Spot group

Group discovery offers Standard VMs by default. To use Spot, pin g2-standard-96 to a region and zone and add :spot to the spec. This command previews four VMs in one zone, each running eight ranks on eight L4 GPUs.

fluid run train.py --gpu L4 --gpus 8 --nodes 4 --ranks 32 --spot --plan --json \
  --on gcp:g2-standard-96:region=us-central1:zone=us-central1-a:spot

Check that the offer shows extra.pricing.purchase_model as spot. The regional Spot rate for one VM is node_price_per_hour. The group's hourly compute estimate is price_per_hour, covering 32 GPUs on four machines. Boot disks and applicable network charges are separate. To launch, repeat the command using the eligible offer's exact spec for --on, remove --plan, and add --project with your project name.

Google's Spot capacity advice applies to the machine type, zone and number of VMs requested. For this quote, extra.capacity.scope.count should be 4. Advice is shown as unknown if Google cannot give a matching estimate. Even a high score leaves capacity unreserved. A live move needs another four machines while the source runs, and both groups can accrue charges during the overlap. Capacity estimates

If Google gives a preemption notice for any member and the Spot policy is on, Fluid attempts one live move of all ranks to the same zonal Spot spec before the notice expires. The job continues only after every rank has checkpointed and its restored state matches. A confirmed loss or incomplete handoff ends the job and releases the group. Spot interruptions and checkpoints

Quote A2 Ultra Flex-start

Flex-start lets Compute Engine queue an A2 Ultra group for capacity in one zone. Pin both the region and the zone. Fluid has verified Flex-start rates for asia-southeast1, europe-west4, us-central1, us-east4 and us-east5. To compare with the Standard quote above, request an exact Flex-start quote for the same topology.

fluid run train.py --gpu A100-80GB --gpus 8 --nodes 4 --ranks 32 \
  --on gcp:a2-ultragpu-8g:region=us-central1:zone=us-central1-a:provisioning=flex_start --plan --json

Check that extra.pricing.purchase_model is flex_start. Use the eligible offer's exact spec with --on and your project to launch, or with fluid move JOB --to SPEC for a live move. A quote without the explicit provisioning option uses Standard for this shape.

Each requested VM can wait up to 180 seconds for allocation (extra.request_valid_for_duration_s). Once it starts, its lifetime is at most 24 hours, or the workspace's shorter GCE limit (extra.max_run_duration_s). A VM still waiting for capacity incurs zero VM compute cost. Members already allocated can bill while the rest wait, including during boot and idle time. If the complete group cannot start, Fluid releases any members it obtained. During a move the source also accrues charges while Fluid waits for the destination.

The Flex-start group's price_per_hour includes CPU, memory, eight 80 GB A100s per VM and all required Local SSD at the regional Flex-start rates. The four regional SKUs appear in extra.pricing.included_skus. Boot disks and network charges are separate. Prices and quotes

Notices and lifetime

Fluid asks for Compute Engine's 120 s preemption notice on Spot VMs. Fluid's daemon on each VM watches the metadata server for its notice. On a notice, the Spot policy checkpoints and suspends a single-machine job. For a G2 Spot group it attempts a live move of every rank before the earliest notice expires. Standard GPU VMs also watch for host maintenance that would stop them.

Standard VMs are created with a fixed termination time, 24 hours by default. An Owner can change it in the console's Settings (gcp_max_run_h). For Flex-start, Compute Engine measures the maximum run duration from VM start. See Settings.

On this page