What is the primary purpose of using an instance template in Google Cloud Platform?
Think about how you can create multiple VMs with the same settings easily.
Instance templates let you save a VM configuration so you can create many VMs with the same setup, especially in managed instance groups.
Given the following instance template configuration snippet, what will be the machine type of the VM instances created from it?
resource "google_compute_instance_template" "example" { name = "example-template" machine_type = "e2-medium" disk { source_image = "debian-cloud/debian-11" auto_delete = true boot = true } network_interface { network = "default" } }
Look at the machine_type field in the configuration.
The machine_type field specifies the VM size. Here it is set to 'e2-medium'.
You want to automatically scale your web application based on CPU usage. Which architecture best uses instance templates to achieve this?
Think about how to automate scaling with instance templates.
Managed instance groups use instance templates to create identical VMs and can autoscale based on metrics like CPU usage.
Which practice improves security when using instance templates for VM creation?
Consider how to keep instances secure and updated automatically.
Including a startup script to patch VMs on boot helps keep them secure. Storing credentials in metadata or using overly permissive accounts is unsafe.
You update an instance template used by a managed instance group. What happens to the existing VM instances in the group?
Think about how managed instance groups handle updates to templates.
Updating an instance template does not change existing instances automatically. You must perform a rolling update or recreate instances to apply changes.