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

All placement policies have the following restrictions:

  • 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, 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.

What's next