Citrix recently announced preview support for Azure Managed Disks in Citrix Cloud’s XenApp and XenDesktop service. Today, we are pleased to announce the release of the production version. Managed Disks provides scalable and highly available storage without the need to create storage accounts and worry about IOPS constraints. Complementing the availability of Managed Disks are two new master image options: Managed Disks and Managed Snapshots.
Overview of Managed Disks
Azure Managed Disks is an elastic disk storage system that is offered as an alternative to the current storage account-based system. Currently, XenDesktop must create and manage multiple IOPS-constrained storage accounts to provide storage for the VHD blobs that hold the operating system and data disks for provisioned virtual machines (VDAs). In addition, copying images between storage accounts is slow, so copying each OS disk directly from the master image is not feasible for catalogs that use multiple storage accounts. Instead, the master image is replicated to each storage account when a catalog is created and updated so that each OS disk can be copied from a copy of the master image in the same storage account.
Managed Disks eliminates the complexity of storage accounts and offers a simple scalable and highly available solution for creating and managing disks and does away with the time-consuming need to replicate master images to storage accounts. Furthermore, machine reliability is improved as Managed Disks are allocated to storage clusters in a manner that optimizes the distribution across fault domains.
An Azure resource group can hold no more than 800 Managed Disks. By default, XenDesktop provision three disks per machine: OS Disk, Identity Disk and Write Back Cache Disk. XenDesktop will provision no more than 240 machines per resource group leaving a small buffer for future use up to the theoretical 266 machines per resource group. Catalogs with more than 240 machines will therefore span multiple resource groups.
The billing policy for Managed Disks is currently different from unmanaged disks (VHDs in storage accounts), so there is a small difference in cost. Azure also has some Managed Disks specific limitations which are documented further down in this article.
How to select Managed Disks in Studio
Managed Disks is now the default in Studio, but provisioning unmanaged disks in storage accounts is an option on the Storage and License Types page in the catalog creation wizard:
Not all Azure locations support Managed Disks. When provisioning into a location that does not support Managed Disks, the “Use unmanaged disks instead of Azure Managed Disks for VMs in this catalog.” check box will be grayed out in the checked state as shown below:
How to select Managed Disks from PowerShell
If you are using the XenApp and XenDesktop Remote PowerShell SDK rather than Studio to provision Managed Disks catalogs, you will need to add a new custom property called ‘UseManagedDisks’ and set the value to ‘true’ in order to select Managed Disks. If this custom property is unspecified or set to ‘false’, unmanaged disks in storage accounts will be used.
$customProperties = @”
<CustomProperties xmlns=”http://schemas.citrix.com/2014/xd/machinecreation” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”> <Property xsi:type=”StringProperty” Name=”StorageAccountType” Value=”Standard_LRS” />
<Property xsi:type=”StringProperty” Name=”UseManagedDisks” Value=”true” />
</CustomProperties>”@
The custom properties are passed to ‘New-ProvScheme’ as usual. Please see this blog post for an example.
New Master Image Options
Support for Managed Disks includes 2 new master image options. All master image options can be used with both Managed Disks catalogs and unmanaged disks (VHDs in storage accounts) catalogs. If the master image is not in the required format for a particular catalog, XenDesktop will automatically convert it to the correct format. For example, if a managed disk image is selected when provisioning unmanaged disks in storage accounts, the selected image will be converted to a VHD blob in a storage account.
This is the full list of master image options:
- Unmanaged disk in a storage account
- Managed Disk
- Managed Snapshot
Azure does not currently support copying Managed Disks between Azure locations. If a selected Managed Disk image is located in a location different from where the catalog is provisioned, the managed disk image will be copied to a VHD in a storage account in the desired location and then converted back to a managed disk.
Not all Azure locations support Managed Disks. Currently, Managed Disk support appears to be dependent on environment, e.g., Azure China, rather than location.
Citrix Studio has been updated to support all of the above master image options:
If the specified disk (managed disk or unmanaged disk in a storage account) is attached to a machine, the machine must be stopped and de-allocated while the catalog is being created or updated. The following sections document the inventory path formats that can be used when provisioning catalogs from PowerShell. Note that the {hosting-unit} is not the same as a connection, but rather a set of resources (network, etc.) that uses a specific connection. Please see this blog post for more details.
Unmanaged disk in a storage account
XDHyp:\HostingUnits\{hosting-unit}\image.folder\{resource-group}.resourcegroup\{storage-account}.storageaccount\
{container}.container\{vhd-blob}.vhd
Note that the name of the {vhd-blob} must end in ‘.vhd’ which means that the complete path will end with ‘.vhd.vhd’. The first ‘.vhd’ is part of the blob name while the last ‘.vhd’ is the type of the inventory object.
Managed Disk
XDHyp:\HostingUnits\{hosting-unit}\image.folder\{resource-group}.resourcegroup\{managed-disk}.manageddisk
Managed Snapshot
XDHyp:\HostingUnits\{hosting-unit}\image.folder\{resource-group}.resourcegroup\{snapshot}.snapshot
Catalogs still use Storage Accounts
If you inspect the Azure resources used by a Managed Disks catalog in the Azure Portal, you will find that they include at least one storage account. The storage account(s) are used for Azure Table storage and as temporary storage when creating Identity Disks. All XenApp & XenDesktop machines created by the Citrix Machine Creation Service (MCS) have an attached data disk called an Identity Disk that is unique to each machine.
Because an Identity Disk is specific to a machine, it cannot be created without the use of an intermediary storage account. This is because there is currently no API for writing directly to a managed disk except from a machine it is attached to. Instead, we write the Identity Disk content to a blob in a storage account and then copy it to a managed disk. However, because Azure doesn’t know where to allocate the managed disk until it is attached to a machine, the copy can be requested, but Azure will not start copying until the machine is created, which, in the case of on demand provisioning, happens the first time the machine is started. This means that an Identity Disk will remain in a storage account until the first time the corresponding machine is started, at which point the source blob will be deleted from the storage account.
Managed Disks Performance
The performance profile when using Managed Disks is different from using storage accounts. In the context of XenDesktop, a particularly important difference is how OS Disks are copied from the master image. For pooled machines, a new copy of the master image is made every time the machine is started, so the time it takes to copy the OS disk is directly reflected in the time it takes to start the machine. When using storage accounts, the master image is replicated to each storage account when the catalog is created or updated, and OS disks are copied from the replicated master image local to the storage account the machine is allocated to. This result in near instantaneous copies. Managed OS Disks are copied from the original master image which may be located in a different storage cluster, and copying in this case can take a noticeable amount of time.
Many factors like location and time of day influence performance. Performance characteristics may change at any time, but the following table is typical of the performance differences using standard storage.
Limitations
1. There is an upper limit of 10,000 Managed Disks per Azure subscription. This limits the total number of machines in a subscription to around 3,300 assuming three Managed Disks per machine (the default in Citrix Studio).
2. Storage accounts are still needed for some steps in the catalog creation process. XenDesktop currently creates more storage accounts than strictly required and they are not deleted when they are no longer needed. However, once all machines in the catalog has been started, the storage accounts will be empty.
Learn More
For further details on Azure Managed Disks, this deep dive from Microsoft’s Igor Pagliai provides excellent reading.
Citrix TechBytes – Created by Citrix Experts, made for Citrix Technologists! Learn from passionate Citrix Experts and gain technical insights into the latest Citrix Technologies.
Click here for more TechBytes and subscribe.
Want specific TechBytes? Let us know! tech-content-feedback@citrix.com