nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #8

Your application is built as a custom machine image. You have multiple unique deployments of the machine image. Each deployment is a separate managed instance group with its own template. Each deploym

The correct answer is D. Place the unique configuration values in the instance template instance metadata.. Compute Engine instance metadata is a built-in, first-class feature that lets you attach arbitrary key-value pairs to an instance or instance template. At boot time, any process on the VM (typically the startup script) can query the metadata server at http://metadata.google.inter

Configuring Compute Engine instances and deployments

Question

Your application is built as a custom machine image. You have multiple unique deployments of the machine image. Each deployment is a separate managed instance group with its own template. Each deployment requires a unique set of configuration values. You want to provide these unique values to each deployment but use the same custom machine image in all deployments. You want to use out-of-the-box features of Compute Engine. What should you do?

Options

  • APlace the unique configuration values in the persistent disk.
  • BPlace the unique configuration values in a Cloud Bigtable table.
  • CPlace the unique configuration values in the instance template startup script.
  • DPlace the unique configuration values in the instance template instance metadata.

How the community answered

(46 responses)
  • A
    4% (2)
  • B
    2% (1)
  • C
    9% (4)
  • D
    85% (39)

Explanation

Compute Engine instance metadata is a built-in, first-class feature that lets you attach arbitrary key-value pairs to an instance or instance template. At boot time, any process on the VM (typically the startup script) can query the metadata server at http://metadata.google.internal/computeMetadata/v1/ to retrieve these values without any additional infrastructure. Each deployment's instance template can carry its own unique metadata entries while all templates reference the same custom machine image. Option A (persistent disk) requires provisioning and managing additional disks and is not designed for configuration data. Option B (Cloud Bigtable) requires application code changes and network access to an external service-not an out-of-the-box Compute Engine capability. Option C (startup script) would require embedding the unique values directly into the script, meaning each deployment needs a different script, which contradicts the goal of using the same image and a clean separation of config from code.

Topics

#Compute Engine#Instance Metadata#Managed Instance Groups#Configuration Management

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice