Google Cloud Platform
Compute Engine

Cloud Platform Console Projects

All Google Compute Engine resources belong to a Google Cloud Platform Console project. Projects form the basis for enabling and using the Google Cloud Platform services, including managing APIs, enabling billing, adding and removing collaborators and enabling other Google services. Each project is a totally compartmentalized world. Projects do not share resources, can have different owners and users, are billed separately, and are managed separately.

After Google Compute Engine is enabled, any resources you create or use in Google Compute Engine belong to the project. It is possible to have many projects with Google Compute Engine enabled. To differentiate between them, Google Compute Engine requires that you always identify the project you're working in when interacting with the Google Compute Engine service.


Managing projects

You can create and manage projects in the Google Cloud Platform Console. For instructions, see the Cloud Platform Console documentation.

Identifying projects

In order to interact with Google Compute Engine resources, you must provide identifying project information for every request. If you are using gcloud compute, you can save your project ID so it is automatically provided for each request, but in the API, you must always specify the project ID.

A project can be identified two ways: using a project ID, or a project number. A project ID is the customized name you chose when you created the project, or when you activated an API that required you to create a project ID. A project number is a unique number assigned to your project. Both the project ID and project number can be found on the Dashboard of the project:

Note that a project ID is different than the project name. The project name is a human-readable way to identify your projects, but it is not used by any Google APIs. In this example, the project name is Example and the project ID is example-project-a.

When you provide your project ID, include the full project ID, with a domain if one is shown in the console. For example, when using gcloud compute, specify your project ID like so:

$ gcloud --project compute instances create example-instance

gcloud lets you save your project ID so that it is automatically provided for each request. To set a default project, use the gcloud config set command:

$ gcloud config set project

When you choose your project ID (or any resource names), avoid providing sensitive information in your names.

Project team members

Projects have team members that can collaborate on and access the project to varying degrees. Team members can be added as an owner, editor, or viewer. Every project can have one or more owners, editors, and viewers. Depending on their role, team members can access Google Compute Engine resources for that project accordingly:

  • To add or modify Google Compute Engine resources in a project, you need to be an owner or editor of that project.
  • To list information about certain resources within a project, you need to be a viewer, owner, or editor of that project.

To add team members to a project, see managing project members.

Get project information

To get key information about a project such as the project ID, project name, and project number, go to the Google Cloud Platform Console. Project information can be found on the Dashboard of the Cloud Platform Console.

Alternatively, you can also use gcloud compute project-info describe or the API to get the following information:

  • Project quotas
  • Project ID, returned in the name field
  • Any custom metadata for the project

gcloud and the API does not return information like:

  • The project number
  • Project name ("My great project")
$ gcloud [--project PROJECT_ID] compute project-info describe
  fingerprint: 6GCr7A6I_3Y=
  - key: custom-metadata
    value: '1234'
  - key: sshKeys
    value: 'user:ssh-rsa AAAAB3NzaC1yc2EA...'
  kind: compute#metadata
creationTimestamp: '2013-09-06T10:36:53.505-07:00'
description: ''
id: '574734885120952459'
kind: compute#project
name: myproject
- limit: 1000.0
  metric: SNAPSHOTS
  usage: 0.0
- limit: 5.0
  metric: NETWORKS
  usage: 1.0
- limit: 100.0
  metric: FIREWALLS
  usage: 7.0

Default region and zone

Currently, when you create a new project, Compute Engine automatically selects a default region and zone for the project, based on the location from where the project was created. Compute Engine makes a reasonable attempt to pick a region and zone that is the closest to where the project originated, so that resources you create will, ideally, have reduced latency to your customers or clients.

Compute Engine sets the default region and zone by setting two values in the project's metadata server. The metadata server contains metadata information about the project, including the project ID, project name, and so on. You can query the metadata server to get and use information about the project.

In the metadata server, the two metadata values that are set include:

  • google-compute-default-zone
  • google-compute-default-region

To see what your default region and zone settings are, run the following gcloud command, replacing PROJECT_ID with the project that you want to get the information about. You can also omit the project ID and gcloud uses your default project.

$ gcloud compute project-info describe --project PROJECT_ID

Look for the default zone and region metadata values in the response.

How a default region and zone affects you

The default region and zone settings affect only client tools gcloud and the Google Cloud Platform Console. Both of these tools use the default zone and region information to help you manage resources more easily by automatically pre-selecting the zone and region when you construct your requests.

In the Cloud Platform Console, zone and region fields are pre-populated when you create zonal or regional resources like instances and addresses. You can simply accept the pre-populated values, or explicitly change the value.

In gcloud, you can omit the --zone and --region flags and gcloud uses the default zone and region properties for the project.

You can always change your default region and zone in the metadata server, override the default zone and region locally for gcloud, or override it manually for each request in both gcloud and the Google Cloud Platform Console.

Changing a default region or zone

To change a default region or zone in the metadata server in gcloud, read Change your default zone and region in the metadata server in the gcloud documentation.

To change your default zone or region in the Cloud Platform Console:

  1. Go to the Metadata pane in the Cloud Platform Console.
  2. Click the Edit button and update the default zone and region values.