0
0
GCPcloud~20 mins

Startup scripts for automation in GCP - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Startup Script Automation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
Startup Script Execution Timing on GCP VM

You add a startup script to a Google Compute Engine VM instance metadata to install software on boot. When exactly does this script run?

AOnly once, the very first time the VM boots after creation.
BEvery time the VM boots or restarts.
COnly when the VM is stopped and then started again, not on reboot.
DOnly when the VM is manually triggered to run the script via SSH.
Attempts:
2 left
💡 Hint

Think about when startup scripts are designed to automate setup.

Configuration
intermediate
2:00remaining
Correct Metadata Key for GCP Startup Script

Which metadata key must you use to add a startup script that runs on a Google Compute Engine VM instance?

Astartup-script
Buser-data
Cinit-script
Dboot-script
Attempts:
2 left
💡 Hint

Check the official GCP documentation for the exact metadata key name.

security
advanced
2:00remaining
Security Risk of Startup Scripts in GCP

What is a major security risk when using startup scripts on GCP VM instances?

AStartup scripts can expose sensitive data if they contain secrets in plain text.
BStartup scripts always run with limited permissions, so they cannot modify system files.
CStartup scripts are encrypted by default, so there is no risk of exposure.
DStartup scripts cannot access network resources, so they pose no security risk.
Attempts:
2 left
💡 Hint

Consider what happens if secrets are stored directly in scripts.

Architecture
advanced
2:00remaining
Automating Software Installation with Startup Scripts

You want to ensure a custom monitoring agent is installed and running on all new VM instances automatically. Which approach best uses startup scripts for this?

AManually SSH into each VM after creation and run the installation commands.
BUse a firewall rule to block all traffic except monitoring agent ports.
CCreate a snapshot of a VM with the agent installed and use it as a base image for new VMs.
DAdd a startup script in instance metadata that downloads, installs, and starts the agent on every boot.
Attempts:
2 left
💡 Hint

Think about automating installation at boot time without manual steps.

🧠 Conceptual
expert
2:00remaining
Effect of Startup Script Failure on VM Boot

If a startup script on a GCP VM instance fails during execution, what is the effect on the VM's boot process?

AThe VM boots but disables network interfaces until the script succeeds.
BThe VM fails to boot and enters a stopped state automatically.
CThe VM continues booting normally; the startup script failure does not stop the boot.
DThe VM boots but deletes the startup script from metadata automatically.
Attempts:
2 left
💡 Hint

Consider how startup scripts relate to the VM's core boot process.