Step-by-Step Guide to Create a Virtual Machine Scale Set in Microsoft Azure

Step-by-Step Guide to Create a Virtual Machine Scale Set in Microsoft Azure

Virtual Machine Scale Sets (VMSS) in Microsoft Azure provide a way to deploy and manage a set of identical virtual machines (VMs) that can automatically scale up or down based on demand. Common use cases include hosting scalable web applications, batch processing, or handling high-performance computing workloads. This guide walks you through creating a Virtual Machine Scale Set in Azure.

Prerequisites

Before starting, ensure the following:

  1. You have an active Azure subscription.

  2. Access to the Azure portal.


Step 1: Log in to Azure

  1. Navigate to the Azure portal.

  2. Sign in with your credentials.


Step 2: Create a Resource Group

Azure resources must be placed in a resource group. If you don’t have one already, create one:

  1. Search for Resource groups in the search bar.

  2. Click Create.

  3. Enter a name for your resource group.

  4. Select a region

  5. Click Review + Create, then Create.


Step 3: Create the Virtual Machine Scale Set

  1. In the Azure portal, search for Virtual Machine Scale Sets and click Create.

  2. Configure the Project details and Scale set details:

    a. Select your Subscription and Resource Group.

    b. Enter a Scale set name.

    c. Choose a Region.

    d. Select Availability zones

  3. Configure Orchestration and Scaling mode:

    • Choose between Flexible or Uniform orchestration mode. For our case, we have chosen Flexible mode to achieve high availability at scale with identical or multiple virtual machine types.

    • Select the scaling mode. We selected Autoscaling mode in this case to scale the virtual machine set based on CPU metric.

    • Click Configure to update the autoscaling configuration if desired.

    • On the Scaling configuration page, click the edit pencil icon to change the default scaling condition. You can change the Default instance count, Instance limit minimum and maximum counts, CPU threshold and so on.

    • Click Save after making the changes.

  4. Configure the Instance details.

    • Select an Image (e.g., Ubuntu Server).

    • Choose a VM Size (e.g., Standard_B1s - 1 vcpu, 1 GiB memory).

  5. Configure the Administrator Account:

    • Choose Authentication type. You can choose between Password and SSH authentication. We choose SSH public key in this demo

    • Enter username and provide an SSH public key for Linux VMs or generate new key pair.

  6. Complete additional configurations (e.g., Networking, Scaling, and Management).

Click Review + Create, then Create.


Step 4: Test Your Scale Set

  1. Navigate to your scale set in the Azure portal.

  2. Check the Instances tab to see the VMs running.


Conclusion

Creating a Virtual Machine Scale Set in Azure is straightforward and allows you to manage and scale your applications efficiently. With autoscaling, you can optimize costs and ensure high availability. Explore Azure’s documentation for advanced configurations.