Citrix Virtual Apps and Desktops

Create an Azure Local catalog

Create machine catalogs describes the wizards that create a machine catalog. The following information covers details specific to Azure Local environments.

Note:

Before creating an Azure Local machine catalog, you need to finish creating a connection to Azure Local. See Connection to Azure Local.

Requirements

  • VDA version: 2507 and later
  • Windows 10/11 multi-session workload is not supported

Create a master image VM

A master image VM is required to create a machine catalog.

MCS uses Azure Local VM image as the master image. Before using MCS to provision workload in Azure Local cluster, you need to prepare an Azure Local VM image with VDA installed. 

  1. Create an Azure Local VM using Azure portal.
  2. Connect to the created Azure Local VM to install VDA and required software.
  3. Create a scheduled task using Windows Task Scheduler to run the following script at VM startup under System context.

    $tagFileName = 'E6DA6616-8EC4-48E0-BE93-58CE6ACE3CFB.tag' 
    
    $foundDrive = $null 
    
    foreach ($drive in Get-PSDrive -PSProvider FileSystem) { 
    
    $tagPath = Join-Path $drive.Root $tagFileName 
    
    if (Test-Path $tagPath) { 
    
        $foundDrive = $drive.Root 
    
        break 
    
    } 
    
    } 
    
    
    if ([string]::IsNullOrEmpty($foundDrive)) { exit 0 } 
    
    $installScript = Join-Path $foundDrive 'install.ps1' 
    
    if (Test-Path $installScript) { 
    
    powershell.exe -NoProfile -ExecutionPolicy Bypass -File $installScript 
    
    } else { exit 1 } 
    
    sc.exe stop mocguestagent 2>$null 
    
    sc.exe delete mocguestagent 2>$null 
    
    Remove-Item 'HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\Application\mocguestagent' -Recurse -Force -ErrorAction SilentlyContinue 
    
    $setupComplete = 'C:\Windows\Setup\Scripts\SetupComplete.cmd' 
    
    if (Test-Path $setupComplete) { & $setupComplete }
    <!--NeedCopy-->
    
  4. Stop the Azure Local VM.
  5. Refer Create VM image from existing Azure Local VM to create an Azure Local VM image from the prepared Azure Local VM.

Create a catalog

You can create Azure Local catalogs to create, deliver, and power manage machines in your Azure Local environment.

Note:

  • The length of the catalog name must be no more than 49 characters.
  • Avoid using Microsoft Azure reserved words in catalog name or machine naming scheme. See the Microsoft document for details.

Yon can create the catalog using:

Create a catalog using Web Studio

You can create an MCS machine catalog in the Azure Local environment.

In the Machine Catalog Setup wizard:

  1. On the Operating System page, select Multi-session OS or Single-session OS.
  2. On the Machine Management page:
    1. Select Machine that are power managed (for example, virtual machines or blade PCs).
    2. Select to deploy machines using Citrix provisioning technology.
    3. Select the Azure Local hosting unit under Citrix Machine Creation Services (MCS).
  3. On the Desktop Experience page, select the option according to the machine type you select on Machine Type page.
  4. On the Image page:
    1. Select a master image. Currently, Azure Local doesn’t support Prepared image.
    2. You can add a note to the selected image.

    Note:

    • OS type is automatically populated after selecting the master image.
    • Machine profile is not supported.
  5. On the NICs page, select one or more NICs, associate a virtual network with each card.
  6. On the Virtual Machines page:

    1. Specify how many virtual machines to create. Enter 0 if you do not want to create any. Later, you can create VMs for an empty catalog by adding machines.
    2. Choose the amount of memory (in MB) and virtual CPU count each VM has.
    3. Configure Write-Back Cache for machines to improve I/O performance.
  7. Follow the on-screen instructions to complete the remaining steps, which don’t include Azure Local specific information.

You can also use Web Studio to create Azure Local catalogs to deliver and manage the power of existing machines in your Azure Local cluster.

