Overview of creating Compute Engine instances


Compute Engine lets you create and run instances on Google infrastructure. This document provides an overview of the various configuration parameters that are available to you during a Compute Engine instance creation. If you are creating an instance for the first time, then this document provides a starting point for understanding the process.

The terms Compute Engine instance, compute instance or instance are synonymous. Based on the machine type that you specify, an instance can be either a bare metal instance or a virtual machine (VM) instance, as follows:

  • If the name of its machine type ends in -metal, an instance is a bare metal instance, which does not have a hypervisor installed.
  • Otherwise, an instance is a VM instance. The terms virtual machine instance, VM instance, and VM are synonymous.

Synonymous terms are used interchangeably across the documentation and Google Cloud interfaces such as the Google Cloud console, the gcloud command-line tool, and the REST API.

Before you begin

  • Review the basics about Compute Engine instances.
  • If you haven't already, then set up authentication. Authentication is the process by which your identity is verified for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init
    2. Set a default region and zone.

    REST

    To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.

      Install the Google Cloud CLI, then initialize it by running the following command:

      gcloud init

    For more information, see Authenticate for using REST in the Google Cloud authentication documentation.

Configuration options during instance creation

When you create a Compute Engine instance, you specify the configuration that you want for your instance. Compute Engine uses this configuration to create your instance. The following table lists the various parameters that you configure during Compute Engine instance creation:

Parameter What you can configure
Machine configuration
  • Hardware: You specify a machine family, series, and type, which determines the number of vCPUs, memory, and the CPU platform that Compute Engine allocates for your instance.
  • Location: You can choose the region and zone where you want to create your instance.
Operating system (OS) and storage
Networking
Observability
  • Ops agent: You can install Ops agent on your instance to collect logs and metrics and monitor instance activity.
  • Virtual display: You can enable virtual displays on your instance to run screen capturing or remote system management tools on your VM.
Security
Advanced configuration

Ways to create and configure instances

You can create instances in multiple ways, each with its own method of configuration, as follows:

  • Create your instance by manually specifying a custom configuration. Choose this option if you're creating an instance from the scratch and are facing any of the following scenarios:

    • You know the specific configuration that is required for your workload
    • You want to create an instance with a complicated configuration.
    • You want to create an instance by using the Google Cloud CLI or REST.
  • Create a workload-optimized instance. In this method, you select your workload type while creating your instance and Google automatically populates a preset configuration that suits your workload. Choose this option if you're starting out with Compute Engine and don't know which configuration best suits your intended workload. This option is available only in the Google Cloud console.

  • Create your instance by using an instance template. An instance template is a resource that defines configuration settings for instances. Choose this option if you have a defined configuration template and want to create a lot of VMs with the same configuration.

  • Create your instance by making copies of a machine image. A machine image contains most of the information and data needed for cloning an instance. Choose this option if you want to make multiple copies of an existing source instance.

After you create your compute instance, Compute Engine automatically starts the instance.

What's next