Overview
In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.
When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.
To score 100% you must successfully complete all tasks within the time period!
Task 1. Create a Cloud Storage bucket
Your team has requested a new Cloud Storage bucket, so they can store their built code and startup scripts.
- Create a bucket named
qwiklabs-gcp-04-0a1cedbb0206
-bucket (US multi-region).
Click Check my progress to verify the objective.
Create a Cloud Storage bucket
Task 2. Create and attach a persistent disk to a Compute Engine instance
- Create a new Compute Engine instance named my-instance with the following configuration:
Property | Value |
Series | E2 |
Machine type | e2-medium |
Boot disk type | New balanced persistent disk |
Boot disk size | 10 GB |
Boot disk image | Debian GNU/Linux 11 (bullseye) |
Firewall rules | Enable Allow HTTP traffic |
Create a new persistent disk named mydisk with a size of 200GB.
Attach the persistent disk to the instance.
Click Check my progress to verify the objective.
Create and attach a persistent disk to an instance
Check my progress
Task 3. Install a NGINX web server
For this task, SSH into the Compute Engine instance, and install a NGINX web server. Here's a reminder of the general steps:
Update the OS.
Install NGINX.
Confirm that NGINX is running.
Click Check my progress to verify the objective.
Install a NGINX web server
Test the web application
To test the web application, return to the Cloud Console, and click the External IP link in the row for your machine name. Or, add the External IP value to http://EXTERNAL_IP/
in a new browser window or tab.
A default web page should open with the message "Welcome to nginx!".
Answers of Lab
export ZONE=
Task 2:
gcloud compute instances create my-instance --project=$DEVSHELL_PROJECT_ID --zone=$ZONE --machine-type=e2-medium --network-interface=network-tier=PREMIUM,stack-type=IPV4_ONLY,subnet=default --metadata=enable-oslogin=true --maintenance-policy=MIGRATE --provisioning-model=STANDARD --tags=http-server --create-disk=auto-delete=yes,boot=yes,device-name=my-instance,image=projects/debian-cloud/global/images/debian-11-bullseye-v20230509,mode=rw,size=10,type=projects/$DEVSHELL_PROJECT_ID/zones/$ZONE/diskTypes/pd-balanced --no-shielded-secure-boot --shielded-vtpm --shielded-integrity-monitoring --labels=goog-ec-src=vm_add-gcloud --reservation-affinity=any
gcloud compute disks create mydisk --size=200GB \
--zone=$ZONE
gcloud compute instances attach-disk my-instance --disk mydisk --zone=$ZONE
Task 3:
gcloud compute ssh my-instance --zone=$ZONE
sudo apt-get update
sudo apt-get install -y nginx
ps auwx | grep nginx