{"id":93011,"date":"2021-12-20T17:00:04","date_gmt":"2021-12-20T17:00:04","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=93011"},"modified":"2021-12-18T13:43:06","modified_gmt":"2021-12-18T13:43:06","slug":"case-study-troubleshooting-site-recovery","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/case-study-troubleshooting-site-recovery\/","title":{"rendered":"Case Study: Troubleshooting Site Recovery"},"content":{"rendered":"<p>A silly mistake, a site recovery error and a troubleshooting case study, let&#8217;s check how it happened.<\/p>\n<p>I was demonstrating Site Recovery in a training. Site recovery is a slow task, so I make the demonstration among other explanations, put the demonstration in the middle of other subjects.<\/p>\n<p>This also doesn&#8217;t leave much room to research about problems. On this blog, I will mention a mistake i did and how I solved it.<\/p>\n<h2>\nThe silly mistake<\/h2>\n<p>I started the Site Recovery demonstration but the virtual machines were deallocated when I started &#8211; or at least I believe this was the root cause.<\/p>\n<p><strong>Result:<\/strong> The Site Recovery jobs failed.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-93055\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2021\/12\/SiteRecovery03.png\" alt=\"\" width=\"1071\" height=\"264\" \/><\/p>\n<h2>First Solution Attempt<\/h2>\n<p>Well, the jobs were still there, but the replication failed. Now with the machines turned on, let&#8217;s try the jobs again. It&#8217;s only a matter of selecting the jobs and asking to <em>Restart<\/em>.<\/p>\n<p><strong>Result:<\/strong> Failed again.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-93056\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2021\/12\/SiteRecovery04.png\" alt=\"\" width=\"642\" height=\"349\" \/><\/p>\n<h2>Second Solution Attempt<\/h2>\n<p>Since repeating doesn&#8217;t work, let&#8217;s remove and add again. I used &#8220;Replicated Items&#8221; menu on the recovery services vault and removed the failed virtual machines.<\/p>\n<p><strong>Result:<\/strong> When trying to enable site recovery again, the virtual machines where not available anymore. It was not possible to select them.<\/p>\n<h2>\nThird Solution Attempt<\/h2>\n<p>Something was left behind and preventing the virtual machines to appear again for the site recovery.<\/p>\n<p>I checked the extensions on each virtual machine and there it was: The site recovery extension, present on both machines. I uninstalled it and tried again.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-93057\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2021\/12\/SiteRecover01.png\" alt=\"\" width=\"1280\" height=\"476\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Result:<\/strong> No virtual machine visible<\/p>\n<h2>Fourth Solution Attempt<\/h2>\n<p>I discovered the replication process also leaves a relation between the two virtual networks registered inside the recovery services vault. Even if the remote virtual network was already dropped, the relation is there and prevents the virtual machines to appear.<\/p>\n<p>Inside the recovery services vault, we use <strong><em>Site Recovery Infrastructure=&gt; For Azure Virtual Machines =&gt; Network Mapping<\/em><\/strong> and we can remove the link between the virtual networks.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-93054\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2021\/12\/SiteRecovery02.png\" alt=\"\" width=\"1280\" height=\"294\" \/><\/p>\n<p><strong>Result:<\/strong> No virtual machine visible<\/p>\n<h2>Final Solution<\/h2>\n<p>After digging a lot inside <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/site-recovery\/azure-to-azure-troubleshoot-errors#unable-to-see-the-azure-vm-for-selection-in-enable-replication\">troubleshooting articles<\/a>, I discovered on <a href=\"https:\/\/github.com\/AsrOneSdk\/published-scripts\/blob\/master\/Cleanup-Stale-ASR-Config-Azure-VM.ps1\">GitHub a powershell script<\/a> capable to remove all the remaining site recovery configuration from the virtual machine.<\/p>\n<p>I saved the script inside a cloud shell file share, executed it for each virtual machine and all what had left from the site recovery was gone.<\/p>\n<p><strong>Result:<\/strong> Finally the virtual machines were available for the site recovery.<\/p>\n<h2>Conclusion<\/h2>\n<p>Removing a replication leaves a lot of garbage behind. Unfortunately this was not the first time I saw a process like this leaving garbage behind, but this time I was able to track it down.<\/p>\n<p>It&#8217;s not only about the final solution, probably you will need to execute all or many of the steps here to reach this goal.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A silly mistake, a site recovery error and a troubleshooting case study, let&#8217;s check how it happened. I was demonstrating Site Recovery in a training. Site recovery is a slow task, so I make the demonstration among other explanations, put the demonstration in the middle of other subjects. This also doesn&#8217;t leave much room to&#8230;&hellip;<\/p>\n","protected":false},"author":50808,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[5364,145789,5893],"coauthors":[6810],"class_list":["post-93011","post","type-post","status-publish","format-standard","hentry","category-blogs","tag-azure","tag-site-recovery","tag-virtual-machine"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/93011","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/50808"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=93011"}],"version-history":[{"count":3,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/93011\/revisions"}],"predecessor-version":[{"id":93059,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/93011\/revisions\/93059"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=93011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=93011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=93011"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=93011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}