What is a Virtual Machine in Azure? Explore Types & Uses of Virtual Machine

What is a Virtual Machine in Azure? Explore Types & Uses of Virtual Machine

09 May 2024
Intermediate
12.6K Views
21 min read
Learn via Video Course & by Doing Hands-on Labs

Azure Developer Certification Course (Az-204)

Azure Virtual Machine: An Overview

Azure Virtual Machines are on-demand computing resources or virtual machines offering of Microsoft Azure. With Azure Virtual Machines we get more control over the environment to customize the development environment or hosting. We'll explore more about What is a Virtual Machine?, Why use Virtual Machines?, What are the uses of Virtual Machines and many more in this Azure Tutorial. To make things easier for you, ScholarHat brings a comprehensive skill-oriented Azure Certification to the nitty-gritty of the Azure.

What is a Virtual Machine in Azure?

A Virtual machine is a ready-made computer system that has been made available by Visualization concept. That means, a VM is a copy of some part of shared resource in a data center to be optimized and used according to the need. We can install operating system of our choice, configure networks to connect and use shared storage. We can typically use a VM as a service when required and shut down the system when not in use. The Azure Virtual Machines are listed under Infrastructure as a service (IaaS) category in Azure. In fact, the concept behind the Azure Virtual Machine is the same that runs the entire cloud platform – Virtualization.

What is a Virtual Machine in Azure?
Virtualization - This is the same as it sounds- the process of sharing resources like compute, Storage, network and cloud service so that it is virtually available. We can create a virtual machine (VM) in our own system too by sharing the Hardware configurations. Similarly, in large data centres, Cloud service providers share some physical servers to be made available to many cloud service consumers by the process called virtualization. Azure VMs are part of hardware virtualization. An advanced topic will be discussed in a separate section for software virtualization called Containerization.

Why Azure Virtual Machine?

It is always a question in the mind of developer to choose between Azure PaaS Services and Azure IaaS Services to build and develop cloud-based solutions that allows to make use of best features in Azure. In such scenarios, it is important to understand the capabilities of Azure IaaS and Azure PaaS. Having learnt already about the Azure PaaS section in previous articles, let us try to understand some features and capabilities of Azure VMs

  1. More Control – With Azure VMs, Developer have more control over the development environment which is very helpful in case of building a highly secured architecture for a complex solution. Developers can choose operating system, Networking, Storage connections etc. to build a sandbox solution.

  2. Easy Diagnostics – Azure VMs provides the facility to troubleshoot issues with options like remote debugging, event logs, IIS logs, application logs etc.

  3. Alerts – We can trigger actions and alerts based on metrics of computing resources consumed by VM.

  4. Pricing – We can shut down and stop the VMs if not in use. A stopped VM will not incur any charge. Restarting the VM will maintains its state based on persistent disks.

  5. Scaling – We can scale up/down and out/In the Virtual machines. Auto scale feature is also there to support based on some metrics. For example, scale out to 5 instances when CPU utilization is greater than 70% for more than 5 minutes.

  6. Scale Sets – Virtual Machine Scale Sets are group of VMs with identical configuration and will be managed by a load balancer.

Virtual Machine Size

In Azure Portal, we can create a VM from the available list of the pre-loaded Operating system from the marketplace like Windows Virtual machine, Linux Virtual machine. Both Windows and Linux virtual machines have similar size and type of VMs available in the marketplace.

Types of Azure Virtual Machine

  1. General purpose – Sizes: Av2, B, Dv2, Dv3, DSv2, Dsv3 These sizes of Azure VMs are generally used for small or medium traffic web servers and can be used as a development or test environment. It has a balanced CPU to memory ratio.

  2. Compute optimized - Sizes: F, Fs, FSv2 This category is optimized for running heavy background work loads. This size group is suitable for medium traffic web server and has high CPU to memory ratio.

  3. Memory Optimized – Sizes: Ev3, ESv3, G, M, GS These VMs have High memory to CPU ratio and recommended for relational databases and in memory analytics.

  4. Storage Optimized – Size: Ls This VM category is suitable for large databases like No SQL and Big Data storage. It has high through put and IO operations.

  5. GPU optimized -Sizes: NV, NC, NCv2, NCv3 GPU optimized VM sizes are specialized virtual machines available for high density graphical rendering work or video editing. These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads.

  6. High Performance – Size H This is the highest power category VM with highest throughput and network interfaces.

