{"id":20454,"date":"2017-09-12T09:00:00","date_gmt":"2017-09-12T08:00:00","guid":{"rendered":"https:\/\/aidanfinn.com\/?p=20454"},"modified":"2017-09-07T16:11:31","modified_gmt":"2017-09-07T15:11:31","slug":"restore-an-azure-vm-to-an-availability-set-from-azure-backup-in-the-azure-portal","status":"publish","type":"post","link":"https:\/\/aidanfinn.com\/?p=20454","title":{"rendered":"Restore An Azure VM to an Availability Set From Azure Backup in the Azure Portal"},"content":{"rendered":"<p>Microsoft has shared how to restore an Azure VM to an availability set using PowerShell from Azure Backup. It\u2019s nasty-hard looking PowerShell, and my problem with examples of VM creation using PowerShell is that they\u2019re never feature complete.<\/p>\n<p>While writing some Azure VM training recently, I stumbled across a cool option in the Azure Portal that I tried out \u2026 and it worked \u2026 and it means that I never have to figure that nasty PowerShell out <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" src=\"https:\/\/aidanfinn.com\/wp-content\/uploads\/2017\/09\/wlEmoticon-smile.png\" alt=\"Smile\" \/><\/p>\n<p>The key to all this is to start using Managed Disks. Even if your existing VMs are using un-managed (storage account) disks, that\u2019s not a problem because you can still use this restore method. The other thing you should remember is that the metadata of the VM is irrelevant \u2013 everything of value is in the disks.<\/p>\n<h2>Restore the Disks of the VM<\/h2>\n<p>Using these <a href=\"https:\/\/aidanfinn.com\/?p=20434\" target=\"_blank\" rel=\"noopener\">steps<\/a> you can restore the disks of your VM, managed or un-managed, to a storage location, referred to as the staging account.. Each disk is restored as a blob VHD file, and a JSON file describes the disks so that you can identify which one is the \u201cosDisk\u201d.<\/p>\n<h2>Create Managed Disks from the Restored VHDs<\/h2>\n<p>In this <a href=\"https:\/\/aidanfinn.com\/?p=20441\" target=\"_blank\" rel=\"noopener\">process<\/a>, you create a managed disk from each restored VHD or blob file in the staging location. You have the option to restore the disks as Standard (HDD) or Premium (SSD) disks, which offers you some flexibility in your restore (you can switch storage types!). Make sure you ID the osDisk from the JSON file and mark it as either a Windows or Linux OS disk, depending on the contents.<\/p>\n<h2 align=\"left\">Create a VM From the OS Managed Disk<\/h2>\n<p align=\"left\">The third set of <a href=\"https:\/\/aidanfinn.com\/?p=20441\" target=\"_blank\" rel=\"noopener\">steps<\/a> bring your VM back online. You use the previously restored\/identified osDisk and create a new virtual machine using that managed disk. Make sure you select the availability set that you want to restore the VM to.<\/p>\n<h2>Clean Up<\/h2>\n<p>The last step is the clean up. If you had any data disks in the original machine then you need to re-attach them to the new virtual machine. You\u2019ll also need to configure the network settings of the Azure NIC resource. For example, if the new VM is replacing the old one, you should enter the IP settings of the old VM into the new NIC Azure resource, change any NAT\/load balancing rules, NSGs, PIPs, etc.<\/p>\n<p>And that\u2019s it! There\u2019s no PowerShell, and it\u2019s all pretty simple clicking in the Azure Portal that won\u2019t take that long to do after the disks are restored from the recovery services vault.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Microsoft has shared how to restore an Azure VM to an availability set using PowerShell from Azure Backup. It\u2019s nasty-hard looking PowerShell, and my problem with examples of VM creation using PowerShell is that they\u2019re never feature complete. While writing some Azure VM training recently, I stumbled across a cool option in the Azure Portal &hellip; <a href=\"https:\/\/aidanfinn.com\/?p=20454\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Restore An Azure VM to an Availability Set From Azure Backup in the Azure Portal&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":18387,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[5],"tags":[199,170,148,55,164,87,99,153],"class_list":["post-20454","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","tag-availability-sets","tag-azure","tag-azure-backup","tag-backup","tag-managed-disks","tag-powershell","tag-storage","tag-virtual-machines"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/aidanfinn.com\/wp-content\/uploads\/2015\/06\/12950992371.png","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/20454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=20454"}],"version-history":[{"count":2,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/20454\/revisions"}],"predecessor-version":[{"id":20456,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/posts\/20454\/revisions\/20456"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=\/wp\/v2\/media\/18387"}],"wp:attachment":[{"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=20454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=20454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aidanfinn.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=20454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}