This document explains how to create or update a virtual machine instance to use
a baseline minimum CPU platform (minCpuPlatform
) whenever available.
Google datacenters offer Intel Xeon-based host machines containing Sandy Bridge, Ivy Bridge, Haswell, Broadwell, and Skylake CPU Platforms. Each CPU platform supports incremental features like AVX-2, AVX-512, and so on. Some fundamental systems-related features like clock speed and memory access seek time can vary across CPU platforms. Different zones support multiple CPU Platforms, and you can select a CPU platform for your VM instances that supports the specific needs of your workloads using minimum platform selection.
To learn about the available CPU platforms for each zone, read the CPU Platforms and Regions and Zones documentation.
Before you begin
- If you want to use the command-line examples in this guide:
- Install or update to the latest version of the gcloud command-line tool.
- Set a default region and zone.
- If you want to use the API examples in this guide, set up API access.
When to select a minimum CPU platform
More than likely, you do not need to select a minimum CPU platforms for your VMs. Each Compute Engine zone has a default CPU platform, listed in the Regions and Zones documentation. Any newly created VM without a minimum CPU specification will get the default CPU Platform automatically.
Google recommends that you only select a minimum CPU platform when it introduces significant performance gains for your workload, or provides certain capabilities such as AVX2, AVX512, or MPX utilized by your code. Selecting a specific minimum CPU platform for your VM introduces additional constraints that affect your ability to start VMs in certain zones where some CPU platforms are in limited supply.
How selecting a minimum CPU platform works
When you specify a minimum CPU platform:
- Compute Engine always uses the minimum CPU platform where available.
- If Compute Engine retires a CPU platform from a zone, your VM can continue to run on a better CPU Platform available in that zone after you stop and restart the VM. Retiring CPU platforms is an infrequent situation and you will be notified of ahead of time.
Once you select a minimum CPU platform for a VM:
- Your VM will use this CPU platform, unless you stop the VM and change the CPU platform selected to another option.
- Upon live migration, your VM retains the same selected CPU platform.
- Occasionally, Google might update the default CPU platform for a zone. Read Retiring or upgrading a default CPU platform for more information.
Retiring or upgrading a default CPU platform
Occasionally, Google will retire an older CPU platform or update the default CPU platform in a particular zone because:
- A zone grows in capacity over time and proactively switches to a newer CPU platform as the platform becomes available.
- Every 3 to 5 years, Google replaces older CPU platforms with newer platforms, and updates the default CPU platform to the next newest platform available in that zone.
At any time, when a new region or zone is built, it will use the newest CPU platform at the time.
When a zone is retired or a default CPU platform for a zone changes, Google will provide advance notice to affected customers with a detailed timeline and specific instructions to transition to the newer platform.
VMs will never use a platform that is older than the minimum CPU platform you specify and the cost of the VM will not change if Compute Engine transitions your VM to a more recent platform.
Specifications
Limitations
- f1-small and g1-small predefined machine types are shared-core general purpose VMs. These will not have the CPU platform selection options.
Availability
The availability of specific CPU platforms varies across zones, based on the hardware available in each zone. The following is a list of supported minimum CPU platforms and the valid syntax for each platform:
- Intel Xeon E5 (Sandy Bridge) processors:
"Intel Sandy Bridge"
- Intel Xeon E5 v2 (Ivy Bridge) processors:
"Intel Ivy Bridge"
- Intel Xeon E5 v3 (Haswell) processors:
"Intel Haswell"
- Intel Xeon E5 v4 (Broadwell) processors:
"Intel Broadwell"
- Intel Xeon (Skylake) processors:
"Intel Skylake"
Only certain zones contain multiple CPU platforms and are available for minimum CPU platform selection. For a complete list, see the Regions and Zones page.
You can always view a list of supported platforms for a specific zone
using the gcloud compute zones describe
command or by making a request
to the API.
gcloud
For example, the following command lists the CPU platforms for the
us-west1-a
zone:
gcloud compute zones describe us-west1-a
availableCpuPlatforms:
- Intel Broadwell
- Intel Haswell
...
API
In the API, make a GET
request to the zone in question:
GET https://www.googleapis.com/compute/v1/projects/myproject/zones/[ZONE]
The response contains a list of support CPU platforms for that zone. For example:
{
"kind": "compute#zone",
"id": "2210",
"creationTimestamp": "2016-06-10T09:30:55.189-07:00",
"name": "us-west1-a",
"description": "us-west1-a",
"status": "UP",
"region": "https://www.googleapis.com/compute/v1/projects/myproject/regions/us-west1",
"selfLink": "https://www.googleapis.com/compute/v1/projects/myproject/zones/us-west1-a",
"availableCpuPlatforms": [
"Intel Broadwell",
"Intel Haswell"
]
}
Selecting a minimum CPU platform for a new VM
You can specify a minimum CPU platform during instance creation.
Console
- Go to the VM instances page.
- If prompted, select your project and click Continue.
- Click the Create instance button.
- Under the Machine Type section section, click Customize.
- Select an option from the CPU platform drop down menu.
- Continue with the rest of the instance creation process.
gcloud
To create a new VM with a min CPU platform using the gcloud
command-line
tool, provide the new --min-cpu-platform
flag. When specifying the CPU
platform, provide the platform using the friendly name, such as Intel
Broadwell
and Intel Haswell
. Use the available zones
section to determine which platforms are available for each zone.
For example, to specify a minimum CPU platform of Intel Haswell
:
gcloud compute instances create example-instance --zone europe-west1-b --min-cpu-platform "Intel Haswell"
API
In the Compute Engine API, include the minCpuPlatform
property as part of the request body. The value for minCpuPlatform
must be
the friendly name for the platform, such as Intel Haswell
, Intel Broadwell
,
and Intel Sandy Bridge
.
For example, a request body might look like this:
"name": "[INSTANCE_NAME]",
"machineType": "zones/[ZONE]/machineTypes/[MACHINE_TYPE]",
"minCpuPlatform": "Intel Haswell",
"networkInterfaces": [{
"accessConfigs": [{
"type": "ONE_TO_ONE_NAT",
"name": "External NAT"
}],
"network": "global/networks/default"
}],
"disks": [{
"autoDelete": "true",
"boot": "true",
"type": "PERSISTENT",
"initializeParams": {
"sourceImage": "projects/[IMAGE_PROJECT]/global/images/family/[IMAGE]"
}
}]
Setting a minimum CPU platform for a stopped VM
You can set a minimum CPU platform for an existing instance if you first stop the instance.
After stopping the instance, follow the instructions below to set a minimum CPU platform and then make sure to restart the instance.
Console
- Go to the VM instances page.
- If prompted, select your project and click Continue.
- Select the stopped instance that you want to change.
- Click Edit to edit the instance.
- Under the Machine Type section, click Customize.
- Select an option from the CPU platform drop down menu.
- Save your changes.
- Restart the instance.
gcloud
Use the update
subcommand, followed by the --min-cpu-platform
flag.
Specify the friendly name of the platforms, such as Intel Haswell
,
Intel Broadwell
, and Intel Sandy Bridge
. For example:
gcloud compute instances update [INSTANCE_NAME] --min-cpu-platform "Intel Haswell"
API
To set the minimum CPU platform in the API, make a POST
request to the
setMinCpuPlatform
method and set the minCpuPlatform
property in the request body. The
value for the property is the friendly name for the CPU platform, such as
Intel Haswell
, Intel Broadwell
, and Intel Sandy Bridge
. For example:
POST https://www.googleapis.com/compute/v1/projects/[PROJECT_ID]/zones/[ZONE]/instances/[INSTANCE]/setMinCpuPlatform
{
"minCpuPlatform": "Intel Haswell"
}
Specifying a minimum CPU platform in instance templates
If you use managed instance groups, you can specify a minimum CPU platform for VM instances within a managed instance group.
To specify a minimum CPU platform,
create an instance template
that includes the minCpuPlatform
property.
Console
- Go to the Instance templates page.
- If prompted, select your project and click Continue.
- Click Create instance template.
- Under the Machine Type section, click Customize.
- Select an option from the CPU platform drop down menu.
- Continue with the instance template creation process.
gcloud
Using the gcloud
tool, provide the --min-cpu-platform
flag when creating
an instance template. For example:
gcloud compute instance-templates create example-template \
--min-cpu-platform "Intel Haswell"
API
In the API, add the minCpuPlatform
as part of your request to create a new
instance template in the API.
For example, the following instance template contains the minimum required
fields for creating a new template with the addition of the minCpuPlatform
property:
{
"name": "example-template",
"properties": {
"machineType": "zones/us-central1-a/machineTypes/n1-standard-4",
"minCpuPlatform": "Intel Haswell",
"networkInterfaces": [
{
"network": "global/networks/default",
"accessConfigs":
[
{
"name": "external-IP",
"type": "ONE_TO_ONE_NAT"
}
]
}
],
"disks":
[
{
"type": "PERSISTENT",
"boot": true,
"mode": "READ_WRITE",
"initializeParams":
{
"sourceImage": "projects/debian-cloud/global/images/family/debian-8"
}
}
]
}
}
What's next
- See a list of CPU Platforms on Compute Engine.
- Learn more about Regions and Zones.
- Create and start Windows Server or SQL Server instances.
- Refer to the
gcloud compute instances create
command.