0
0
GCPcloud~30 mins

Boot disk images in GCP - Mini Project: Build & Apply

Choose your learning style9 modes available
Boot Disk Images Setup on Google Cloud Platform
📖 Scenario: You are setting up virtual machines on Google Cloud Platform (GCP) for a small project. Each VM needs a boot disk image to start the operating system. You will create a list of boot disk images, configure a filter to select specific images, and then prepare the final configuration for VM creation.
🎯 Goal: Build a configuration that lists boot disk images, filters them by family, and prepares the final disk configuration for VM instances.
📋 What You'll Learn
Create a dictionary named boot_disk_images with exact image families and their project names.
Add a variable named selected_family to filter images by family.
Use a dictionary comprehension to create filtered_images containing only images matching selected_family.
Create a final dictionary named vm_disk_config that includes the filtered images and sets the disk type to pd-standard.
💡 Why This Matters
🌍 Real World
Setting up boot disk images is essential when creating virtual machines on cloud platforms like GCP. It ensures the VM boots with the correct operating system.
💼 Career
Cloud engineers and infrastructure specialists often configure boot disks for VMs to automate deployments and maintain consistent environments.
Progress0 / 4 steps
1
Create the boot disk images dictionary
Create a dictionary called boot_disk_images with these exact entries: 'debian-11': 'debian-cloud', 'ubuntu-2204-lts': 'ubuntu-os-cloud', 'windows-2019': 'windows-cloud'.
GCP
Need a hint?

Use curly braces to create a dictionary with keys as image families and values as project names.

2
Add the selected_family variable
Add a variable called selected_family and set it to the string 'ubuntu-2204-lts'.
GCP
Need a hint?

Assign the exact string to the variable selected_family.

3
Filter images by selected_family
Use a dictionary comprehension to create a dictionary called filtered_images that includes only the entry from boot_disk_images where the key matches selected_family.
GCP
Need a hint?

Use for family, project in boot_disk_images.items() and filter with if family == selected_family.

4
Create the final VM disk configuration
Create a dictionary called vm_disk_config with two keys: 'images' set to filtered_images and 'disk_type' set to the string 'pd-standard'.
GCP
Need a hint?

Use curly braces to create a dictionary with the specified keys and values.