☁️
Cloud Computing
  • Introduction
  • Terminologies
    • Container
    • Kubernetes (K8s)
    • Serverless Computing
  • Services
    • Docker
    • Terraform
  • ☁️Cloud Computing Platforms
    • Google Cloud
      • Google Cloud Essentials
      • Management
        • Cloud IAM
      • Compute
        • Compute Engine
        • Kubernetes Engine
      • Resources
    • IBM Cloud
      • IBM Cloud Shell
      • Compute
      • Containers
      • Developer tools
      • Integration
      • Storage
      • Cloud Paks
    • Microsoft Azure
      • Compute
        • Functions
        • App Services
      • Networking
      • Storage
      • Web
      • Mobile
      • Databases
        • Cosmos DB
      • Analytics
      • AI + Machine Learning
      • Internet of things
      • Security
      • DevOps
      • Monitoring
      • Management and governance
      • Azure Stack
    • Amazon Web Services
    • Resources
  • Qwiklabs Challenge Labs
    • Create and Manage Cloud Resources
    • Deploy and Manage Cloud Environments with Google Cloud
    • Create ML Models with BigQuery ML
    • Insights from Data with BigQuery
    • Build a Website on Google Cloud
    • Build and Deploy a Docker Image to a Kubernetes Cluster
    • Build and Secure Networks in Google Cloud
    • Set Up and Configure a Cloud Environment in Google Cloud
    • Build and Optimize Data Warehouses with BigQuery: Challenge Lab
    • Scale Out and Update a Containerized Application on a Kubernetes Cluster
  • Whizlabs Challenge League
Powered by GitBook
On this page

Was this helpful?

  1. Cloud Computing Platforms
  2. Google Cloud
  3. Compute

Compute Engine

Run virtual machines in Google's data centres

To check for the defaults

gcloud compute project-info describe --project <your_project_ID>

To set defaults

gcloud config set compute/zone ...
gcloud config set compute/region ...

To create your VM through command-line, run the following command:

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.

To SSH through command line

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.

To list your instances

gcloud compute instances list
PreviousComputeNextKubernetes Engine

Last updated 2 years ago

Was this helpful?

☁️