{"id":1875,"date":"2020-09-14T01:00:00","date_gmt":"2020-09-14T01:00:00","guid":{"rendered":"http:\/\/inswwdev.azurewebsites.net\/au\/insights\/uncategorized\/azure-site-recovery-and-mcs-provisioned-workloads\/"},"modified":"2020-09-14T01:00:00","modified_gmt":"2020-09-14T01:00:00","slug":"azure-site-recovery-and-mcs-provisioned-workloads","status":"publish","type":"post","link":"https:\/\/www.insentragroup.com\/us\/insights\/geek-speak\/cloud-and-modern-data-center\/azure-site-recovery-and-mcs-provisioned-workloads\/","title":{"rendered":"Azure Site Recovery and MCS Provisioned Workloads"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/21\/2021\/02\/insentra_james_kindon_09142020_img_1.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/056fed8c4bdf4887adf6c2bbc07b595d\" \/><\/p>\n<p><a rel=\"noopener nofollow\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/site-recovery\/site-recovery-overview\" target=\"_blank\">Azure Site Recovery (ASR)<\/a>\u00a0is Microsoft\u2019s multi-faceted solution for performing services such as Disaster Recovery (DR), Business Continuity Planning (BCP) execution and migration services (these days primarily wrapped into the Azure Migrate service).<\/p>\n<p>When deploying\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/docs.citrix.com\/en-us\/tech-zone\/design\/reference-architectures\/image-management.html#machine-creation-services\" target=\"_blank\" data-anchor=\"#machine-creation-services\">dedicated\/persistent machines<\/a>\u00a0on the Microsoft Azure platform, it is often desirable to protect these workloads via ASR, providing cross-region failover capability. Chances are if you are a Citrix customer, you may be deploying both pooled and dedicated workloads via Citrix Machine Creation Services (MCS), which does not lend itself well to ASR capabilities, or several other Azure availability technologies (yet).<\/p>\n<p>This post focuses on dedicated\/persistent workloads deployed via MCS on Microsoft Azure. If you are deploying pooled workloads, ignore this article and simply deploy a secondary pooled catalogue in your target (failover) region, ASR serves little to no purpose for you outside of maybe replicating your master image across regions.<\/p>\n<h3 style=\"padding-bottom: 15px; margin-bottom: 30px; margin-top: 40px; border-bottom: 1px solid #f16020;\">CITRIX AND AZURE SITE RECOVERY CONSIDERATIONS<\/h3>\n<p>My fellow CTP and all-round good fellow\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/twitter.com\/neilspellings\" target=\"_blank\">Neil Spellings<\/a>\u00a0and I discovered several considerations when dealing with ASR and Citrix workloads when consuming Citrix Cloud:<\/p>\n<ul>\n<li>Azure Subscription architecture. This is often complex at scale due to Azure limits<\/li>\n<li>Azure Hosting connection architecture (often directly related to your subscription architecture)<\/li>\n<li>Citrix Resource Locations\/Zone architecture<\/li>\n<li>Citrix Cloud Connect placement and registration configuration for VDA workloads<\/li>\n<\/ul>\n<p>It is worth having a read through the\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/docs.citrix.com\/en-us\/tech-zone\/design\/reference-architectures\/virtual-apps-and-desktops-azure.html\" target=\"_blank\">Citrix Virtual Apps and Desktops Service on Azure tech zone<\/a>\u00a0article to wrap your head around considerations.<\/p>\n<p>The long and short of MCS deployed workloads is that you simply cannot successfully leverage ASR to protect VM\u2019s and have them failed over to another region whilst keeping Citrix power management awareness in check. This is down to the fact that with MCS deployed workloads, the\u00a0HostedMachineID\u00a0and\u00a0HypervisorConnectionUid\u00a0attributes cannot be altered, which is what Citrix uses to identify the workload from a power management perspective. In Azure, this is identified by the Resource Group (in lower case I might add) that the machine resides in and the\u00a0HypervisorConnectionUid.<\/p>\n<p>So, whilst we can replicate the workload and have it restored, we end up in a split-brain scenario where power management awareness proves immensely problematic (ASR also does not replicate the storage account which MCS uses to cache power management status etc. from Azure) and brokering does not occur appropriately.<\/p>\n<p>MCS dedicated workloads are a \u201cdeploy once and leave alone\u201d methodology from Citrix and as such, keeping the machines in an MCS catalogue serves little to no purpose once deployed outside of some optimized power management calls to Azure. Given that MCS blocks our ability to leverage ASR appropriately, our first step is to boot MCS out of the way (thanks for the assist!) and leverage a \u201cmanual power managed\u201d\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/docs.citrix.com\/en-us\/citrix-virtual-apps-desktops\/install-configure\/machine-catalogs-create.html\" target=\"_blank\">Catalogue<\/a>\u00a0and Delivery Group. You may wish to continue to consume MCS provisioning to deploy the workloads from a central image, but post provisioning, it will be beneficial to move these workloads away from MCS management, and unlock some additional controls and capability that ASR offers.<\/p>\n<p>You should ensure that if you leverage MCS to deploy your persistent VM\u2019s, that you power on these machines at least once post provisioning. MCS leverages \u201con-demand\u201d provisioning in Azure, so the VM does not actually exist until the first power on occurs (hence why dedicated workloads still use an identity disk on the first pass).<\/p>\n<p>I have\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/github.com\/JamesKindon\/Citrix\/tree\/master\/Migration%20Scripts\/MigrateMCSToManual\" target=\"_blank\">written a script here<\/a>\u00a0which actions the following:<\/p>\n<ul>\n<li>Grabs all machines from an MCS dedicated Catalog<\/li>\n<li>Loops through each machine and removes it from the existing Delivery Group if assigned<\/li>\n<li>Removes the machine from the existing MCS Catalog but leaves the machine account in Active Directory<\/li>\n<li>Removes the ProvVM details, but retains the actual VM<\/li>\n<li>Resets the OU attribute on the ProvScheme in case the VM targeted is the last in the catalogue \u2013 I found a situation where this attribute was cleared after the last machine was removed \u2013 this may be resolved in the future and the value appears to be ignored on the second pass of provisioning anyhow<\/li>\n<li>Adds the machine to a manual Catalogue (Power Managed) I assume the Catalog uealready exists (if it doesn\u2019t the script bails)<\/li>\n<li>Sets the Machine\u00a0HostedMachineID\u00a0and\u00a0HypervisorConnectionUid\u00a0detail based on the original values (these are available for alteration on a Manual Catalogue)<\/li>\n<li>Adds the machine to a manual Delivery Group (conversely, you can bypass the rules of Citrix Studio with PowerShell, but we won\u2019t go there for now)<\/li>\n<li>Mirrors the existing assignments associated with the VM<\/li>\n<li>Optionally changes the published machine name to either the VM name or value you specify<\/li>\n<\/ul>\n<p>What it does not do:<\/p>\n<ul>\n<li>Create any Catalogues<\/li>\n<li>Create any Delivery Groups<\/li>\n<li>Alter any Delivery Group attributes including access assignments \u2013 make sure these are correct else you will not have access to your restored VM\u2019s<\/li>\n<li>Clean up any MCS remnants such as identity disks (yep they exist for dedicated too though are only used for first provisioning)<\/li>\n<\/ul>\n<p>Once you have performed this migration, we unlock the ability to leverage Azure Site Recovery to protect these VM\u2019s. There are still several considerations when dealing with failover scenarios, but I have a second script to cover this (read on).<\/p>\n<p>Conversely, this script should also do the job with traditional on-premises deployments where you need to change hosting connection details such as a new VMware VCenter \u2013 but you would have to ensure you are running on a Delivery Controller and I haven\u2019t tested it (no reason for it not to work).<\/p>\n<h3 style=\"padding-bottom: 15px; margin-bottom: 30px; margin-top: 40px; border-bottom: 1px solid #f16020;\">CITRIX AND AZURE SITE RECOVERY FAILOVER<\/h3>\n<p>Once you have a manual catalogue and are protecting your dedicated workloads with ASR, you will need to think about the following:<\/p>\n<ul>\n<li>Leverage\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/docs.citrix.com\/en-us\/citrix-virtual-apps-desktops\/manage-deployment\/vda-registration.html#configuration-considerations\" target=\"_blank\" data-anchor=\"#configuration-considerations\">registration groups<\/a> and\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/docs.citrix.com\/en-us\/citrix-virtual-apps-desktops\/manage-deployment\/vda-registration.html#auto-update\" target=\"_blank\" data-anchor=\"#auto-update\">disable controller auto-update<\/a>\u00a0via Citrix Policy<\/li>\n<li>Identify your source (production) and target (failover) zones (resource locations) as you will need to re-zone your Catalogs in a full failover scenario<\/li>\n<li>Identify your source (production) and target (failover) hosting connections. If these are different, then you will need to update each VM on a failover scenario to ensure that the hosting connection is updated appropriately<\/li>\n<li>Identify the target (failover) Resource Group in Azure for the protected workloads. This will need to be updated on failover so that Citrix is aware of where the machine now lives and can manage it accordingly<\/li>\n<li>Identify the source (production) Resource Group of the machine as we will need to update this value on a failback<\/li>\n<\/ul>\n<p>I have a\u00a0<a rel=\"noopener nofollow\" href=\"https:\/\/github.com\/JamesKindon\/Citrix\/tree\/master\/Migration%20Scripts\/SwitchAzureHostingConnections\" target=\"_blank\">second script here<\/a>\u00a0which will perform the following:<\/p>\n<ul>\n<li>Grabs all the machines in the source (production) Catalogue \u2013 I assume in an ASR failover, that you have lost the entire region and as such all machines in the Catalogue \u2013 this logic may need enhancing in the future, but for now, it should suffice<\/li>\n<li>Updates the\u00a0HypervisorConnectionUid\u00a0if different than the original<\/li>\n<li>Updates the\u00a0HostedMachineID\u00a0with the target (failover) Resource Group (in lower case!)<\/li>\n<li>Changes the Zone of the source (production) Catalogue to that of the restored VM. Without this change, the connections are never established regardless of the registration state<\/li>\n<li>Prompts for you to manually set the source (production) hosting connection into maintenance mode IF the hosting connection is different (rare). There is no hosting alteration available via the Citrix Cloud PowerShell SDK, so this is not something that could be actioned in code. This only applies if you have a different hosting connection for your failover region<\/li>\n<\/ul>\n<p>My suggestion is to leverage the JSON input capability, as it will allow you to map out both your failover and failback scenarios in a controlled fashion.<\/p>\n<p>With the above in place and executed the following is entirely possible:<\/p>\n<ul>\n<li>Protect dedicated VDI workloads cross-region with Microsoft Azure Site Recovery<\/li>\n<li>Lose an entire source (production) region and register appropriately with secondary Cloud Connectors in the failover region with no policy changes<\/li>\n<li>Provide full power management for the failed over machine for the duration of its lifecycle in DR<\/li>\n<\/ul>\n<p>Provide full failback capability once the source (production) region is restored<\/p>\n<h3 style=\"padding-bottom: 15px; margin-bottom: 30px; margin-top: 40px; border-bottom: 1px solid #f16020;\">SCENARIO OUTLINES<\/h3>\n<p>I took into consideration several scenarios whilst performing my testing, outlined below. There may be others, but these are the low hanging easy to test and document for now.<\/p>\n<p>The following components are common across all models:<\/p>\n<ul>\n<li>Azure South East Asia is primary, Azure East Asia is secondary<\/li>\n<li>Recovery Services Vaults exist in the Azure East Asia Region<\/li>\n<li>Both Regions have their own Cloud Connectors and are treated as a Resource Location in Citrix Cloud<\/li>\n<li>Group Policy uses Registration Groups to ensure that Cloud Connectors in Azure East Asia are only used when Connectors in Azure South East Asia are not available<\/li>\n<li>The hosting connection object is located in the Azure South East Asia Resource Location (Zone)<\/li>\n<li>The source (production) catalog is housed in the Azure South East Asia Resource Location<\/li>\n<\/ul>\n<p><strong>Single Azure Subscription, single hosting connection, multiple Azure Regions<\/strong><\/p>\n<p>Here is the subscription outline in a happy state:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/21\/2021\/02\/insentra_james_kindon_09142020_img_2.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/d0146394a40f4439b2a1d38fa67ed1be\" \/><\/p>\n<p><span>Happy, Healthy Azure Region with single hosting connection<\/span><\/p>\n<p>And here is what happens in a failure scenario, where we effectively lose the Azure South East Asia region:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/21\/2021\/02\/insentra_james_kindon_09142020_img_3.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/f6da1ca11ec7443da2b034a56c810abf\" \/><\/p>\n<p><span>Broken Azure Region with single hosting connection<\/span><\/p>\n<p><strong>Single Azure Subscription, multiple hosting connections, one per Azure Region<\/strong><\/p>\n<p>Here is our second scenario in a fail state. Note that in this scenario, I needed to put the source (production) hosting connection into maintenance mode for sessions to launch.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/21\/2021\/02\/insentra_james_kindon_09142020_img_4.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/f477489c96da4eab8eef0e23d187f409\" \/><\/p>\n<p><span>Broken Azure Region with dedicated hosting connection<\/span><\/p>\n<p><strong>Multiple Azure Subscriptions, multiple hosting connections, multiple regions<\/strong><\/p>\n<p>Note that I have not been able to test this scenario in earnest due to limitations in my Azure lab capability. However, the model should work, and ASR restoration across subscriptions is supported.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.insentragroup.com\/wp-content\/uploads\/sites\/21\/2021\/02\/insentra_james_kindon_09142020_img_5.jpg\" alt=\"\" data-udi=\"umb:\/\/media\/f02aace48d5740ef88dd26435aa68cba\" \/><\/p>\n<p><span>Broken Azure region with multiple hosting connections and subscriptions<\/span><\/p>\n<p>This is focusing purely on brokering services and there are additional considerations such as profile management, user personalisation layers etc. which need to be considered outside of ASR capability.<\/p>\n<h3 style=\"padding-bottom: 15px; margin-bottom: 30px; margin-top: 40px; border-bottom: 1px solid #f16020;\">Summary<\/h3>\n<p>I hope the above helps when working through capabilities associated with Azure Site Recovery and Citrix Cloud-based Dedicated VDI workloads. The good folks at Citrix (you know who you are) have been very helpful in sharing knowledge around how MCS operates and considerations of it in Microsoft Azure. They are also working hard to bring in additional availability options to ensure that we can leverage the power and availability options associated with Microsoft Azure.<\/p>\n<p>This blog was originally published on <a rel=\"noopener nofollow\" href=\"https:\/\/jkindon.com\/2020\/07\/29\/azure-site-recovery-and-mcs-provisioned-workloads\/\" target=\"_blank\">jkindon.com<\/a> on 29\/07\/20 and reprinted with permission.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Azure Site Recovery (ASR)\u00a0is Microsoft\u2019s multi-faceted solution for performing services such as Disaster Recovery (DR), Business Continuity Planning (BCP) execution and migration services (these days primarily wrapped into the Azure Migrate service). When deploying\u00a0dedicated\/persistent machines\u00a0on the Microsoft Azure platform, it is often desirable to protect these workloads via ASR, providing cross-region failover capability. Chances are&hellip; <a class=\"more-link\" href=\"https:\/\/www.insentragroup.com\/us\/insights\/geek-speak\/cloud-and-modern-data-center\/azure-site-recovery-and-mcs-provisioned-workloads\/\">Continue reading <span class=\"screen-reader-text\">Azure Site Recovery and MCS Provisioned Workloads<\/span><\/a><\/p>\n","protected":false},"author":86,"featured_media":1876,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[21],"tags":[],"class_list":["post-1875","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud-and-modern-data-center","entry"],"_links":{"self":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/posts\/1875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/users\/86"}],"replies":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/comments?post=1875"}],"version-history":[{"count":0,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/posts\/1875\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/media\/1876"}],"wp:attachment":[{"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/media?parent=1875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/categories?post=1875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.insentragroup.com\/us\/wp-json\/wp\/v2\/tags?post=1875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}