DEV Community

Cover image for Create An Azure Virtual Machine Scale Set(VMSS) From A Custom Image.
Maxwell Wokocha C.
Maxwell Wokocha C.

Posted on

Create An Azure Virtual Machine Scale Set(VMSS) From A Custom Image.

What is a Virtual Machine Scale Set (VMSS)?

An Azure Virtual Machine Scale Set allows you to create and manage a group of load-balanced VMs. The number of VM instances can automatically increase or decrease in response to demand or a defined schedule.

Skills Needed:

. Create a Virtual Machine.
. Add and Format Disk in the Virtual Machine.
. Create an Azure Compute Gallery.
. Capture the Virtual Machine Image.
. Create a Virtual Machine Scale Set.

No 1. Create a Virtual Machine.

. Go to Azure portal and search for Virtual Machine.

. +Create Virtual Machine.

. On the Basics tab create a new Resource Group.

. Name Virtual Machine and Choose a Region.

. Choose Availability Zone.

. Choose Security type.

. Choose Image.

. Create an Admin Account for the Virtual Machine.

. Carefully select the Inbound Ports and Check the box to Confirm the eligibility of the image chosen.

. On the Monitoring Blade disable Boot Diagnostics then Review and Create.

Disabling Diagnostics prevents the main computer in the cloud from monitoring your activities.

. After passing validation then Create.

. After Deployment, then go to Resources.

No 2. Add and Format Disk in the Virtual Machine.

. On the Overview of the Virtual machine go to the Settings blade and select Disks.

. Create and Attach a New Disk.

. Name Disk, and choose the Disk Size then Apply.

. Connect the Virtual Machine, remote into the Virtual Machine via RDP and Format the Disk.

. Download RDP File and Login.


. In the Virtual Machine, search for Disk Management in the search bar.

. Right click on the unallocated Disk and click on New Volume then Next.

Disk successfully formatted and provisioned for use.

No 3. Create an Azure Compute Gallery.

. In Azure Portal, search for Azure Compute Galleries.

. +Create.

. Choose the same Resource Group as the Virtual Machine created, Name the Azure Compute Gallery then Review and Create.

. Create.

No 4. Capture the Virtual Machine Image.

. Go to the Virtual Machine and the Overview page click on Capture and select Image.

. On the Basics tab, the Subscription, Resource Group and Region must be the same.

. Enable Image Share to Azure Compute Gallery and Choose the created Gallery to save the Captured Image.

. Choose Operating System State.

Note: There are two types of Operating System state- Generalized and Specialized.

  • Generalized are Virtual Machines created from this image require hostname, admin user, and other Virtual Machine related setup to be completed on first boot.
  • Specialized are Virtual Machines created from this image are completely configured and do not require parameters such as hostname and admin user/password.

. Give the Captured Virtual Machine Image a Target Name.

. Give it a Version number and how long it should be operational for.

. Give it a Replication Number then Review and Create.

. Create.

Note: When you click on create to create the captured virtual machine image it immediately shuts down the main virtual machine.

No 5. Create a Virtual Machine Scale Set.

. Once Deployment of the Captured Virtual Machine is complete then go to Resource.

Note: A Captured VM Image can be used to:

  • Create a Virtual Machine of the exact specification as the Virtual Machine is created out of.
  • A VMSS that is a Virtual Machine Scale Set.

. +Create VMSS.

. Take the default on Subscription, Resource Group, and Region then Give the VMSS a Name.

. Select Orchestration Mode.

Note: The two types of Orchestration Mode:

  • Flexible is when you want the VM to be highly available with the same specification.
  • Uniform is when you want a large scale stateless workload, which means it can be of different specifications.

Scaling Mode is set at No Scaling because of the purpose of this article as we do not want it to spring up virtual machines automatically.

. Review and Create.

. Create.

. We have successfully created a Virtual Machine Scale Set that is highly available.

Thanks once again for your time, until my next post.

Top comments (0)