Virtual Machine Prices

Azure VM has two kind of pricing modals - Pay as you Go and Reserved Virtual machine Instance.

  1. Pay as you Go – This modal charge only for the time compute resource like Azure VM is used. It does not have any long-term commitment or any fixed monthly charges. We can scale out or even stop the VM in order to utilize efficiently and reduce bills.This kind of plan works for short term projects with un-predictable business requirements. Developers try out the stability of application in this plan.

  2. Reserved Instances – This plan brings an advanced purchase option for a reserved VM instance for a period of 1 or 3 years. With this, users get up to 72 % price savings than pay as you go plan. Reserved Virtual machines can easily be replaced with another one in case of any downgrade in performance. This plan suits with stable traffic on applications deployed on Azure VM. Software development with the fixed budget can prefer having a reserved Azure VM.

Important Information

Currently, Azure has put a default quota limit of 20 for the number of Azure VMs per subscription in a specific region. This should be kept in mind while architecting complex solutions. This can be further increased by raising a support ticket.

Virtual Machine Architecture

Azure VM is actually dependent on many other components. Lets deep dive into the Architecture.

Virtual Machine Architecture

Source: docs.microsoft.com

Resource Group – A resource group a logical container for all related resources based on the lifetime of resources. This also helps to provide access to users for a particular set of resources attached to same resource group.

Virtual machine - This can be created in Azure by portal, PowerShell or Azure CLI from the list of published images or by a custom image VHD file uploaded into Azure Blob.

Temporary disk -The VM also has a temporary disk stored on a physical drive on the host machine. It is not persisted during reboot events.

Virtual network – VMs can be deployed in a separate Virtual network (VNet) that can be divided into multiple subnets to support different layers of application architecture. Each Subnet should be associated with different Network Security Group (NSG) with defined inbound and outbound rules which takes care of allowing or denying web traffic.

Network Interface – The Network Interface (NIC) allows the VM to be configured for the Virtual Network.

Public IP – A public IP address is by default added with a VM. This is used to communicate with VM from outside like Remote Desktop.

VM Availability Sets

In order to ensure high availability of Azure VM Solutions, there is a unique feature called Availability Sets. This manages the VMs by deploying them in different cluster nodes in data centers. To understand Virtual Machine Availability Sets, we need to first understand these two terms

  1. Fault Domain

    A set of racks in a data centre that has a common power source. This means that if the power supply goes off, the VMs deployed in those set of racks will shut down. Like how we organize bookshelves in a library, a particular shelveset for a particular section of books can be considered to a fault domain.

  2. Update Domain

    One rack in a Fault domain is called update domain. This can be considered as one unit in a cabinet of hardware or one unit of the subsection in a book shelve. Multiple update domains are part of a fault domain. If the power goes off for the fault domain, the update domains automatically go down.

VM Availability Sets

To meet the SLA of 99.95%, it is recommended to group one or more virtual machines in an Availability Set. This ensures that in case of planned or unplanned maintenance activities, at least one VM is up and running. By default, Azure deploys the virtual machines in an availability set in 3 Fault domains and 5 update domains. We can configure it to use up to 20 update domains. It is recommended to have different availability sets for web servers and API servers. We cannot assign existing VMs to an Availability Set. We should first create an availability set and then while creating VMs we should associate Availability Sets to VMs.

Scaling

We can perform scale up/down and Scale out/in operations on virtual machines.

Vertical Scaling

