An instance template is a saved set of VM settings, such as machine type, boot disk image, labels, metadata, and networking, that you can use to create VMs again and again with the same configuration. A managed instance group, or MIG, is a collection of identical VMs created from one template, with services such as autoscaling and autohealing built in.
Templates matter once you need more than one VM. Instead of filling in the same form repeatedly, and drifting slightly each time, you define the VM once. Two facts shape how you work with them. A template cannot be edited after it is created. And a group is only as good as its sizing settings, which decide how many VMs run and what you pay.
This walks through creating a template, creating a managed instance group from it, and choosing between a fixed number of VMs and autoscaling, then covers how to change a template later.
Prerequisites:
Open the console, Open the compute engine > Instance Templates

Click Create instance template.

The form is much like creating a single VM. Set the machine type, boot disk, networking, and anything else the VMs should have.

Click Create once you have chosen the settings. The instance template is created.

Google Cloud has two kinds of instance template. A global template can be reused in different regions. A regional template can be used only in the region it was created in, which helps if you want to reduce cross region dependency or meet data residency rules. Either kind can be used to create VMs and managed instance groups.
To create a group from the template, click the instance template in the list.

Click Create instance group.

The form looks like creating a VM, but here you create several VMs with the same specification. Give the group a name, choose the location, then choose the instance template.

Select the instance template you want, then open the Autoscaling mode setting. You now choose one of two paths. Pick a fixed size, or turn autoscaling on.

Choose Don’t autoscale, then enter the number of instances you want. The group creates exactly that many VMs, and keeps that number running.

If you want the group to grow and shrink, choose the autoscaling mode that adds and removes instances, then choose CPU utilization as the signal and set a target. The autoscaler compares the group’s average CPU against that target. If the average is above it, the group scales out, up to your maximum. If it is below, the group scales in, down to your minimum.

Enter the minimum and maximum number of instances, then click Create. With autoscaling on, the group runs between those two numbers depending on load. The original page said it creates only the specified number of instances, which is true only for the fixed size in Option One.
