Sunday, 10 September 2023

What is a Virtual Machine? An Introduction to Azure Virtual Machines

 Azure Virtual Machines are on-demand computing resources or virtual machines offering of Microsoft Azure. 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. With Azure Virtual Machines we get more control over the environment to customize the development environment or hosting. In fact, the concept behind the Azure Virtual Machine is the same that runs the entire cloud platform – Virtualization.


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.

Virtual machine - 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.

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.

  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.

: 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.

No comments:

Post a Comment