
Google Professional Cloud Developer
Get started today
Ultimate access to all questions.
You have a custom machine image used across multiple deployments, each as a separate managed instance group with its own template. Each deployment requires distinct configuration values, but you want to reuse the same machine image. You aim to provide these unique values to each deployment using native Compute Engine features.
What is the recommended approach?
You have a custom machine image used across multiple deployments, each as a separate managed instance group with its own template. Each deployment requires distinct configuration values, but you want to reuse the same machine image. You aim to provide these unique values to each deployment using native Compute Engine features.
What is the recommended approach?
Explanation:
The correct approach is to use instance template instance metadata. Instance metadata allows you to pass key-value pairs to instances during startup. Each managed instance group can have its own instance template with unique metadata values, enabling different configurations while using the same custom machine image. The application can retrieve these values from the metadata server at runtime, which is a common and out-of-the-box Compute Engine feature. Options like startup scripts (C) could work but are less flexible for configuration management. Persistent disks (A) and Cloud Bigtable (B) introduce unnecessary complexity and dependencies.