Vm Image Types in GCP
- IN GCP we have custom images and machine images.
- Custom image:
- these are user defined images that you can create based on existing vmc instances
- they capture the disk state of the vm
- Machine image:
- These are more advance and comprehensive than custom iamges.
- They capture the state of vm instance, including all the disks, metdata, permissions and instance configurations
Custom image of a vm instance
- Lets create a machine image with browny webpage Refer Here
- Also lets install a stress tool
- steps
sudo apt update
sudo apt install nginx -y
sudo apt install unzip -y
sudo apt install stress -y
cd /tmp
wget https://www.free-css.com/assets/files/free-css-templates/download/page296/browny.zip
unzip browny.zip
sudo mv browny-v1.0/ /var/www/html/browny
- After the installation, stop the vm
- Navigate to Images => Create Image => Select Disk


- Now create a vm instance by selecting custom image as boot disk

Auto scaling and load balancing in GCP
- Lets try realizing this architecture

- Lets create a new network which has subnets in us-central1
- Lets try creating a zonal based scaling
- For screenshots refer classroom video
LoadBalancers in GCP
- Refer Here for load balancing in gcp
- Layer 4 vs Layer 7 load balancer Refer Here
-
We will use an external regional loadbalancer for the above use case
Multi Region load Balancing
- Overview

- Create a network with subnets in two regions
- Have two templates and create two instance groups
- Now create a External Network load Balancer to send the requests across reqions
- refer classroom video for screenshots
