Google ACE Setting Up a Cloud Solution Environment Practice Question
A developer is using Cloud Shell and wants to ensure that their gcloud configuration persists after the Cloud Shell session ends. They have set the compute and access settings using `gcloud config set`. What should they do to keep these settings for future sessions?
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
✓
The settings are automatically preserved because Cloud Shell's home directory persists
gcloud configurations are stored in the user's home directory and persist across Cloud Shell sessions because the $HOME directory is persistent (with 5GB of persistent disk storage). No additional action is needed.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
They need to create a startup script to apply the settings each time
Why it's wrong here
A startup script is unnecessary because Cloud Shell already persists user-level files across sessions. The gcloud CLI stores its active configuration, including project, region, and credentials, under $HOME/.config/gcloud, which resides in Cloud Shell's persistent 5 GB home directory. No per-session initialization is required, and a startup script would simply re-apply settings that are already saved.
- ✓
The settings are automatically preserved because Cloud Shell's home directory persists
Why this is correct
Cloud Shell provisions an ephemeral VM but attaches a persistent 5 GB home directory for each user. gcloud configurations are stored as files under ~/.config/gcloud, so whenever the developer runs `gcloud config set project`, the value is written to disk and remains available in future sessions. When the session ends, any new VM in a future session mounts the same home directory, preserving the settings automatically.
- ✗
They must run `gcloud config configurations save default` before ending the session
Why it's wrong here
There is no `gcloud config configurations save` subcommand; the gcloud CLI automatically persists an active configuration the moment `gcloud config set` is executed. Configuration files are written to $HOME/.config/gcloud/configurations/config_default, and switching or renaming configurations is done with `gcloud config configurations activate` or `create`, not by an explicit save action. Running this command would fail before helping, so it is not a required step.
- ✗
They must use `gcloud config set --persist` flag
Why it's wrong here
`gcloud config set` does not support a `--persist` flag; the command writes to the active configuration file on disk by default. The fact that the value is used by the current shell can make it appear temporary, but it is actually stored under `$HOME/.config/gcloud` and will be loaded in future Cloud Shell sessions. There is no alternate mode that needs to be enabled.
Go deeper
Related to this question
Learn chapter
Google Cloud Platform Overview
Key term
Cloud Shell
Cloud Shell is a browser-based command-line interface that gives you temporary access to a cloud provider’s infrastructure, complete with pre-installed tools and a file system, without needing to install anything on your own computer.
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.
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.