Placement policies overview

This document explains the behavior, restrictions, and billing of placementpolicies.

By default, you manage the location of your Compute Engine instances onlyby specifying their zones. Placement policies let you further specify therelative placement of your instances in a zone. Based on the policy that youapply to your instances, you can reduce network latency across instances(compact policy) or improve resiliency against location-specific disruptions(spread policy).

To learn how to create and apply placement policies, see the documentation forusing compact placement policiesandusing spread placement policies.

To learn about other ways of controlling instance placement, see thedocumentation forsole-tenancy andregional managed instance groups (MIGs).

About placement policies

Each compute instance runs on a physical server—ahost—that is ona server rack. Each server rack is part of acluster that is located in adata center for a zone. When you have multiple instances in the same zone,Compute Engine places these instances in different hosts by default. Thisplacement minimizes the impact of potential power failures. However, when youapply a placement policy to instances in the same zone, you can further controlthe relative locations of those instances in the zone based on the needs ofyour workload.

You can create the following types of placement policies:

  • Compact placement policy. This policy places instances close to eachother in a zone, which reduces network latency among the instances. Acompact placement policy is helpful when your instances need to communicateoften with each other—for example, when running high performancecomputing (HPC), machine learning (ML), or database server workloads.

    To learn more, seeAbout compact placement policiesin this document.

  • Spread placement policy. This policy places instances on separate,distinct hardware, which you can use to increase your workload'sreliability. Specifically, spreading instances helps to reduce the number ofinstances that are simultaneously impacted by location-specific disruptions,such as hardware errors. Additionally, if you use a spread placement policytooverprovision capacity in multiple locations,you can help ensure that you still have sufficient capacity even when onelocation is disrupted. For this reason, spread placement policies can alsobe helpful for large-scale, distributed, and replicated workloads, such asHadoop Distributed File System (HDFS), Cassandra, or Kafka.

    To learn more, seeAbout spread placement policies in this document.

About compact placement policies

When you apply a compact placement policy to compute instances,Compute Engine tries to place the instances as close to each other aspossible. This placement is subject to the machine type and zone availability ofthe instances, and instance compactness is achieved only on a best-effort basis.If your application is latency-sensitive and requires instances to be as closetogether as possible (maximum compactness) in a zone, then specify amaximumdistance value (Preview). Lower maximumdistance values ensure closer instance placement, but can result in feweravailable machines for instance placement.

The following table outlines the supported machine series, maximum number ofinstances, andhost maintenance policyfor each maximum distance value:

Maximum distance valueDescriptionSupported machine seriesMaximum number of instancesSupported host maintenance policy
Unspecified (Not recommended)Compute Engine makes best-effort attempts to place the instances as close to each other as possible, but with no maximum distance between instances in the zone.
  • Accelerator-optimized machines: A41, A3 Ultra1, A3 Mega2, A3 High2, A3 Edge2, A2, and G2
  • Compute-optimized machines: H4D, H3, C2D, and C2
  • General-purpose machines: C4D, C4, C3D, C3, N2D, and N2
  • Memory-optimized machines: M4, M3, M2, and M1
  • Storage-optimized machines: Z3-metal3
1,500Migrate or Terminate
3The instances are placed in adjacent clusters for low latency.
  • Accelerator-optimized machines: A41, A3 Mega2, A3 High2, A3 Edge2, A2, and G2
  • Compute-optimized machines: H4D, H3, C2D, and C2
  • General-purpose machines: C4D, C4, C3D, and C3
  • Memory-optimized machines: M4
  • Storage-optimized machines: Z3-metal3
1,500Migrate or Terminate
2The instances are placed in adjacent racks and experience lower network latency than instances placed in adjacent clusters.
  • Accelerator-optimized machines: A41, A3 Ultra1, A3 Mega2, A3 High2, A3 Edge2, A2, and G2
  • Compute-optimized machines: H4D, H3, C2D, and C2
  • General-purpose machines: C4D, C4, C3D, and C3
  • Memory-optimized machines: M4
  • Storage-optimized machines: Z3-metal3
  • For A3 instances: 256
  • For all other instances: 150
Terminate
1The instances are placed in the same rack and minimize network latency as much as possible.
  • Accelerator-optimized machines: A3 Mega2, A3 High2, A3 Edge2, A2, and G2
  • Compute-optimized machines: H4D, H3, C2D, and C2
  • General-purpose machines: C4D, C4, C3D, and C3
  • Memory-optimized machines: M4
  • Storage-optimized machines: Z3-metal3
