When we’re talking about cloud migration, lift-and-shift, using Azure virtual machines is the most common Infrastructure as a service (IaaS) offering in Azure to make your projects “go cloud.” However, many real-world projects don’t fit so neatly into one category. When it comes to projects that require flexible scenarios and come with lots of specific requirements, I’ve found Azure Virtual Machines is the most flexible option.
In this post, we will look at deploying multiple virtual machines (VMs) on Azure to improve availability and scalability using an Azure Resource Manager ( ARM ) Template or otherwise via Virtual machine scale sets ( VMSS ).
Azure Virtual Machines types
Azure Virtual Machines provides scalable computing resources offered by Azure, there are multiple options:
- On-demand or Pay-as-you-go ( PAYG ), you can choose the appropriate SKU for your VM and will be invoiced monthly ( calculated on an hourly basis )
- Reserved Instances ( RIs) allows reserved infrastructure from 1 year to 3 years, for now, while choosing it you may save up to 72%
- Low priority VMs are allocated from surplus compute capacity from Azure which enables certain types of workloads to run for a significantly reduced cost or allowing users to do much more for the same cost, specifically widely used whiling working with batch processing on Azure with Azure Batch. To know more about it, you can refer the blog : Use low-priority VMs with Batch and Batch computing at a fraction of the price
In general, Azure VMs provide you with an operating system, storage, and networking capabilities, and they can run a wide range of applications.
Using Azure VMs can be an evolution than what we have done on-premises before. Compared to a traditional on-premises virtual machine, Azure VM allows to deploy a VM within minutes, and which can be quickly scaled up and down. You can pay only for what you use without buying and maintaining the physical hardware in compared to on-premises servers. Although users still need to configure, patch, and maintain OS and applications on the VM.
Classic Azure VMs vs. ARM Azure VMs
Today, it still exists two types of Azure VMs for some reason :
- Classic Azure VMs: Azure VMs deployed in classic deployment model. When users interact with classic mode resources from a command line such as Azure PowerShell, you are using Azure Service Management API calls (ASM). ASM is an old way of accessing Azure resources.
- ARM Azure VMs: Azure VMs deployed in Azure Resource Manager ( ARM ) model. ARM allows you to deploy Azure resources in groups called Resource Groups. When users interact with ARM using command-line tools such as Azure PowerShell, they are using ARM API calls. ARM model allows to deploy, manage, and monitor Azure resources as a logical group which is known as Azure resource group, it can be deployed also via ARM templates. The templates can be created to include a set of resources to be deployed as part of a cloud solution. Role-based access control (RBAC) policies can be applied to all resources in a Resource Group, it is also possible to specify “tags” to resources and help users keep track the usage of these resources.
Azure VMs in classic and arm model can be created via the Azure portal as shown in the following :
Creating Azure VMs via the Azure portal
Workloads can be deployed with Azure VMs
There is some workloads better fit for hosting on Azure VMs for example :
- Highly available service workloads with unpredictable growth workloads such as e-commerce websites with short-term increased sales of fad items, for example, black Friday.
- Steady workload scenarios where organizations simply want to offload their infrastructure to the cloud to cut down cost.
However, regulated environment workloads might be suitable candidates for a hybrid solution where only some highly available data is hosted in Azure and the more sensitive, regulated data is kept on-premises. All Microsoft software installed in the Azure virtual machine environment must be licensed correctly. The Microsoft server software support for Microsoft Azure virtual machines page lists the currently supported products and versions. Azure is the most cost-effective cloud for Windows Server and SQL Server, users can achieve the lowest cost of ownership when users combine the Azure Hybrid Benefit, to get more information, please check here.
Keep yourself up to date with the latest SKU
Virtual machines are available in several different size families. You can configure virtual machines with a variety of options for CPU, memory, and IOPS. To keep yourself update to date, please check the following page regularly :
In this post, we’ll also talk about some special VMs :
Dv3 and Ev3 for Nested Virtualization
In May 2017, Microsoft announced that Azure VMs such as Azure VM sizes Dv3 and Ev3 & will support nested virtualization. These new sizes introduce Hyper-Threading Technology running on the Intel® Broadwell E5-2673 v4 2.3GHz processor, and the Intel® Haswell 2.4 GHz E5-2673 v3. The shift from physical cores to virtual CPU’s (vCPU) is a key architectural change that enables us to unlock the full potential of the latest processors to support even larger VM sizes. To know more about Introducing the new Dv3 and Ev3 VM sizes.
Nested virtualization is a feature allows you to install the Hyper-V feature inside a Windows Server running on Azure VMs, making it very useful for training and demo scenarios. To know more about Nested Virtualization in Azure.
Dv3 and Ev3 for Nested Virtualization
“Burstable” B-Series VMs
One of the most common complaints about Azure Virtual Machine pricing is that it’s too expensive for small workloads. Its “Burstable” B-Series as an even more cost-effective and affordable cloud for lightweight workloads. This is for smaller workloads that do not utilize the full CPUs allocated, such as for web servers, small databases, or development, test, or QA environments.
The B-Series VMs work much differently than the other options in the VM Series. You pay for a baseline of vCPU performance utilization with the number of vCPU cores allocated. The new B-Series is $5 per month for the smallest size; the Standard B1s and the Standard B8ms offer 8 “burstable” vCPU cores for approximately $139 per month with a baseline of 135%. This means that the B8ms at its base is similar to other Single vCPU Core VM sizes, but it can burst to 800% vCPU performance utilization and use all 8 cores at 100% each for short periods.
Burstable B VM sizes
How to create an Azure Virtual Machines
Because virtual machines are suited for different users and purposes, Azure offers the following ways to create a virtual machine :
- Azure portal: You can check how to create a Linux VM and windows VM here via Azure portal.
- Azure PowerShell: You can check how to create a Linux VM and windows VM here .
- ARM Template: You can find the ARM template to create a simple Windows VM here.
- Azure CLI: Azure CLI is used to create and manage Azure resources such as Azure Virtual Machine from the command line or in scripts. Azure Cloud Shell is a web-based shell that is preconfigured to simplify using Azure tools. With Cloud Shell, you always have the most up-to-date version of the tools available, and you don’t have to install, update, or separately log in. To learn more, refer to the official documentation for creating Create an Azure virtual machine with Azure CLI and CloudShell.
Deploying Multiple Virtual Machines on Azure
VM Scale Sets help you deploy and manage a set of identical VMs. There are two basic ways to configure VMs deployed in a VM Scale Set:
- Use extensions to configure the VM after it is provisioned.
- Create VMSS via the latest custom image. Take note that VM Scale sets support up to 1,000 VM instances, however, if you create and upload your own custom VM images, the limit is up to 300 instances.
For some additional considerations, please refer to Designing VM Scale Sets for Scale.
Let’s take a look at how to create a Virtual Machine Scale Set (VMSS). When we are in the Azure Portal, we can click ‘ Create’ then ‘ Compute’, you can find the option VMSS as shown in the following :
Creating VMSS via the Azure portal
You can find more how to create a VMSS from Azure documentation Quickstart: Create a virtual machine scale set in the Azure portal.
Configuring scale out and scale up after creating VMSS
After the deployment, we can see that there are some related resources in the same resource group of the VMSS: We have created a public IP for the load balancer and a virtual network for our VMSS.
Even after the creation of VMSS, we can scale it up and out, and we can add a scale condition for the VM in the same VMSS.
Scale Sets support auto-scaling based on performance metrics. As the load on the VMs increases, additional VMs are automatically added to the load balancer. Consider Scale Sets if you need to quickly scale out VMs or if you need to autoscale. For more information on Scale Sets, please refer to What are virtual machine scale sets in Azure?
As companies transition to the cloud, knowing how to deploy multiple virtual machines will continue to be useful as you add flexibility and customization to your deployments, and especially as you think about topics like disaster recovery and high availability. Over time, I believe that we’ll turn to more and more serverless, which is what I’m working on now. The cloud is our future, and making it “normal” and easy to use and apply is our mission. I hope you’ll continue learning with me!
Published on 17 October 2017.
Categories: Microsoft Azure
Woman in STEM. She is a former Microsoft senior cloud computing technology evangelist currently working as a cloud solution architect, she is an Azure e-learning training courses Instructor and blog author on Microsoft Azure. She holds all Azure certifications, as well as CKA and CKAD and She, is mainly working on her contributions towards OSS, DevOps, Containers and Kubernetes, Serverless Computing, and IoT on Microsoft Azure in the community and help different size of business and partners succeed in Azure projects with focus on Azure Kubernetes and Azure DevOps. She can be reached out via Twitter @MelonyQ and her blog website : cloud-melon.com