Creating a Virtual Machine in Google Cloud – Steps

A Virtual Machine (VM) is a software-based simulation of a physical computer. Google Cloud Platform (GCP) allows users to create and configure virtual machines using its Compute Engine service.


Steps to Create a Virtual Machine in GCP:

Step 1: Login to Google Cloud Console

  • Visit: https://console.cloud.google.com
  • Sign in using a Google account.
  • Select or create a new project.

Step 2: Open Compute Engine

  • In the left-side menu, go to:
    • Compute Engine > VM Instances
  • Click on “Create Instance”.

Step 3: Configure VM Name and Region

  • Give a name to the VM (e.g., student-vm).
  • Choose a Region and Zone (e.g., us-central1-a).

Step 4: Select Machine Type

  • Click on “Machine type” dropdown.
  • Select number of vCPUs (e.g., 2 vCPU).
  • Select amount of Memory (e.g., 4 GB RAM).
  • Or choose “Customize” to set your own values.

Step 5: Select Boot Disk

  • Choose the OS (e.g., Ubuntu, Debian, Windows).
  • Choose the Boot disk type (e.g., standard persistent disk).
  • Set disk size (e.g., 20 GB).

Step 6: Configure Firewall and Networking

  • Tick the options:
    • Allow HTTP traffic
    • Allow HTTPS traffic
  • Leave other settings as default (or modify as needed).

Step 7: Create the VM

  • Click the “Create” button.
  • The VM will be launched and listed under VM Instances.
  • Click on the SSH button to open the terminal of the VM.

Example Configuration:

AWS CloudShell is a browser-based shell environment provided by AWS to manage cloud resources using CLI commands. No setup is needed — it runs directly in the browser.

Here are 5 commonly used commands in AWS CloudShell:


1. aws s3 ls

Use: Lists all S3 buckets in your AWS account.

Example Output:

2023-06-21  bucket-for-projects

2023-06-21  logs-storage-bucket


2. aws ec2 describe-instances

Use: Displays details about EC2 virtual machines running in your account.

Example: Shows instance IDs, public IPs, states (running/stopped), etc.


3. aws configure

Use: Configures access credentials (AWS Access Key ID, Secret Key, Region).

Example:

AWS Access Key ID [None]: ********

AWS Secret Access Key [None]: ********

Default region name [None]: us-east-1


4. aws iam list-users

Use: Lists all IAM users in the account. Useful for managing permissions.


5. aws lambda list-functions

Use: Lists all serverless Lambda functions created in the AWS account.

Example:

FunctionName: processData

Runtime: python3.8

Handler: index.handler

Leave a Reply

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