Google PCA gcloud compute instances create --image Practice Question
When creating a Compute Engine instance from a custom image stored in another project, which gcloud flag is required?
⚠ Common exam trap
Candidates often think that `--image` is sufficient, but when using an image from another project, `--image-project` is mandatory; otherwise the instance creation will fail.
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
✓
--image-project
When creating a Compute Engine instance from a custom image stored in another project, the `--image-project` flag is required to specify the project that contains the image. Without this flag, gcloud defaults to the current project and will not find the image. The `--image` flag is also required to specify the image name, but the question specifically highlights the cross-project situation, making `--image-project` the distinctive required flag.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
--image-project
Why this is correct
The --image-project flag specifies which project owns the custom image, satisfying the requirement to create an instance from an image stored in another project. Without it, gcloud searches only the instance's own project and fails to resolve the image reference.
- ✗
--source-instance
Why it's wrong here
--source-instance creates an instance from an existing instance's properties, not from a stored image. It would be correct when cloning a running instance's configuration, but creating from a custom image in another project requires --image with the full projects/PROJECT/global/images/IMAGE path.
- ✗
--image
Why it's wrong here
Incorrect. While `--image` is necessary to specify the image name, it is not the flag that addresses the cross-project requirement. The combination of `--image` and `--image-project` is needed, but the question asks for the flag required specifically because the image is in another project.
- ✗
--image-family
Why it's wrong here
--image-family resolves the newest image in a family, so it cannot target a specific custom image held in another project; the required flag is --image with a fully qualified project path. It is tempting because image families suit automated builds where always taking the latest version is intended.
Go deeper
Related to this question
Learn chapter
Google Kubernetes Engine (GKE)
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.
Key term
Image
An image is a complete snapshot of a system's operating system, applications, and settings, used to deploy or restore computing environments quickly.
About these practice questions
Courseiva writes every PCA question from scratch — 807 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or 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 PCA 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 PCA exam.