Azure Classroom notes 26/Nov/2023

Azure Virtual Machine Scaleset (VMSS)

  • Virtual machine scaleset allows to perform automatic horizontal scaling based on metrics such as cpu, network, memory or even custom metrics
  • To Create a virtual machine scaleset we need a image. Here we have two choices, use
    • OS image
    • Custom image with application preinstalled
  • Using Custom image is widely adopted option.
  • We will be creating a VMSS using the image which we stored in compute gallery
    Preview
  • Refer Here for official docs
  • Refer Here for quick start
  • We have create a vmss with
    • scale condition: when average cpu utilization > 90 % for last 5 minutes increase 1 vms and when average cpu utilization < 50% for last 5 mins decrease 1 vm
    • min vms 1
    • max vms 5
    • No loadbalancer
    • Selected public ip for each vm
      Preview
      Preview
      Preview
      Preview
      Preview
  • To scale these machines the condition is cpu utilization should be greater than 90% for 5 minutes.
  • To put artifical load on cpu lets use the stress tool
# login into vm and execute the following command
stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 15m -v
  • we have observed the number of vms increased and decreased based on dynamic metrics.

Virtual Machine Image Auto Upgrade

  • The goal of this activity is to check if the vm image update to the compute gallery image definition will deploy into vmss
  • Details

    • We have a version 1.0.0 where vmss was created
    • Now we have a new release 1.1.0. When we have a new release how will vmss handle this
  • Lets have a gallery with some image defintion at version 1.0.0.
  • Create a vmss with this image
  • Now add one more version of the vm image 1.0.1 to the gallery and wait for the vmimage to be deployed to vmss
  • Note:
    • Try using any html website templates and copy that to /var/www/html to give a better look and feel
  • Next steps:
    • Create a vmss with version 1.0.0
    • ensure you are able to access application using load balancer
    • Now create a new latest version and wait for web pages to be loaded.

Published
Categorized as Uncategorized Tagged

By continuous learner

devops & cloud enthusiastic learner

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Animated Social Media Icons by Acurax Wordpress Development Company

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube