9- Virtual Machine

  • Using azure virtual machine , you can setup servers in the cloud.
  • you can basically recreate your on-premises environment in azure if you choose
    • you can have active directory server storing user accounts
    • a dns server
    • a web servers
    • file servers
    • database servers
    • using virtual network in azure these vms can all communicate and security can be enabled to restrict ports
    • There are also additional features of azure networking like load balancers and firewalls that allow you to secure your vm network
    • you can also extend your onpremise environment into the cloud by connecting your on-premise network to vNet in azure, then the vms in azure can essentially become part of your network. so if you are running out of capacity on-premises and dont want to buy new hardware – then this is the option
  • There are several ways to deploy vms into azure
    • you can upload your own vm images into storage account in azure and use them as image templates to create instances of virtual machines.
    • But there is a much easier way to create vms in azure by choosing from preconfigured VM images from the azure marketplace. And many of them are provided by Microsoft but also by other third parties. But when you create vm from the market place the licensing cost for the OS are included in that price.
  • When you create vm – three big decision you need to keep in your mind

          1. Image you want to use

      • This is the configuration that decides what operating system is installed.
      • you can click on see all images link and choose your own – can choose images that are preconfigured with software
        • vm image with wordpress installed or smtp server or dev tools like visual studio

         2. Size of the vm

    • How many virtual cpus are included and the amount of RAM. Different VM sizes are suitable for different workloads. Bs-series vms are suitable for development workloads and low traffic web applications and small databases. D2 series vms are for most production workloads. Each size has a pay as you go price(price listed per month).
    • Spot vms that allows you to use vms that come from unused capacity in azure. These are cheaper..
    • Computer optimised series vms that has high cpu to memory ratio. 
    • Memory optimised series vms has high memory to cup ratio. Better for hosting database servers.
    • Hbv3 vms are optimised for high performance computing like financial calulation , weather simulation. Very expensive.
    • The virtual machine selector tool – lets you find vm sizes by workload type, Os and software or by deployment region.
    • Once you have selected the VM size – you can later upgarade it – scaling up or degrade by scaling down. Thats the part of elasticity in the cloud 

Related resources a VM needs

  • A vm needs a disk to store the operating system – OS disk. This is created when you create the VM and it gets managed by azure in azure storage. Its basically a copy of the vm image
  • A data disk:- If you need to store lot of data as part of your VM. Maybe you need database storage or some other file storage attached to your VM.
  • VNET:- A VM also needs to exist on a virtual network in azure. Thats how it can communicate with other vms and out to the internet. So even if you have single VM, it needs an azure virtual network. You can either create one while creating the VM or you can attach a VM to an existing virtual network. 
  • The VM needs a network interface in order to communicate on the network
  • A public IP Address – for the VM so it can be remotely accessed, that could allow you to use the VM as a web server.
  • You can also set up security rules to filter network traffic between resources on the virtual network using network security groups. 
  • So each of the above is considered as resource in azure with their own configuration screens and when you add managed data disks those have associated costs. Accessing those managed disk also have costs as storage transations. Any data that comes out of azure is also charged. Thats actually true of azure in general

         3. Availibility Options

  • azure virtual machines are hosted on phsycal machines in an azure data center.
  • Sometimes those physical machines need maintenance or something fails or they need to be restarted. Thats the reality.
  • If there is single vm– you are introducing single point of failure
  • For that reason data centre is organised into update domains and fault domains.
  • Update domains are group of virtual machines and the underlying physical hardware that can be rebooted at the same time.
  • Fault domains are a group of virtual machines that share a common power source in datacenter and a common network switch.
  • When you are creating virtual machine in azure – you can choose to create it in the availibility set with other vms. When you do that azure places your vm in separate update domains and fault domains.
  • So you are telling azure that these vms are part of an application , so azure can help with resiliency and availibility.
  • This doesn’t protect you from things like OS failure or application specific failures but it does limit the impact of potential hardware failures, network outages and power interruptions.
  • And you actually need to create atleast two vms within an availibility set if you want that 99.5% uptime guarantee in the azure service level agreement.
  • Now to use these vms for redundancy in a solution , you need to put them behind a load balancer. So users access a web server from a single IP address and URL, but the load balancer routes the traffic to one of the vms in the solution based on the availibility and load. To make that easier – azure offers something called virtual machine scale sets. These lets you create and manage a group of identical virtual machines and azure will put them behind a load balancer for you. you can configure virtual machine scale sets to scale with demand so azure can add and remove vms from the scale set as needed , and of course you configure the parameters around that. And those vms are sread across fault domains, so you have that protection as well.
  • VM Scale set – Basically two or more virtual machines running exactly the same code with a load balancer in front of it to direct traffic to one of the machines.
  • Virtual machine scale sets let you maintain a consistent configuration across your VMs. you get resiliency if one of the vms has a problem. And the autoscaling features helps with application performance.
  • If you are planning to set up a large scale solution that requires a lot of vms , upto 1k vms are supported in a virtual machine scale set.
  • You do pay for VM but you no need to pay anything for additional vm scale set functions.

  Create virtual machine 

  • Azure vm with preset configuration – just narrows down the vm sizes based on weather you intend this vm for development or production.
  • Azure arc- lets you manage vms in environment outside azure, including your on-premise environment
  • Azure vmware solution virtual machine- lets you move vmware based workloads from your datacenter to azure
      After VM is created :- 
  • you will all the related resources that were created with the VM itself, like the virtual network , OS disk , network interface , public IP address and the availibility set created as separate resource with its own configuration.
  • In the overview tab – you will find the public ip address which you will use to access it over the internet
  • There is also private ip address- IP address of VM on the VNet that was created. 
  • And on the overview tab – you can stop the VM, this is how you can save on compute charges when not using the virtual machine.
  • Networking tab – allows us to manage the ports that are open.
  • Disks-  if you need storage more later..
  • Size tab – resize the VM – you can scale it up if we found that the workloads that we are putting on here are more than the VM can handle. Choose the new size and click Resize. If the VM is running it will cause the VM to restart.
  • Configuring tab – you can manage the license for the windows operating system.
  • Identity – Allows you to access azure resources using the azure active directory identity of this VM.
  • Backup- is where you can configure options for backing up this VM.
  • Azure has a service called Azure Backup where you can store backups of VM disks, file shares and blobs in azure storage. Even database running on VMs can be backed up. Additional costs associated with storing backups.
  • Disaster recovery – provides disaster recovery by replicating VM to different azure region.
  • Updates- lets you use other services in azure to help you provide updates to this VM. jin IAAS you are responsible for updating them. Azure does help this though by allowing you to leverage a service called azure automation to push out updates to VMs that are enrolled with the service. You need to configure that and schedule the updates, though. And this works for windows and linux Vms.
  • Connect  :-  RDP SSH Bastion – RDP – remove desktop protocol. RDP is traditional way to login to windows vm. Azure will create a file to download using RDP. Edit this file . Connect to the VM. Go to service manager dashboard where you can manage the VM. you can configure the domain as well.
  • Azure bastion is a service which lets you connect using your browser and the azure portal.

Leave a Comment