Google ACE Practice Question: Ensuring Successful Operation of a Cloud Solution
An engineer needs to attach an existing persistent disk to a Compute Engine instance. They have created the disk using 'gcloud compute disks create'. Which command should they use to attach it?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
gcloud compute instances attach-disk
'gcloud compute instances attach-disk' attaches a disk to an instance. 'gcloud compute disks attach' does not exist. 'gcloud compute instances add-disk' is not a valid command. 'gcloud compute disks resize' resizes the disk.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
gcloud compute disks resize
Why it's wrong here
gcloud compute disks resize changes the size of an existing persistent disk in a specified zone or region; it does not alter which instance the disk is attached to. Because the command targets the disk resource itself, it has no effect on attachment state, so it cannot be used to attach that disk to an instance.
- ✓
gcloud compute instances attach-disk
Why this is correct
gcloud compute instances attach-disk is the correct command: it attaches an existing zonal or regional persistent disk to a specified Compute Engine instance, using --disk and optionally --device-name. It works on both running and stopped instances, and it ensures the disk becomes visible as a block device in the instance's guest OS.
- ✗
gcloud compute instances add-disk
Why it's wrong here
gcloud compute instances add-disk is not a valid gcloud compute command; the gcloud CLI does not implement an add-disk subcommand under the instances resource group. The only operational subcommands for existing disks under instances are attach-disk and detach-disk, so this option is simply an incorrect command name.
- ✗
gcloud compute disks attach
Why it's wrong here
gcloud compute disks attach is invalid because the disks command group does not include an attach action; disk attachments are operations performed on instances, not on disks themselves. Valid subcommands under gcloud compute disks include create, delete, describe, list, move, resize, snapshot, and update, while attachment is handled by gcloud compute instances attach-disk.
Go deeper
Related to this question
Learn chapter
Google Compute Engine
Key term
Persistent Disk
Persistent Disk is a durable, high-performance block storage service for Google Cloud virtual machines that retains data even after the VM is shut down or deleted.
Key term
Compute Engine
Compute Engine is Google Cloud's Infrastructure-as-a-Service (IaaS) offering that lets you create and run virtual machines on Google's infrastructure.
About these practice questions
This ACE question is part of Courseiva's 769-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.