In vertical scaling, the size of the VM is changed. Scale up for VMs is to upgrade the size of VM to a higher level. This will require reboot of the system and that will have an outage. Similarly, scale down of VM instance is to downgrade the size of VM.

Vertical Scaling

Horizontal Scaling

Horizontal scaling means increasing or decreasing the number of VM instances. For Scale-out operation of VM, we can add another similar configuration VM instance and add a load balancer to distribute the incoming HTTP requests. This kind of scaling is well supported with Virtual machine Scale Sets. For Scale-In, VM instances are removed. It is easy to manage VMs with Scale sets as VMs can be created on demand or scheduled time from a central configuration. A load balancer will automatically be created and integrated. This also takes care of deploying multiple VMs across Availability sets.

Horizontal Scaling

5 Uses of Virtual Machines

Virtual Machines can be useful in many ways such as the following cases:

  1. Development and Testing- Virtual Machines help the developers in building, testing and debugging software applications by providing them with a sandboxed environment. And it even ensures that it doesn't affect their local machines.
  2. Infrastructure as a Service (IaaS)- VMs also favors businesses in scaling their infrastructure quickly and a reduced hardware costs as it gives them ground for Infrastructure as a Service (IaaS) solutions.
  3. Disaster Recovery- It provides easy disaster recovery options that help a lot by providing replication and failover of critical workloads.
  4. Scalability- VMs provide rapid scalability to users so whenever more capacity and capabilities are required, they don't have to go and buy additional hardware.
  5. Testing Environment- With the help of VMs, organizations can easily test their software updates for software quality assurance through the isolated testing environments.
Summary

Azure Virtual machines are the right option to start using Azure as a platform to build and deploy solutions. It resembles the same as a web server but allows the flexibility to use enhanced cloud-related features. We can connect Azure VMs to on-premise Virtual Networks and other servers to ensure the secured transaction of requests within the network domain through a private passage. With Azure VMs, we have that flexibility to start and use the VM when required and then turn off when not. This lowers the burden of keeping and maintaining heavy infrastructure. If you want to get 100% growth in your tech career, our azure training guarantees you the skills you need for a salary hike, job placement, and interview success. Enroll today and watch your future soar!

FAQs

Q1. What is a virtual machine in Azure?

A Virtual Machine in Azure is a virtualized computing environment that helps its users in enabling them to execute applications and specific tasks on the Microsoft's cloud infrastructure.

Q2. What is the difference between virtual machine and virtual machine classic in Azure?

In Azure,  Virtual Machines are originally Virtual Machine Classic as it used to be the initial deployment model for now VMs. Virtual Machine Classic were based on the Azure Service Manager (ASM) which is now replaced by the Azure Resource Manager model (ARM).

Q3. What is a benefit of using a virtual machine on Azure?

A benefit of using a Virtual Machine on Azure is that it makes deploying and managing the computing resources easier and effective.

Q4. What are types of VM in Azure?

The VM in Azure comes in many types such as:
  • General Purpose VMs
  • Compute Optimized VMs
  • Memory Optimized VMs
  • Storage Optimized VMs
  • GPU Optimized VMs
  • High Performance VMs

Take our Azure skill challenge to evaluate yourself!

In less than 5 minutes, with our skill challenge, you can identify your knowledge gaps and strengths in a given skill.

GET FREE CHALLENGE

Share Article

Live Classes Schedule

Our learn-by-building-project method enables you to build practical/coding experience that sticks. 95% of our learners say they have confidence and remember more when they learn by building real world projects.
Azure Developer Certification Training Jul 28 SAT, SUN
Filling Fast
10:00AM to 12:00PM (IST)
Get Details

Can't find convenient schedule? Let us know

About Author
Rupesh K. Roy (Author, Speaker and Microsoft Certified Trainer)

He is an Author, Technology Speaker and Microsoft Certified Trainer on .Net and Azure platforms. He has more than 5 years of industry expertise and has worked as a developer with the most prominent companies on Azure, .Net Core and React JS. He is passionate about learning and sharing new technical stacks.
Accept cookies & close this