About placement policies


This document explains the behavior, billing, and restrictions of placement policies.

Each virtual machine (VM) instance runs on a physical server—called host—which is placed in a server rack, which is in a cluster located in a data center. By default, Compute Engine places your VMs in different hosts to minimize the impact of power failures. When you create a placement policy and apply it to your VMs, you can redefine the physical location of the VMs in relation to each other depending on the needs of your application. For higher availability, you can place VMs further apart. For reduced network latency, you can place VMs closer to each other.

You can create the following types of placement policies:

  • Compact placement policy: This policy specifies that VMs are placed close together to reduce network latency. Placing your VMs closer to each other is useful when your VMs need to communicate often among each other, such as when running high performance computing (HPC), machine learning (ML), or database server workloads.

  • Spread placement policy: This policy specifies that VMs are placed on separate, discrete hardware—called availability domains—for improved availability and reliability. Placing your VMs on separate availability domains helps to keep your most critical VMs running during live migrations of VMs, or reduce the impact of hardware failure among VMs that share the same hardware.

After creating a placement policy, you can create VMs that specify the placement policy—or apply the policy to existing VMs—to specify the physical location of your VMs.

Billing

There are no additional costs associated with creating, deleting, or applying placement policies to a VM.

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 are regional resources, and they restrict their use to the region where they are located. For example, if you create a placement policy in region us-central1, then you can only apply it to Compute Engine resources located in the same region or in a zone within us-central1.

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

  • You can only remove or replace placement policies from VMs. Removing or replacing placement policies from other Compute Engine resources isn't supported.

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

  • You can't apply placement policies to future reservation requests of VMs.

  • You can't apply placement policies to VMs that specify sole-tenant nodes.

Restrictions for compact placement policies

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

  • When creating a compact placement policy, you can specify a maximum distance value (Preview) to better control how far apart to place your VMs. The following table outlines the supported machine series, number of VMs, and host maintenance policy for each maximum distance value:

    Maximum distance value Description Supported machine series Maximum number of VMs* Supported host maintenance policy
    Unspecified (default) Based on availability, the VMs are placed as close to each other as possible. A2, A3, C2, C3, C2D, C3D, G2, H3, N2, and N2D 1,500 Migrate or Terminate
    3 The VMs are placed in adjacent clusters for low latency. A2, C2, C3, C2D, C3D, G2, and H3 1,500 Migrate or Terminate
    2 The VMs are placed in adjacent racks and experience lower network latency than VMs placed in adjacent clusters. A2, C2, C3, C2D, C3D, G2, and H3 150 Terminate
    1 The VMs are placed in the same rack and minimize network latency as much as possible. A2, C2, C3, C2D, C3D, G2, and H3 22 Terminate

    * The maximum number of VMs might be smaller, depending on the available resources for VM placement.

  • If you want to create a compact placement policy for a reservation, then the following limitations apply:

    • You can't specify a fixed number of VMs.

    • You can't specify a maximum distance value of 1.

    For more information, see the additional requirements for reservations.

Restrictions for spread placement policies

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

  • You can only apply a spread placement policy to 32 VMs maximum.

  • You can't apply spread placement policies to on-demand reservations of VMs.

  • You can't verify the physical location of VMs.

What's next