0
0
GCPcloud~15 mins

Machine types and families (E2, N2, C2) in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Machine types and families (E2, N2, C2)
📖 Scenario: You are setting up virtual machines (VMs) on Google Cloud Platform (GCP) for different workloads. Each workload needs a VM with a specific machine family and type to match its performance and cost needs.Machine families like E2, N2, and C2 offer different balances of CPU power and cost. You will create configurations for these VMs to understand how to specify machine types in GCP.
🎯 Goal: Create a dictionary in Python that holds VM configurations for three machine families: E2, N2, and C2. Then add a variable to select a machine family, write code to get the machine type for that family, and finally complete the configuration by adding a zone to deploy the VM.
📋 What You'll Learn
Create a Python dictionary named vm_configs with keys 'E2', 'N2', and 'C2' and values as their default machine types.
Create a variable named selected_family to hold the machine family to use.
Write code to get the machine type from vm_configs using selected_family.
Add a variable named zone with the value 'us-central1-a' to complete the VM configuration.
💡 Why This Matters
🌍 Real World
Cloud engineers often need to choose the right machine types for virtual machines to balance cost and performance. This project simulates selecting machine types from different families in GCP.
💼 Career
Understanding machine types and families is essential for roles like Cloud Engineer, DevOps Engineer, and Infrastructure Architect to design efficient cloud infrastructure.
Progress0 / 4 steps
1
Create VM configurations dictionary
Create a Python dictionary called vm_configs with these exact entries: 'E2': 'e2-medium', 'N2': 'n2-standard-4', and 'C2': 'c2-standard-8'.
GCP
Need a hint?

Use curly braces {} to create a dictionary. Each key-value pair should be separated by a colon :.

2
Select a machine family
Create a variable called selected_family and set it to the string 'N2' to choose the N2 machine family.
GCP
Need a hint?

Assign the string 'N2' to the variable selected_family.

3
Get machine type from selected family
Create a variable called machine_type and set it to the value from vm_configs using the key selected_family.
GCP
Need a hint?

Use square brackets [] to get the value from the dictionary using the key stored in selected_family.

4
Add zone to VM configuration
Create a variable called zone and set it to the string 'us-central1-a' to specify the deployment zone.
GCP
Need a hint?

Assign the string 'us-central1-a' to the variable zone.