Certain Compute Engine resources live in regions or zones. A region is a specific geographical location where you can run your resources. Each region has one or more zones. For example, the us-central1 region denotes a region in the Central United States that has zones us-central1-a, us-central1-b, us-central1-c, and us-central1-f.
Resources that live in a zone, such as instances or persistent disks, are referred to as zonal resources. Other resources, like static external IP addresses, are regional. Regional resources can be used by any resources in that region, regardless of zone, while zonal resources can only be used by other resources in the same zone.
For example, disks and instances are both zonal resources. To attach a disk to an instance, both resources must be in the same zone. Similarly, if you want to assign a static IP address to an instance, the instance must be in the same region as the static IP.
Only certain resources are region- or zone-specific. Other resources, such as images, are global resources that can be used by any other resources across any location. For information on global, regional, and zonal Compute Engine resources, see Global, Regional, and Zonal Resources.
The following diagram provides some examples of how regions and zones relate to each other. Notice that each region is independent of other regions and each zone is isolated from other zones in the same region.
Choosing a region and zone
You choose which region or zone hosts your resources, which controls where your data is stored and used. Choosing a region and zone is important for several reasons:
- Handling failures
- Distribute your resources across multiple zones and regions to tolerate outages. Google designs zones to be independent from each other: a zone usually has power, cooling, networking, and control planes that are isolated from other zones, and most single failure events will affect only a single zone. Thus, if a zone becomes unavailable, you can transfer traffic to another zone in the same region to keep your services running. Similarly, if a region experiences any disturbances, you should have backup services running in a different region. For more information about distributing your resources and designing a robust system, see Designing Robust Systems.
- Decreased network latency
- To decrease network latency, you might want to choose a region or zone that is close to your point of service. For example, if you mostly have customers on the East Coast of the US, then you might want to choose a primary region and zone that is close to that area and a backup region and zone that is also close by.
Identifying a region or zone
Each region in Compute Engine contains a number of zones. Each zone name contains two parts that describe each zone in detail. The first part of the zone name is the region and the second part of the name describes the zone in the region:
Regions are collections of zones. Zones have high-bandwidth, low-latency network connections to other zones in the same region. In order to deploy fault-tolerant applications that have high availability, Google recommends deploying applications across multiple zones and multiple regions. This helps protect against unexpected failures of components, up to and including a single zone or region.
Choose regions that makes sense for your scenario. For example, if you only have customers in the US, or if you have specific needs that require your data to live in the US, it makes sense to store your resources in zones in the us-central1 region or zones in the us-east1 region.
A zone is an isolated location within a region. The fully-qualified name for a zone is made up of
<region>-<zone>. For example, the fully-qualified name for zone
Depending on how widely you want to distribute your resources, create instances across multiple zones in multiple regions for redundancy.
Available regions & zones
The following table lists the region, its location, the available zones in that region, and the features available in that region:
|Western US||The Dalles, Oregon||
|Central US||Council Bluffs, Iowa||
|Eastern US||Berkeley County, South Carolina||
|Western Europe||St. Ghislain, Belgium||
|East Asia||Changhua County, Taiwan||
Each zone supports Ivy Bridge, Sandy Bridge, Haswell, or Broadwell processors. When you create an instance in the zone, your instance will use the processor supported in that zone. For example, if you create an instance in the us-central1-a zone, your instance will use a Sandy Bridge processor.
Google regularly maintains its infrastructure by patching systems with the latest software, performing routine tests and preventative maintenance, and generally ensuring that Google infrastructure is as fast and efficient as Google knows how to make it.
By default, all instances are configured so that these maintenance events are transparent to your applications and workloads. Google uses a combination of datacenter innovations, operational best practices, and live migration technology to move running virtual machine instances out of the way of maintenance that is being performed. Your instance continues to run within the same zone with no action on your part.
By default, all virtual machines are set to live migrate, but you can also set your virtual machines to terminate and reboot. The two options differ in the following ways:
Compute Engine automatically migrates your running instance. The migration process will impact guest performance to some degree but your instance remains online throughout the migration process. The exact guest performance impact and duration depend on many factors, but it is expected most applications and workloads will not notice.
Terminate and reboot
Compute Engine automatically signals your instance to shut down, waits a short time for it to shut down cleanly, and then restarts it away from the maintenance event.
For more information on how to set the options above for your instances, see Setting Instance Scheduling Options.
Compute Engine has made recent improvements in its virtualization technology that eliminate the need to decommision an existing zone for a ground-up infrastructure refresh (power, cooling, network fabric, servers, etc.). Infrastructure refreshes are rare and zones typically run for three to five years between refreshes. These refreshes should be transparent to customers.
If it ever becomes necessary to deprecate a zone, Compute Engine will notify users well in advance of when it will go offline so you have ample time to move your virtual machine instances and workloads.
Certain resources, such as static IPs, images, firewall rules, and networks, have defined project-wide quota limits and per-region quota limits. When you create these resources, it counts towards your total project-wide quota or your per-region quota, if applicable. If any of the affected quota limits are exceeded, you won't be able to add more resources of the same type in that project or region.
To see a comprehensive list of quotas that apply to your project, visit the Quotas page in the Google Cloud Platform Console.
For example, if your global target pools quota is 50 and you create 25 target pools in example-region-1 and 25 target pools in example-region-2, you reach your project-wide quota and won't be able to create more target pools in any region within your project until you free up space. Similarly, if you have a per-region quota of 7 reserved IP addresses, you can only reserve up to 7 IP addresses in a single region. After you hit that limit, you will either need to reserve IP addresses in a new region or release some IP addresses.
When selecting zones, here are some things to keep in mind:
Communication within and across regions will incur different costs.
Generally, communication within regions will always be cheaper and faster than communication across different regions.
Design important systems with redundancy across multiple zones.
At some point in time, it is possible that your instances might experience an unexpected failure. To mitigate the effects of these possible events, you should duplicate important systems in multiple zones and regions.
For example, by hosting instances in zones europe-west1-b and europe-west1-c, if europe-west1-b fails unexpectedly, your instances in zone europe-west1-c will still be available. However, if you host all your instances in europe-west1-b, you will not be able to access any instances if europe-west1-b goes offline. You should also consider hosting your resources across regions. For example, consider hosting backup instances in a zone in europe-east1 in the unlikely scenario that the europe-west1 region experiences a failure. For more tips on how to design systems for availability, see Designing Robust Systems.