How to Create Instance Group & Auto Scaling in GCP

An instance group is a collection of virtual machine (VM) instances that you can manage as a single entity.

Compute Engine offers two kinds of VM instance groups, managed and unmanaged:

  1. Managed instance groups (MIGs) let you operate apps on multiple identical VMs. You can make your workloads scalable and highly available by taking advantage of automated MIG services, including: autoscaling, autohealing, regional (multiple zone) deployment, and automatic updating.
  2. Unmanaged instance groups let you load balance across a fleet of VMs that you manage yourself.

 

  • Login to google cloud platform portal.
  • Click on Compute Engine.
  • Select Instance groups.

 

Fig 1

 

  • Click on Create Instance group.

 

Fig 2

 

  • Provide Instance group name.
  • Select Location, Region & Zone.
  • Click on Instance Template.

 

Fig. 3

 

  • Click on Create a new Instance template.

 

Fig. 4

 

 

Fig. 5

 

  • Provide the Number of instances.
  • Click on Configure autoscaling & otherwise edit the autoscaling setting after the instance group has been created.

 

Fig. 7

 

  • If needs to Add HTTP Load balancing utilization or Stackdriver monitoring metrics then click on Add new metric otherwise leave the option.

 

Fig. 8

 

  • Provide the cool down period in seconds(Cool down period allows autoscaler to make better scaling decisions).
  • Provide the min or max number of instances.

 

Fig. 9

 

  • Click on Create health check.

 

Fig.11

 

 

Fig.12

 

Create Instance groups using Shell

 

Fig.13

 

  • Then, Copy & Run the following command has given in below image:-

 

Fig.14

 

Leave a Reply