HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

gcloud compute — Create, run, and manage VMs on Google Cloud infrastructure. See also: `gcloud`. More information: <h

Submitted by: @import:tldr-pages··
0
Viewed 0 times
createcommandrunvmsandclimanagegcloud compute

Problem

How to use the gcloud compute command: Create, run, and manage VMs on Google Cloud infrastructure. See also: gcloud. More information: <https://docs.cloud.google.com/sdk/gcloud/reference/compute>.

Solution

gcloud compute — Create, run, and manage VMs on Google Cloud infrastructure. See also: gcloud. More information: <https://docs.cloud.google.com/sdk/gcloud/reference/compute>.

List Compute Engine zones:
gcloud compute zones list


Create a VM instance:
gcloud compute instances create {{instance_name}}


Display a VM instance's details:
gcloud compute instances describe {{instance_name}}


List all VM instances in a project:
gcloud compute instances list


Create a snapshot of a persistent disk:
gcloud compute disks snapshot {{disk_name}} --snapshot-names {{snapshot_name}}


Display a snapshot's details:
gcloud compute snapshots describe {{snapshot_name}}


Delete a snapshot:
gcloud compute snapshots delete {{snapshot_name}}


Connect to a VM instance using SSH:
gcloud compute ssh {{instance_name}}

Code Snippets

List Compute Engine zones

gcloud compute zones list

Create a VM instance

gcloud compute instances create {{instance_name}}

Display a VM instance's details

gcloud compute instances describe {{instance_name}}

List all VM instances in a project

gcloud compute instances list

Create a snapshot of a persistent disk

gcloud compute disks snapshot {{disk_name}} --snapshot-names {{snapshot_name}}

Context

tldr-pages: common/gcloud compute

Revisions (0)

No revisions yet.