Friday, 3 March 2017

VM in Azure


  1. Azure Virtual Machines (VM) are the building block of Cloud IaaS 








  1. Following is the list of certain key Business Scenario for IaaS
    1. Test and Development
    2. Website Hosting
    3. Storage, Backup and Recovery
    4. Web Apps
    5. High Performance Computing
    6. Big Data Analysis 

  1. Below screenshot provide Comparison for On-Premise and Azure VM
 
 


  1. Following PS Commandlet can be used to convert VHDX to VHD. Refer Click Here
Convert-VHD –Path c:\test\MY-VM.vhdx –DestinationPath c:\test\MY-NEW-VM.vhd
 
  1. Workloads that are not suitable for  Azure IaaS VM
    1. Low Volume or Limited Growth
    2. Regulated environment Workloads 

  1. The Microsoft server software support for Microsoft Azure virtual machines page lists the current supported products and versions 

  1. Following 2 tools can be used to check if your On-Prem Infra is ready for Move to Cloud

    1. Azure VM Readiness Assessment tool
    2. Azure VM Optimisation Assessment tool 

  1. Azure Cost Estimator tool is replaced by Azure Pricing Calculator. However, If you are an EA, Partner or Cloud solution provider then you can obtain access to the Azure Channel pricing calculator. 

  1. When planning for Azure VM, there are range of factors to take into Account
    1. Storage: How much, where and what configuration
    2. Disk: Sizing
    3. Compute: Capacity required
    4. Availability: Uptime requirements, Geo-distribution, SLA and accessibility
    5. Cost: Azure Services, such as storage and compute 

  1. VM Sizing consideration
    1. The size of the VM affects the pricing and the tier affects of some capabilities
    2. A1 is the smallest size recommended for Production
    3. When Deploying a VM for SQL Enterprise, Select a VM with at least 4 CPU cores
    4. Each Cloud Service can only contain a max of 50 VM 

  1. Methods of creating VM
    1. Azure Portal
    2. ARM template
    3. Azure Powershell
    4. Visual Studio


  1. Considerations for migrating from On-Prem to Azure VM
    1. VHD files can be uploaded from On-Prem DC
      1. Must be from Hyper-V Virtual machines? Cant we upload VHD generated from other source
      2. .VHDX files not supported
      3. On-Pre VM must be generalised using sysprep.exe
      4. .VHD file must be a fixed size Virtual Disk 

  1. Demo on creating a VM through the portal using quick create option. There are 2 options of creating VM from portal
    1. Quick Create.
    2. Gallery 

  1. When we create VM in azure the price includes the licensing as well. This can be validated from My Computer properties which shows that Image is licensed. 

  1. Difference between Quick Create and create from gallery is the level of control available while creating the VM. 

  1. Green Check mark next to the DNS name denotes that you have unique name which can be publically available 

  1. If we go under the settings of the VM following tabs will get reflected
    1. Dashboard
      • Status
      • DNS Name
      • Host Name
      • Public VIP ( This is the public VIP . This is the internal IP Address of the machine)
      • Internal IP
      • Size
      • RDP Certificate Thumbprint
      • Location
      • Subscription Name/ID 
    2. Monitor

    • CPU Percentage
    • Disk Read Bytes/Sec
    • Disk Write Bytes /Sec
    • Network In
    • Network Out 

  • Endpoints
    • RDP (This allow us to remotely connect to the VM)
    • Powershell 

  1. Configure
    • VM Tier
    • VM Size
    • Availability set 

  1. Demo on accessing the VM in Azure
    1. When you try to connect to a VM it will download the RDP file for the respective connection
    2. BGINFO is deployed when we create a VM which gives basic information on the machine's desktop, BGINFO is deployed as part of the image
    3. We don’t  have control on the public IP Address that’s given by azure 

  1. Following notifications will appear once the VM build is completed
    1. Successfully created Virtual Machine <VM_Name>
    2. Successfully provisioned Virtual Machine <VM_Name>
    3. Successfully installed extensions in Virtual Machine <VM_Name>

 

Virtual Machine Provisioning using PowerShell:  

  1. There are 2 main methods to deploy VM using Powershell.
    1. Quick VM Provisioning Mode
      1. With this command a Single VM can be provisioned using an Image

