Compute Engine – gcloud Commands

 

 

You can use ‘gcloud‘ command-line tool to create and manage Google Compute Engine resources.

  • Set your Project as default in which you want to create Compute Engine instance

gcloud config set project your-project-id

 

  • Create Compute Engine instance named test-instance-1 in zone us-central1-a

gcloud compute instances create test-instance-1 –zone us-central1-a

 

gcloud compute ssh –zone us-central1-a test-instance-1

  •  To List all instances

gcloud compute instances list

  • To List instances with a label, for example  – key=”production” and value=”paymentserver”

gcloud compute instances list –filter=’labels.production:paymentserver’

Join GCP – Professional Cloud Architect Online Training 

Learn more on Google Cloud Services

Leave a Comment

Your email address will not be published. Required fields are marked *