0
0
GCPcloud~30 mins

Creating a VM instance in GCP - Try It Yourself

Choose your learning style9 modes available
Creating a VM instance
📖 Scenario: You are setting up a simple virtual machine (VM) instance on Google Cloud Platform (GCP) to host a small website. This VM will run a basic Linux operating system.
🎯 Goal: Create a VM instance on GCP with a specific name, machine type, and image. Configure it to allow HTTP traffic.
📋 What You'll Learn
Create a VM instance named my-vm-instance
Use the machine type e2-micro
Use the image family debian-11 from the debian-cloud project
Allow HTTP traffic to the VM
💡 Why This Matters
🌍 Real World
Creating VM instances is a common task when deploying applications or websites on cloud platforms like GCP.
💼 Career
Cloud engineers and developers often need to configure and launch VM instances with specific settings to meet application requirements.
Progress0 / 4 steps
1
Define the VM instance name
Create a variable called instance_name and set it to the string "my-vm-instance".
GCP
Need a hint?

Use a simple string assignment to create the variable.

2
Set the machine type
Create a variable called machine_type and set it to the string "e2-micro".
GCP
Need a hint?

Assign the machine type as a string to the variable.

3
Specify the image family and project
Create two variables: image_family set to "debian-11" and image_project set to "debian-cloud".
GCP
Need a hint?

Define both variables with the exact string values.

4
Create the VM instance configuration dictionary
Create a dictionary called vm_config with keys and values: "name" set to instance_name, "machineType" set to machine_type, "imageFamily" set to image_family, "imageProject" set to image_project, and "allowHttp" set to True.
GCP
Need a hint?

Use a dictionary with the exact keys and link the values to the variables you created.