New-AzureQuickVM –Windows –ServiceName "MySvc1" –name "MyWinVM1" –ImageName $image –Password $adminPasswd

  1. Advanced Provisioning configuration mode:
    1. This use combination of commands to build a configuration object for VM. Command line to use is New-AzureVMConfig
  2. Come features are Only available from the Advanced Configuration mode
    1. Create a VM using OS disk
    2. Specify AD domain join information
    3. Create new or attach existing disks
    4. Disable windows update
    5. Specify time zone
    6. Specify Static IP Address
    7. Specify reserved IP Address of the Cloud Service/Domain Name
 

Virtual Machine Provisioning using Templates

  1. Following Process is used for creating VM using ARM templates 



  1. User can create their own template using the information found in Authoring Azure Resource Manager templates. Can also deploy templates that have been created from Azure Quickstarts Templates. The template file can be created with a simple text editor and the file type is JSON.
  2. To specify values for the resource parameters that were defined in the template, you create a parameters file. This is also a JSON file type.
  3. All resources, like virtual machines, must be part of a resource group.
  4. Once the template and resource files are ready, you can use the New-AzureRmResourceGroupDeployment command to implement your resource.
  5. Command: New-AzureRmResourceGroupDeployment -Name <DeploymentName> -ResourceGroupName <ResourceGroupName -TemplateURI <TemplateURI>>
 

 

Virtual Machine Provisioning using Custom Image 







Following Process used to create VM using custom Image


 
  1. Image Sources: Following 2 sources can be used to source image
    1. Azure Market Place
    2. VM Depot

 

Virtual Machine IP Addressing

  1. There are following two type of address which can be used on Azure VM
    1. Public IP Address
    2. Private IP Address

 

Virtual Machine Availability Set 

  1. Availability Sets: Is one way to prepare for planned or unplanned failures. It’s a logical grouping of 2 or more Virtual Machines 

  1. Following are few key principles for Availability sets
    1. For redundancy, configure multiple VM in Availability Sets
    2. Configure each application tier into separate Availability sets
    3. Combine a load balancer with availability sets 

  1. What are Update domain (UD) and Fault domain (FD) in Availability Sets
Note: Detailed article on UD and FD Detail-UD and FD 

Each VM in an Availability Set is automatically assigned an update domain and a fault domain. This assignment helps Azure maintain High Availability and fault tolerance when deploying and upgrading Applications 

  1. Update Domain
An update domain allows Azure to perform incremental or rolling upgrades across a deployment. Each update domain contains a set of VMs and associated physical Hardware that can be updated and rebooted at the same time. During planned maintenance, only one update domain is rebooted at a time. By default there are five update domains, but you configure up to twenty update domains
 

  1. Fault Domain (Can be think of racks)
A fault domain defines a group of Virtual Machines that share a common set of hardware, switches, and more that share a single point of failure. For example, A server rack services by a set of power or networking switches. VMs in a availability set are placed in at least 2 fault domains. This mitigates against the effects of the hardware failures, network outages, power interruptions or software updates

 

Virtual Machine Scalability (Scaleset) 

  1. Scale Set are an Azure compute resources you can deploy and manage a set of identical VMs. With all VMs configured the same, VM scale set are designed to support true auto scale - no Pre-provisioning of VM is required- and as such makes it easier to build large-scale services targeting big compute, big data, and containerized workloads 

             Scale Set allow you to automatically grow and shrink the application based on the demand.

             Scale Set can only be implemented for v2 VMs that means this can't be done in classic portal. 

  1. Related Links
    1. https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-overview
    2. https://docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-windows-create

 

Virtual Machine Disks
 

  1. Azure VM disks
 

  1. Virtual Machines Disk types
VMs in Azure also use disks as a place to store OS, Application and data. All Azure VMs have atleast 2 disks - OS Disk and temporary disk. VM can also have one or more data disks/ All disks are stored as VHDs and the maximum capacity is 1023 GB
 

  1. Operating System Disk
Every VM has one attached OS disk. Its registered as a SATA drive and labelled as the C:\ Drive by default

 

  1. Temporary Disk
Every VM has a temporary disk that is automatically created. On Windows VMs, this disk is labelled as D: Drive by default and it is used for storing pagefile.sys 

Don’t store any data on Temporary disks. It provides temporary storage for applications and processes and is intended to ONLY store data such as page or swap files.

 

  1. Data Disks

Every VM can have data disks to store application data, or other data you need to keep. Data disks are registered as SCSI drives and labelled with a letter  that you choose

The size of the virtual machine determines how the size of the temporary disk and the maximum number of disks you can attach. Data disks are stored in a BLOB in an Azure storage account. OR Size of the VM dictates how many data disk we can have

 