22Terminate

1 You can only apply compact placement policies to A4 or A3 Ultra instances that are deployed using the reservation-bound provisioning model. For more information, seeCluster management capabilities in the AI Hypercomputer documentation.
2 By default, you can't apply compact placement policies with a maximum distance value to A3 Mega, A3 High, or A3 Edge instances. To request access to this feature, contact youraccount team or thesales team.
3 Bare metal instances only support theTerminate host maintenance policy.

After you create a compact placement policy and apply it to compute instances,you can verify the physical location of the instances in relation to otherinstances that specify the same compact placement policy. For more information,seeVerify the physical location of an instance.

About spread placement policies

When creating a spread placement policy, you can specify the number ofavailability domains—up to eight—to spread its compute instancesacross. Availability domains provide isolated, distinct hardware to minimize theimpact of localized disruptions. However, they're still impacted by sharedinfrastructure failures, such as data center power outages.

To reduce the proportion of your instances that are impacted whenever anavailability domain is disrupted, spread your instances across at least twoavailability domains—each additional availability domain further reducesthe proportion of your instances that are impacted. Alternatively, you mightspread your instances across a small number of availability domains to try tolimit network latency between those instances or due to zonal restrictions.

Note: A machine type and zone might not support all the availability domainsspecified in a spread placement policy. Attempting to create or migrate aninstance to a domain that the chosen machine type and zone don't support causeserrors.

When you apply a spread placement policy to an instance, Compute Engineplaces the instance in a specific availability domain based on one of thefollowing:

  • Automatic placement. By default, Compute Engine automaticallyplaces the instance in a domain based on the number of instances theplacement policy is already applied to:

    • Eight instances or less: If a spread placement policy is alreadyapplied to eight instances or less, then Compute Engine placesyour instance in the domain with the fewest instances.

    • More than eight instances: If a spread placement policy is alreadyapplied to more than eight instances, then Compute Engine placesyour instance in a random domain.

  • Specific placement. When creating an instance, updating the propertiesof an instance, or creating an instance template, you can optionally specifythe availability domain in which to place your instances. Distributinginstances across domains is helpful to increase the resiliency of yourworkload. Placing instances in the same domain might help reduce networklatency among those instances.

When you apply a spread placement policy to an existing instance, the instancemight need to be relocated to a different availability domain. During thisprocess, Compute Engine stops or live migrates the instance based on itshost maintenance policy.

Restrictions

The following sections outline the restrictions for placement policies.

Restrictions for all placement policies

For all placement policies, the following restrictions apply:

  • Placement policies areregional resources,and they only work in the region where they are located. For example, if youcreate a placement policy in regionus-central1, then you can only applyit to Compute Engine resources located inus-central1 or in a zoneinus-central1.

  • You can only apply one placement policy per Compute Engine resource.

  • You can replace or remove placement policies only from compute instances.Replacing or removing placement policies from other Compute Engineresources isn't supported.

  • You can only delete a placement policy if it's not applied to anyCompute Engine resource.

  • You can't apply placement policies to future reservation requests or toon-demand reservations that Compute Engine creates to fulfill anapproved future reservation.

  • You can't apply placement policies to instances that specify sole-tenantnodes.

Restrictions for compact placement policies

In addition to therestrictions for all placement policies, compactplacement policies have the following restrictions:

  • If a compact placement policy specifies amaximum distance value, then this value affectsthe maximum number of compute instances that you can apply the placementpolicy to, as well as the machine series and host maintenance policy thatthe instances can use.

  • If you want to apply a compact placement policy to on-demand reservations,then make sure of the following:

    • You can only apply compact placement policies to on-demand,single-project, standalone reservations. Shared reservations andreservations attached to commitments aren't supported.

    • You can't apply compact placement policies that specify a maximumdistance value of1.

    • You can only apply a compact placement policy to one reservation at atime.

Restrictions for spread placement policies

In addition to therestrictions for all placement policies, spreadplacement policies have the following restrictions:

  • You can apply a spread placement policy to 256 instances maximum.

  • You can't apply spread placement policies to reservations.

Billing

There are no additional costs associated with creating, deleting, or applyingplacement policies to a compute instance.

What's next

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-11-04 UTC.