LinuxCommandLibrary

gcloud-compute

Create, run, and manage VMs on Google Cloud infrastructure.

TLDR

List Compute Engine zones

$ gcloud compute zones list
copy


Create a VM instance
$ gcloud compute instances create [instance_name]
copy


Display a VM instance's details
$ gcloud compute instances describe [instance_name]
copy


List all VM instances in a project
$ gcloud compute instances list
copy


Create a snapshot of a persistent disk
$ gcloud compute disks snapshot [disk_name] --snapshot-names [snapshot_name]
copy


Display a snapshot's details
$ gcloud compute snapshots describe [snapshot_name]
copy


Delete a snapshot
$ gcloud compute snapshots delete [snapshot_name]
copy


Connect to a VM instance using SSH
$ gcloud compute ssh [instance_name]
copy

Copied to clipboard