diff --git a/Nutanix Prism Central/ProvScheme/Create PVS ProvScheme/Create-PvsProvScheme.ps1 b/Nutanix Prism Central/ProvScheme/Create PVS ProvScheme/Create-PvsProvScheme.ps1 new file mode 100644 index 0000000..02984a2 --- /dev/null +++ b/Nutanix Prism Central/ProvScheme/Create PVS ProvScheme/Create-PvsProvScheme.ps1 @@ -0,0 +1,125 @@ +<# +.SYNOPSIS + Creates a PVS ProvScheme. +.DESCRIPTION + Create-PvsProvScheme.ps1 creates a new Provisioning Scheme. + The original version of this script is compatible with Citrix DaaS July 2025 Release. +.INPUTS + 1. ProvisioningSchemeName: Name of the new provisioning scheme + 2. HostingUnitName: Name of the hosting unit used + 3. IdentityPoolName: Name of the Identity Pool used + 4. NetworkMapping: Specifies how the attached NICs are mapped to networks + 5. CustomProperties: Used to provide Cluster and CPUCores(Cores per CPU) values + 6. TargetDevice: Path to Prism Central Template Version of target device + 7. PVSSite: The Id of the PVS Site + 8. PVSvDisk: The Id of the PVS vDisk + 9. VMCpuCount: OPTIONAL: Number of vCPUs, overrides settings in Template Version + 10. VMMemoryMB: OPTIONAL: VM memory in MB, overrides settings in Template Version + 11. InitialBatchSizeHint: The number of VMs that will be intially added to the Provisioning Scheme + 12. CleanOnBoot: Reset VM's to their initial state on each power on + 13. Scope: Administration scopes for the identity pool + 14. RunAsynchronously: Run command asynchronously, returns ProvTask ID + 15. PersistUserChanges: User data persistence method + 16. WriteBackCacheDiskSizeGB: WBC disk size in gigabytes +.EXAMPLE +# Setting up customProperties as a variable for better readability +$customProperties = @" + + + + +"@ + +# Create a PVS Provisioning Scheme +.\Create-ProvScheme.ps1 ` + -CleanOnBoot ` + -ProvisioningSchemeName "myProvScheme" ` + -ProvisioningSchemeType "PVS" ` + -UseWriteBackCache ` + -WriteBackCacheDiskSize 10 ` + -PVSSite 00001111-2222-3333-4444-555556666666 ` + -PVSvDisk 00001111-2222-3333-4444-555556666666 ` + -HostingUnitName "myHostingUnit" ` + -IdentityPoolName "myIdp" ` + -NetworkMapping @{"0"="XDHyp:\HostingUnits\myHostingUnit\Clusters.folder\cluster01.cluster\Network-A.network"} ` + -CustomProperties $customProperties ` + -MachineProfile "XDHyp:\HostingUnits\myHostingUnit\Templates.folder\CitrixVda.template\win2022-vda-2411.templateversion" ` + -VMCpuCount 3 ` + -VMMemoryMB 6144 ` + -InitialBatchSizeHint 1 ` + -Scope @() ` + -RunAsynchronously ` + -PersistUserChanges OnLocal +#> + +# /************************************************************************* +# * Copyright © 2025. Cloud Software Group, Inc. +# * This file is subject to the license terms contained +# * in the license file that is distributed with this file. +# *************************************************************************/ + +param( + [Parameter(mandatory=$true)] [string] $ProvisioningSchemeName, + [Parameter(mandatory=$true)] [string] $ProvisioningSchemeType, + [Parameter(mandatory=$true)] [string] $HostingUnitName, + [Parameter(mandatory=$true)] [string] $IdentityPoolName, + [Parameter(mandatory=$true)] [hashtable] $NetworkMapping, + [Parameter(mandatory=$true)] [string] $CustomProperties, + [Parameter(mandatory=$true)] [string] $targetDevice, + [Parameter(mandatory=$true)] [guid] $PVSSite, + [Parameter(mandatory=$true)] [guid] $PVSvDisk, + [Parameter(mandatory=$false)] [int] $VMCpuCount, + [Parameter(mandatory=$false)] [int] $VMMemoryMB, + [Parameter(mandatory=$false)] [string] $InitialBatchSizeHint="1", + [Parameter(mandatory=$false)] [switch] $CleanOnBoot = $false, + [Parameter(mandatory=$false)] [string[]] $Scope = @(), + [Parameter(mandatory=$false)] [switch] $RunAsynchronously = $false, + [Parameter(mandatory=$false)] [string] $PersistUserChanges, + [Parameter(mandatory=$false)] [int] $WriteBackCacheDiskSizeGB = 10 +) +# Enable Citrix PowerShell Cmdlets +Add-PSSnapin -Name "Citrix.Host.Admin.V2","Citrix.MachineCreation.Admin.V2" + +Write-Verbose "Create a PVS ProvScheme" + +# Configure the common parameters for New-ProvScheme. +$newProvSchemeParameters = @{ + ProvisioningSchemeType = "PVS" + UseWriteBackCache = $true + ProvisioningSchemeName = $ProvisioningSchemeName + HostingUnitName = $HostingUnitName + IdentityPoolName = $identityPoolName + NetworkMapping = $NetworkMapping + CustomProperties = $CustomProperties + MachineProfile = $targetDevice + InitialBatchSizeHint = $InitialBatchSizeHint + CleanOnBoot = $CleanOnBoot + Scope = $Scope + RunAsynchronously = $RunAsynchronously + WriteBackCacheDiskSize = $WriteBackCacheDiskSizeGB + PVSSite = $PVSSite + PVSvDisk = $PVSvDisk +} + + +if ($PSBoundParameters.ContainsKey("VMCpuCount")) +{ + $newProvSchemeParameters.Add("VMCpuCount", $VMCpuCount) +} + +if ($PSBoundParameters.ContainsKey("VMMemoryMB")) +{ + $newProvSchemeParameters.Add("VMMemoryMB", $VMMemoryMB) +} + + +# Create a Provisoning Scheme +try +{ + & New-ProvScheme @newProvSchemeParameters +} +catch +{ + Write-Error $_ + exit +} diff --git a/Nutanix Prism Central/ProvScheme/Create PVS ProvScheme/README.md b/Nutanix Prism Central/ProvScheme/Create PVS ProvScheme/README.md new file mode 100644 index 0000000..8d09215 --- /dev/null +++ b/Nutanix Prism Central/ProvScheme/Create PVS ProvScheme/README.md @@ -0,0 +1,92 @@ +# PVS Catalog Creation with MCS Provisioning + +This section explains how to create a **Citrix Provisioning Services (PVS) Provisioning Scheme (ProvScheme)** in **Citrix Virtual Apps and Desktops (CVAD)** using the `New-ProvScheme` PowerShell cmdlet. + +The script [Create-PvsProvScheme.ps1](./Create-PvsProvScheme.ps1) provides an example of how to use `New-ProvScheme` to provision PVS catalogs. + +To create a PVS provisioning scheme, use the script available at [Create-PvsProvScheme.ps1](../Create%20PVS%20ProvScheme/Create-PvsProvScheme.ps1). + +## 1. Requirements for Nutanix PC + +For **Citrix Virtual Apps and Desktops (CVAD)** on-premises users deploying on **Nutanix PC**, the following minimum versions are required: + +| **Component** | **Supported Version** | +|------------------------------------------|-----------------------| +| CVAD Release for Studio UI | 2402 and later | +| CVAD Release for PowerShell | 2402 and later | +| Citrix Provisioning | 2402 and later | + +For **Citrix DaaS (Citrix Cloud)** users deploying on Nutanix PC, the following minimum versions are required: + +| **Component** | **Supported Version** | +|------------------------------------------|-----------------------| +| Citrix Provisioning | 2402 and later | + +## 2. Key Steps + +Follow these key steps to create a PVS catalog: + +1. **Set up the PVS server**: + Install and configure the **Citrix Provisioning Services (PVS) server** to manage your provisioning infrastructure. Ensure all necessary components are installed and properly configured. + +2. **Create a master target device**: + Set up a master target device, which will serve as the template for creating virtual machines for the catalog. + +3. **Create a vDisk using the Imaging Wizard**: + Use the **Imaging Wizard** to create a virtual disk (vDisk) that stores the master image of your target device. This vDisk will be used to provision virtual machines. + +4. **Create an Nutanix PC hosting connection**: + Set up an **Nutanix PC hosting connection** and hosting unit, just like you would for any MCS catalog in Citrix Virtual Apps and Desktops (CVAD). This connection will allow the provisioning of virtual machines in Nutanix PC. + +5. **Run the PVS Configuration Wizard**: + Execute the **PVS Configuration Wizard** to register your PVS site with the CVAD site. This integration enables seamless communication and management between the two environments. + + +## 3. How to Retrieve PVS Site Details + +Follow these steps to get the required details for your PVS site: + +1. **Get the Site and Farm IDs**: + Use the `Get-HypPvsSite` command to retrieve the **Site ID** and the associated **Farm ID**. + +2. **Get Store Details**: + Use the `Get-HypPvsStore` command to retrieve information about the PVS store, including its configuration and details. + +3. **Retrieve vDisk Details**: + Using the **Farm ID**, **Store ID**, and **Site ID** obtained in the previous steps, use the `Get-HypPvsDiskInfo` command to retrieve detailed information about the vDisks available in the PVS site. + +## 4. How to Use the `New-ProvScheme` PowerShell Command to Create a PVS ProvScheme + +To create a PVS provisioning scheme, use the `New-ProvScheme` cmdlet with the appropriate parameters. Below is an example of how to specify the required parameters such as `-ProvisioningSchemeType`, `-PVSSite`, `-PVSvDisk`, `-MachineProfile`, and WriteBackCache settings: + +```powershell +New-ProvScheme -CleanOnBoot:$isCleanOnBoot ` + -ProvisioningSchemeName $provisioningSchemeName ` + -ProvisioningSchemeType PVS ` + -PVSSite $pvsSite ` + -PVSvDisk $pvsVDisk ` + -HostingUnitName $hostingUnitName ` + -IdentityPoolName $identityPoolName ` + -InitialBatchSizeHint $numberOfVms ` + -MasterImageVM $masterImagePath ` + -NetworkMapping $networkMapping ` + -ServiceOffering $serviceOffering ` + -CustomProperties $sampleCustomProperties ` + -MachineProfile $targetDeviceTemplateVersion ` + -UseWriteBackCache ` + -WriteBackCacheDiskSize 32 ` + -WriteBackCacheDriveLetter "0" ` + -WriteBackCacheMemorySize 0 +``` + +**Note**: For the correct syntax and more detailed examples, refer to the script [Create-PvsProvScheme.ps1](./Create-PvsProvScheme.ps1) + + +## 5. Limitations for Nutanix PC + +When using **Nutanix PC** for Citrix Virtual Apps and Desktops (CVAD), the following limitations apply: + +- The master target device must be supplied as a template version through either the machine profile or master image + +Documentation: +https://docs.citrix.com/en-us/provisioning/2402-ltsr/configure/citrix-provisioning-catalog-in-studio.html