// I need to

ModernizeUpgrade without breaking it RescueFix what someone else started Build NewTurn an idea into a product Reach More PeopleGet found, get used, include everyone

// Company

Case StudiesExpertiseAbout + CareersResourcesContact Book a call →
≡articleBuild New

Azure Load Balancing: How to Scale Out VMs

Part 2 of a series on scaling with Azure: configure an Azure Load Balancer and backend pool, and compare manual VM scaling with Azure Scale Sets.

Art+Logic Sep 14, 20175 min read

From the Art+Logic archive · written in 2017. The tools may have moved on; the thinking still holds.

Azure Load Balancing: How to Scale Out VMs

Part 2 of the Blog Series: Cloudy with a Chance of VMs: Scaling Up & Out with Azure explains how to configure an Azure Load Balancer and compares Manual VM scaling to Auto-Scaling via Azure Scale Sets.

Backend Pool configuration

Cloud Computing shines in a cost-benefit analysis; virtually unlimited resources are available at a moment’s notice, and resources must only be paid for if and when they are needed. Unlike dedicated servers, Cloud-based resources scale quickly & automatically to respond to peak loads. They can also provide fault tolerance via replication both within and between data centers.

Auto Scale Sets vs. Manual Availability Sets

As described in Part 1 of this blog series, despite the power of Azure’s WebApp solutions, a real-world application often needs the support of a good, old-fashioned server. For example, Azure Web Apps and Web Jobs do not support:

If a single premium-tier VM can’t handle peak load, an Azure Load Balancer can delegate to a pool of VMs.

Two main options exist when scaling-out pools of Azure VMs:

Each of these options has its own pros & cons, but a few simple rules-of-thumb apply:

Auto-scaled Sets of VMs spun up from a generalized VM disk image

You can create an Azure Scale Sets of either standard (stock) VMs or from a custom VM image. It can be quite a challenge to generalize a custom VM image, since it must automatically spawn in a usable state to be auto-scaled correctly. Once you have customized your VM as desired, the following steps are recommended:

  1. Backup your VM image (create a copy in a separate storage location, since Azure won’t let you rename it)
  2. Warning! Be sure to backup your VM image before generalizing it
  3. Use the Sysprep utility to generalize the custom VM image
    • This will allow it to be used in a Scale Set, but you can no longer run the VM from the original VM disk image.

Once you’ve got your VM image ready, this Azure tutorial explains how to create a Virtual Machine Scale Set with the Azure portal. These Azure docs provide a more general overview of further options available via command-line Powershell command-lets. For example, Connecting to a VM in a Scale Set can be quite tricky. You can:

Manually-scaled Availability Sets of VMs cloned from a specialized VM disk image

In the simplest case (presented in Part 1 of this blog series), a single VM can be cloned from a specialized VM image into the existing Availability Set targeted by a custom-configured Azure Load Balancer.

  1. !!! Create the new VM in the Availability Set of the Load Balancer I.e., You cannot reconfigure the Availability Set after VM creation
  2. Upon creation, manually add the VM to the Backend Pool of the Load Balancer I.e., Membership in an Availability Set does not automatically add a VM to a Load Balancer’s Backend Pool
  3. See Azure documentation for details of VM creation from a .vhd (stored) Image

Azure Load Balancer configuration

Load Balancer configuration in Azure, while fairly well-documented, can be confusing due to the many types of load balancer (interal vs. internet-facing) and configuration tools available: Azure Portal, command-line (CLI) and ARM templates.

This blog explains how to use the Azure Portal to configure a public-facing, internet IP addressed load-balancer to provide restricted access to a Backend Pool of VMs providing custom TCP/UDP services as per the offical Azure documentation.

Similar documents descsribe many other methods (e.g., ARM) and types (e.g., internal) of load balancer configuration provided by Azure:

Frontend IP configuration

This is the easy part: Create a static or dynamic public IP address or chose an existing one.

Health Probe configuration

A Health Probe allows a Load Balancer’s rules to determine the health of each node in An Availability or Scale Set. The Load Balancer targets only the subset of healthy nodes.

The default TCP or HTTP probes allow probe interval & failure count to be configured. You can also create a custom probe.

health probe configuration
health probe configuration

Load Balancing rule configuration

Load Balancing rules work much like NAT rules: they map a TCP or UDP request from a front-end port to a back-end port. In addition, the Load Balancer rule also specifies:

configure Load Balancing Rules
configure Load Balancing Rules

Once your Load Balancer is running, you can enable Diagnostics settings to steam logs to storage, events or Log Analytics with Alerts, Health Probe status and custom metrics.

Summary

Auto Scale Sets & Availability Sets of Azure VMs each have their pros & cons. Once the multitude of options are better understood, Azure VMs can be customized to scale out legacy applications or auto-scaled off-the-shelf to support the latest trends such as Azure’s new Ethereum Consortium Blockchain solution template, which will be the topic of a future blog: Blockchaining the Ether: Mine Your Own Cryptocurrency in Azure.

keep going

More to explore in Build New.

All Build New resources →
let's talk

Got a problem like this one?

Tell us what's stuck. A real person replies within one business day.

Talk to our team →

Talk to people who know software, not a sales script.

Your first call is with Aja, our VP of Sales. He'll help make sure you're solving the right problem. Here's what you'll cover together:

  1. What you're trying to accomplish

    The business goal first, then the technology.

  2. Possible approaches

    And the tradeoffs of each, in plain language.

  3. Risks you may not have considered

    Technical and business, before they cost you.

  4. Whether AI changes the math

    What's practical, and what's just hype for your project.

  5. Sensible next steps

    Even if the right next step is not us.

book-a-call.ics

Loading the scheduler…

Open the booking page →

Some problems are easier to explain in writing. Send us a few lines about what you're working on, and we'll reply within one business day. Helpful to include:

  1. What the software does, or should do
  2. What's stuck, or what's worrying you
  3. Any deadline or budget you have in mind
note.md

Loading the form…