Compute Engine
Run virtual machines in Google's data centres
Last updated
Was this helpful?
Run virtual machines in Google's data centres
Last updated
Was this helpful?
Was this helpful?
gcloud compute project-info describe --project <your_project_ID>
gcloud config set compute/zone ...
gcloud config set compute/region ...
gcloud compute instances create gcelab2 \
--machine-type n1-standard-2 \
--zone $ZONE
Command details
gcloud compute
allows you to manage your Compute Engine resources in a format that's simpler than the Compute Engine API.
instances create
creates a new instance.
gcelab2
is the name of the VM.
The --machine-type
flag specifies the machine type as n1-standard-2.
The --zone
flag specifies where the VM is created.
If you omit the --zone
flag, the gcloud
tool can infer your desired zone based on your default properties. Other required instance settings, such as machine type
and image
, are set to default values if not specified in the create
command.
gcloud compute ssh gcelab2 --zone us-central1-c
Make sure to add your zone, or omit the --zone
flag if you've set the option globally.
gcloud compute instances list