0
0
GCPcloud~20 mins

Compute commands (instances, disks) in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Compute Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What is the result of this command?
You run the command to list all VM instances in a project:

gcloud compute instances list --filter="zone:(us-central1-a)"

What will this command output?
AA list of all VM instances in all zones of the project.
BA list of all VM instances only in the zone us-central1-a with their details.
CAn error because the filter syntax is incorrect.
DA list of all VM instances but only their names without details.
Attempts:
2 left
💡 Hint
Think about how the filter limits the output to a specific zone.
Configuration
intermediate
2:00remaining
Which command creates a new persistent disk of 100GB in zone us-east1-b?
You want to create a new persistent disk named 'my-disk' with size 100GB in the zone us-east1-b. Which command will do this correctly?
Agcloud compute disks create my-disk --size=100GB --zone=us-east1-b
Bgcloud compute disks create my-disk --zone=us-east1-b --size=100
Cgcloud compute disks create --name=my-disk --size=100GB --zone=us-east1-b
Dgcloud compute disks create my-disk --size=100GB --region=us-east1-b
Attempts:
2 left
💡 Hint
Check the correct order and syntax for the create disk command.
Architecture
advanced
2:00remaining
What happens if you delete a VM instance with an attached persistent disk without specifying disk deletion?
You delete a VM instance using:

gcloud compute instances delete my-instance --zone=us-west1-c

The instance has a persistent disk attached. What happens to the disk?
AThe persistent disk remains and can be attached to other instances later.
BThe persistent disk is deleted automatically along with the instance.
CThe command fails because you must specify what to do with the disk.
DThe persistent disk is detached and becomes read-only.
Attempts:
2 left
💡 Hint
Think about default behavior of disks when deleting instances.
security
advanced
2:00remaining
Which command correctly attaches an existing persistent disk to a running VM instance?
You have a persistent disk named 'data-disk' and a running VM instance 'web-server' in zone us-central1-b. Which command attaches the disk correctly?
Agcloud compute instances attach-disk web-server --disk=data-disk --region=us-central1-b
Bgcloud compute disks attach web-server --disk=data-disk --zone=us-central1-b
Cgcloud compute instances attach-disk --instance=web-server --disk=data-disk --zone=us-central1-b
Dgcloud compute instances attach-disk web-server --disk=data-disk --zone=us-central1-b
Attempts:
2 left
💡 Hint
Check the correct command group and flags for attaching disks.
Best Practice
expert
2:00remaining
What is the best practice to ensure data persistence when deleting VM instances frequently?
You have a workload where VM instances are created and deleted often. You want to keep the data safe and persistent. Which approach is best?
AUse local SSDs attached to the VM instances for fast storage.
BStore data only inside the VM's boot disk and recreate backups manually.
CUse persistent disks and detach them before deleting instances to keep data.
DUse ephemeral disks that delete automatically with the instance.
Attempts:
2 left
💡 Hint
Think about which storage survives instance deletion.