Configuring Managed instance group
- Create Image of Compute Engine VM
- Creating an Instance template
- Go to Instance templates section and on click Create Instance Template
- Name: web-instance-template
- Keep machine as default
- Boot Disk
- Click Change
- Select Custom
- Image: webserver (created in step 1)
- Firewall: Allow HTTP traffic
- Click Create
- Creating Instance group
- Go to Instance Group and click on Create Instance Group
- Name: web-mig
- Location: Multiple Zone
- Instance template: web-instance-template
- Minimum number of instances: 2
- Click Create
- Auto-scaling in action
- Go to VM Instances section
- SSH to both instance created by Instance group
- Install stress and run on both instances, this will create CPU load on both instance
sudo yum install -y epel-release
sudo yum install -y stress
sudo stress -c 70
- Now since there is load on instance Instance group will trigger auto-scaling and a new instance will be automatically created
Comments are closed, but trackbacks and pingbacks are open.