In the Machine Catalog Setup wizard:

  1. On the Operating System page, select Multi-session OS or Single-session OS.
  2. On the Machine Management page, select Machines that are power managed, and then select Other service or technology as the way of deploying machines.
  3. On the Virtual Machines page, add machines and their Active Directory machine accounts. You can:

    • Add machines manually: Click Add Machines to add machines manually. The Select VMs window appears. Expand the Azure Local connection you created earlier and select the VMs you want to add. Then add the associated machine account names.
    • Add machines using a CSV file: Click Import from CSV file to bulk adds machines. For information about using CSV files to add machines, see Use CSV files to bulk add machines to a catalog.
  4. Follow the on-screen instructions to complete the remaining steps, which don’t include Azure Local specific information.

Create a catalog using PowerShell

You can create an MCS machine catalog in Azure Local environment using PowerShell commands.

Header of the script

Make sure that you provide the correct parameter values defined in the header of the script.

$catalogName = "" # Name of the catalog you want to create 

$masterImageResourceGroupName = "" # Name of resource group that the master Azure Local VM image resides in  

$catalogResourceGroup = "" # Name of resource group that the created VMs reside in 

$masterImage = "" # Name of the master Azure Local VM image you want to use 

$vNet = "" # Name of the logical network that the created VMs should be attached to 

$masterImagePath = "XDHyp:\HostingUnits\$hostingUnitName\image.folder\$masterImageResourceGroupName.resourcegroup\$masterImage" 

$networkMapping = @{"0"="XDHyp:\HostingUnits\$hostingUnitName\\network.folder\$vNet.network"} 

$customPropertiesXml = "<CustomProperties xmlns=`"http://schemas.citrix.com/2014/xd/machinecreation`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`"><Property xsi:type=`"StringProperty`" Name=`"ResourceGroups`" Value=`"$catalogResourceGroup`" /><Property xsi:type=`"StringProperty`" Name=`"OsType`" Value=`"Windows`" /></CustomProperties>" 
<!--NeedCopy-->

Create an MCS catalog with 1 VM

asnp citrix*

Create Machine Catalog
New-BrokerCatalog -AllocationType "Random" -IsRemotePC $false -MinimumFunctionalLevel "L7_34" -Name $catalogName -PersistUserChanges "Discard" -ProvisioningType "MCS" -SessionSupport "SingleSession"
<!--NeedCopy-->
Create Identity Pool
New-AcctIdentityPool -AllowUnicode $true -Domain "test.local" -IdentityPoolName $catalogName -IdentityType "ActiveDirectory" -NamingScheme "demoVM#" -NamingSchemeType "Numeric" -OU "CN=Computers,DC=test,DC=local" 
<!--NeedCopy-->
Create Provisioning Scheme
New-ProvScheme -CleanOnBoot $true -CustomProperties $customPropertiesXml -HostingUnitName $hostingUnitName -IdentityPoolName $catalogName -MasterImageVM $masterImagePath -NetworkMapping $networkMapping -ProvisioningSchemeName $catalogName -ProvisioningSchemeType "MCS" -VMCpuCount 4 -VMMemoryMB 8192 
<!--NeedCopy-->
$schemeUid =(Get-ProvScheme -ProvisioningSchemeName $catalogName).ProvisioningSchemeUid.Guid 

Set-BrokerCatalog -Name $catalogName -ProvisioningSchemeId $schemeUid 
<!--NeedCopy-->
Create AD account
New-AcctADAccount -Count 1 -IdentityPoolName $catalogName 
<!--NeedCopy-->
Provision VM
New-ProvVM -ADAccountName "domain\demoVM1" -ProvisioningSchemeName $catalogName 
<!--NeedCopy-->
Add machine to broker catalog
New-BrokerMachine -CatalogName $catalogName -MachineName 'domain\demoVM1'
<!--NeedCopy-->

Where to go next

More information

Create an Azure Local catalog