Google Compute Engine allows you to choose the region and zone where certain resources live, giving you control over where your data is stored and used. For example, when you create an instance or disk, you are prompted to select a zone where that resource should serve traffic from. Other resources, such as static IPs, live in regions and you must select a region for where each static IP should live.
Resources that are specific to a zone or a region can only be used by other resources in the same zone or region. For example, disks and instances are both zonal resources. If you want to attach a disk to an instance, both resources must reside in the same zone. Similarly, if you want to assign a static IP address to an instance, your instance must reside in the same region as the static IP.
Google Cloud Platform resources are hosted in multiple locations world-wide. These locations are composed of regions and zones within those regions. Putting resources in different zones in a region provides isolation for many types of infrastructure, hardware, and software failures. Putting resources in different regions provides an even higher degree of failure independence.
Note: 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.
- Available regions & zones
- Scheduled maintenance
Each region in Compute Engine contains any number of zones. To determine what zones belong to what region, review the fully qualified name of the zone. 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 in a region. This helps protect against unexpected failures of components, up to and including a single zone.
Choose a region 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 a zone in the us-central1 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, you may choose to create instances across multiple zones in multiple regions.
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.
Note: This diagram is an example to demonstrate zones and may not reflect actual available zones.
Available regions & zones
The following is a list of available regions and zones.
|Region||Available zones||Supported processor types|
Note: The selection of a location does not guarantee that your data at rest is kept only in that specific location. See the FAQ for more details.
Each zone supports either Ivy Bridge or Sandy Bridge 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 an Asia zone, your instance will use an Ivy Bridge processor. If you create an instance in a US or Europe zone, your instance will use a Sandy Bridge processor.
To view a list of available zones, you can always run:
$ gcutil --project=<project-id> listzones
To view a list of available regions using gcutil, use the
listregions command. The command lists all available regions and
provides information such as any relevant deprecation status and the status of
the region itself.
$ gcutil --project=<project-id> listregions +-----------------+------------------------+--------+-------------+ | name | description | status | deprecation | +-----------------+------------------------+--------+-------------+ | example-region | Description of region | UP | | | example-region2 | Description of region2 | UP | | +-----------------+------------------------+--------+-------------+
To get information about a single region, use the
$ gcutil --project=<project-id> getregion example-region +---------------+----------------------------------------+ | property | value | +---------------+----------------------------------------+ | name | example-region | | description | Description of region | | creation-time | 2013-04-29T11:18:01.821-07:00 | | status | UP | | zones | zones/example-zone,zones/example-zone2 | | deprecation | | | replacement | | | | | | usage | | +---------------+----------------------------------------+
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.
Compute Engine currently has two types of zones - those that have transparent maintenance and those that are subject to occasional scheduled maintenance windows.
Zones with transparent maintenance remain operational throughout all maintenance operations. 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.
Zones with scheduled maintenance windows are occasionally taken offline for various disruptive maintenance tasks (e.g. power maintenance). During scheduled maintenance windows, which last up to approximately two weeks, the entire zone is unavailable.
Compute Engine will be updating all its zones to transparent maintenance over the days to come. The table below lists zones with their maintenance mode:
During transparent maintenance, Compute Engine automatically moves your instances away from maintenance events so that maintenance work is transparent to your applications and workloads. Your instance continues to run within the same zone with no action on your part.
During transparent maintenance, you can configure Compute Engine to handle your instances in two ways:
- Live migrate
Compute Engine can automatically migrate 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 scheduled maintenance event.
For more information on how to set the options above for your instances, see Setting Instance Scheduling Options.
Scheduled zone maintenance windows
For zones with scheduled maintenance windows, there will be periods of time when these zones are taken offline for maintenance tasks, such as software upgrades. When a zone is taken down for maintenance, the following happens:
- All virtual machine instances in that zone are terminated and deleted from your project.
- All persistent disks will be preserved, but are unavailable until the maintenance window ends.
When a zone comes back online, you need to recreate your instances in the affected zone. The Compute Engine team will notify users of upcoming maintenance windows in a timely manner so that users can perform any tasks necessary before the zone is taken offline.
Although maintenance windows are an inconvenient and unavoidable part of the service, you can use the tips from the How to Design Robust Systems section to design a system that can withstand maintenance windows, zone failures, and unexpected interruptions.
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.
For example, if your global target pools quota is 50 and you create 25 rules in example-region and 25 pools in example-region2, 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. Once 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, your instances may be terminated because of scheduled zone maintenance windows or because of an unexpected failure. To mitigate the effects of these events, duplicate important systems in multiple zones, in case a zone hosting your instance goes offline or is taken down for servicing.
For example, if you host virtual machine instances in zones
europe-west1-bis taken down for maintenance or fails unexpectedly, your instances in zone
europe-west1-awill still be available. However, if you host all your instances in
europe-west1-b, you will not be able to access any of your instances if
europe-west1-bgoes offline. For more tips on how to design systems for availability, see Designing Robust Systems.