Factors to consider from Creation to Deployment of Azure Virtual Machines

What is Azure Virtual Machine?

Azure Virtual Machines provides the flexibility of virtualization by maintaining the physical hardware that runs on it. To meet the needs, the number of VMs that any application is using can scale up and out.

For tasks such as configuring, patching, and installing, the software dependent on the requirements and the opted services(IaaS, PaaS, SaaS).

Some examples of using Azure VM:

  • In Development or Test- To create a VM with specific configurations requirements for coding and testing an application.
  • Applications in the cloud- As the demand of the application can increase or decrease, so on the economic terms its beneficial to run VM in Azure(pay per use)
  • Using Azure VM with datacenter- VM present in Azure virtual network can connect to the organization’s network easily.

Azure is present in 55+ regions and 140 countries.

For planning the VM creation, below checklist should be consider according to design considerations.

  • Decide the location- It specifies where the virtual hard disks are stored. Some of the ways to store a list of locations.

To achieve comprehensive business continuity on Azure, the application architecture can be built using the combination of Availability Zones within Azure region. The applications and data can be replicated using Availability Zones within an Azure region to maintain high-availability and asynchronously replicate across Azure regions for disaster recovery protection

  • Determine the number of VMs required- To make sure the system is available 99.95% (VM Service Level Agreement), there is need to deploy two or more VMs inside of an availability set. An availability set ensures that VMs are distributed across multiple fault domains in the Azure data centers as well as deployed onto hosts with different maintenance windows.
Availability Sets

Below three main scenarios which can cause VMs in Azure to be impacted or make them in a faulted state.

  • Unplanned Hardware Maintenance Events — When physical hardware failure or any platform components associated to a physical machine is about to fail. Action to prevent is performing live migration.
  • An unexpected downtime — It can occur when VM system crash or system panic. Actions to prevent this is by automated migration and reboot.
  • Planned Maintenance events — The patching or replacement during periodic updates by Microsoft. Build for maintaining the high availability.

After both planned and unplanned updates VMs and OSs will be rebooted. Each virtual machine in the Availability Set is assigned an Update domain and Fault domain by the Azure platform.

Fault Domain and Update Domain

Fault Domain-define the group of virtual machines that share a common power source and network switch.

— Each and every fault domain contains some racks and each rack contains virtual machine.

— If there is a failure in the fault domain then all the resources in the fault domain become unavailable. VMs should be place in such a way that each fault domain get one web server, one database server and like that.

Update Domains — Virtual machines get update domains automatically once they are put inside availability set.

  • All virtual machines within that update domain will reboot together.
  • Update domains are used for patching of the virtual machines.
  • Only one update domain would be updated at the time
  • Determine the size for the VM-While determining the sizing of VM below points should be consider according to the requirement of projects-
  • Select the operating system of VM-Linux or Windows

— -Windows Server requires a license and doesn’t support OS upgrades.

— -Linux distributions are supported and upgrade of the OS is supported.

  • The configuration of the VM

Implementing Scale Sets-

Horizontal Scaling- Autoscale only scales horizontally, which is an increase (“out”) or decrease (“in”) in the number of VM instances. Horizontal is more flexible in a cloud situation as it allows you to run potentially thousands of VMs to handle load.

Implementing Auto Scale In and Out

Vertical scaling: With the same number of VMs makes the VMs more (“up”) or less (“down”) powerful. It is measured in terms of memory, CPU speed, disk space, etc. It has more limitations.

-Dependent on the availability of larger hardware, which can vary by region and limited in size.

-Also, requires a VM to stop and restart.

Automate VM Deployment-Automating VM deployment using

  1. Azure portal
  2. Azure CLI
  3. ARM template
  4. PowerShell
  5. JSON templates, custom script extensions, and desired state configuration.
VM Extensions using JSON for deployment having 90 mins of timeout.
Run PowerShell script at creation install and start IIS web server
Powershell script

Virtual Machine Disk

— Operating system disks are SATA drives with C: label

— Temporary disks provide short term storage.

— Data Disks are SCSI drives and depend on the virtual machine type.

Managed vs Unmanaged Disks

Benefits of Managed disks-They have 99.999% availability

Azure Storage Account-

Premium storage is backed by Solid State Drives(SSD)

Standard Storage is backed by spinning magnetic disk(HDD)