Importing and exporting disks 

  1. If you want to move on-premises data to Azure Storage (or vice versa), there are a variety of ways to do this. One way is the Azure import and export service. The Azure Import/Export Service allows you to:

  • Import. Securely transfer large amounts of data to Azure blob storage by shipping hard disk drives to an Azure data center.
  • Export. Transfer data from Azure blob storage to hard disk drives and ship to your on-premises site.  

This service is suitable in situations where you want to transfer several TBs of data to or from Azure, but uploading or downloading over the network is not feasible due to limited bandwidth or high network costs. Scenarios where this would be useful include:

 

  • Migrating data to the cloud. Move large amounts of data to Azure quickly and cost effectively.
  • Content distribution. Quickly send data to your customer sites.
  • Backup. Take backups of your on-premises data to store in Azure blob storage.
  • Data recovery. Recover large amount of data stored in blob storage and have it delivered to your on-premises location. 

  • General Guidance
    1. Can create both Linux and Windows VM scale sets from the Azure portal. These Scale sets are automatically created with load balancer NAT rules to enable SSH or RDP connections
    2. A Scale Set can vary between 0 and 100 VMs and it is a simple call to change the number of VMs
    3. You can set the Maximum, minimum and default number of VMs and define triggers- action rules based on resource consumption
    4. When you increase the number of VMs in a scale set, VMs are balanced across update and fault domain to ensure, maximum availability. Similarly when you scale in, VMs are removed with maximum availability in mind.  

  • Azure Resource Explorer
This is a great tool to view and modify resources you have created in your subscription. The tool is web based and uses your Azure portal logon credentials. This tool is particularly useful in viewing Azure Scale sets. With the tool you can see the individual VM  and their properties

 

Managing Virtual Machines

  1. There are various options for managing azure Virtual machines
    1. VM Agents and extensions

Extensions are software components that extend the VM functionality and management operations. Multiple extensions can be installed on a VM. Currently available ones are DSC, Chef, puppet. VM agent is a light weight process intended to bootstrap these additional extensions. These can be installed during or post VM installation

  1. Azure XPLAT-CLI

This provide set of open source, cross platform commands for working with azure. XPLAT-CLI are good for Linux based VM as for windows Powershell is a good option

  1. RDP
  2. SSH
 

  1. Configuration Management tools
    1. Deploying and maintaining the desired state of your VM and application resources can be tedious and error prone. Azure Supports 2 configuration management systems
      • DSC
      • Chef and Puppet (Similar to DSC. Popular in Linux environment. Can be used in Windows)

Note: Puppet is a Client Server app. You would require Puppet Management server

 

Monitoring Virtual Machines
  1. In Azure, Administrator can enable diagnostic logging for
    1. Basic Metrics
    2. Network and web metrics
    3. .Net Metrics
    4. Windows Event System logs
    5. Windows event Security logs
    6. Windows Event Application logs
    7. Diagnostic infrastructure logs

 

  1. Alerts: can also be configured 

  1. Single Instance SLA-22nd Nov 2016


Over the last few months, we have done extensive work to improve availability of the Azure infrastructure, including innovative machine-learning to predict failing hardware early and offering premium storage to help improve reliability and performance of attached disks. Today, we are announcing a new 99.9% single-instance availability SLA to better support applications that cannot easily scale beyond single VMs. We hope this enables you to move even more workloads into Azure and take advantage of the agility of the cloud without compromising on your expectations of availability. 

To qualify for the single instance virtual machine SLA, all storage disks attached to the VM must be using premium storage, which offers this high level of availability and performance with up to 80,000 IOPS and 2,000 MBps of disk throughput. In addition to this new availability commitment, customers can continue to build for multi-machine high availability by having two or more VMs deployed in the same Availability Set or by utilizing VM Scale Sets which both provide machine isolation, network isolation, and power unit isolation across multiple virtual machines.
 

  1. When you running a VM following charges will be applied







    1. Will be charged for running the VM
    2. Will be charged for Storage consumed by VM
    3. Will be charged for Virtual Network(s)


  1. When we stop the VM from the RDP Session the status will be stopped, However when we do the shutdown from portal VM will go through the proper shutdown. There is big difference in two shutdown. If you shutdown from portal then only you wont be charged for the time you are not using the VM. However even if the VM is shutdown from RDP session we will be charged for storage.

No comments:

Post a Comment