回写缓存磁盘

仅当满足以下所有条件时,才能将 Azure 临时磁盘用作回写缓存磁盘:

  • 回写缓存磁盘必须是非持久性的,因为 Azure 临时磁盘不适用于持久性数据。
  • 所选的 Azure VM 大小必须包含临时磁盘。
  • 无需启用临时 OS 磁盘。
  • 接受将回写缓存文件放置在 Azure 临时磁盘上。
  • Azure 临时磁盘大小必须大于(回写缓存磁盘大小 + 分页文件保留空间 + 1 GB 缓冲区空间)的总和。

非持久性回写缓存磁盘方案

下表描述了在创建非持久性计算机目录时,将临时磁盘用于回写缓存的三种不同方案。

方案 结果
满足使用临时磁盘进行回写缓存的所有条件。 WBC 文件 mcsdif.vhdx 放置在临时磁盘上。
临时磁盘空间不足,无法用于回写缓存。 将创建 VHD 磁盘“MCSWCDisk”,并将 WBC 文件 mcsdif.vhdx 放置在此磁盘上。
临时磁盘有足够的空间用于回写缓存,但 UseTempDiskForWBC 设置为 false。 将创建 VHD 磁盘“MCSWCDisk”,并将 WBC 文件 mcsdif.vhdx 放置在此磁盘上。

创建具有非持久性回写缓存磁盘的计算机目录

要配置具有非持久性回写缓存磁盘的目录,请使用 PowerShell 参数 New-ProvScheme CustomProperties。自定义属性包括:

  • UseTempDiskForWBC。此属性指示您是否接受使用 Azure 临时存储来存储回写缓存文件。如果要将临时磁盘用作回写缓存磁盘,则在运行 New-ProvScheme 时必须将其配置为 true。如果未指定此属性,则该参数默认为 False。

例如,使用 CustomProperties 参数将 UseTempDiskForWBC 设置为 true:

    -CustomProperties '<CustomProperties xmlns=" http://schemas.citrix.com/2014/xd/machinecreation" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"> `
    <Property xsi:type="StringProperty" Name="PersistWBC" Value="false"/> `
    <Property xsi:type="StringProperty" Name="PersistOsDisk" Value="false"/> `
    <Property xsi:type="StringProperty" Name="PersistVm" Value="false"/> `
    <Property xsi:type="StringProperty" Name="StorageAccountType" Value="Premium_LRS"/> `
    <Property xsi:type="StringProperty" Name="WBCDiskStorageType" Value="Premium_LRS"/> `
    <Property xsi:type="StringProperty" Name="LicenseType" Value="Windows_Client"/> `
    <Property xsi:type="StringProperty" Name="UseTempDiskForWBC" Value="true"/> `
    </CustomProperties>'
<!--NeedCopy-->

注意:

将计算机目录提交为使用 Azure 本地临时存储作为回写缓存文件后,以后无法更改为使用 VHD。

创建具有持久性回写缓存磁盘的计算机目录

要配置具有持久性回写缓存磁盘的目录,请使用 PowerShell 参数 New-ProvScheme CustomProperties

提示:

仅将 PowerShell 参数 New-ProvScheme CustomProperties 用于基于云的托管连接。如果要为本地解决方案(例如 XenServer®)预配使用持久性回写缓存磁盘的计算机,则不需要 PowerShell,因为磁盘会自动持久化。

此参数支持一个额外的属性 PersistWBC,用于确定 MCS 预配的计算机的回写缓存磁盘如何持久化。仅当指定 UseWriteBackCache 参数且设置 WriteBackCacheDiskSize 参数以指示已创建磁盘时,才使用 PersistWBC 属性。

注意:

此行为适用于 Azure 和 GCP,在这两种情况下,默认的 MCSIO 回写缓存磁盘在电源循环时会被删除并重新创建。您可以选择持久化磁盘,以避免 MCSIO 回写缓存磁盘的删除和重新创建。

在支持 PersistWBC 之前,CustomProperties 参数中包含的属性示例包括:

<CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Property xsi:type="StringProperty" Name="UseManagedDisks" Value="true" />
<Property xsi:type="StringProperty" Name="StorageAccountType" Value="Premium_LRS" />
<Property xsi:type="StringProperty" Name="ResourceGroups" Value="benvaldev5RG3" />
</CustomProperties>
<!--NeedCopy-->

注意:

此示例仅适用于 Azure。GCP 环境中的属性有所不同。

使用这些属性时,请注意,如果 CustomProperties 参数中省略了这些属性,它们将包含默认值。PersistWBC 属性有两个可能的值:truefalse

当 Citrix DaaS™ 管理员从管理界面关闭计算机时,将 PersistWBC 属性设置为 true 不会删除回写缓存磁盘。

当 Citrix DaaS 管理员从管理界面关闭计算机时,将 PersistWBC 属性设置为 false 会删除回写缓存磁盘。

注意:

如果省略 PersistWBC 属性,则该属性默认为 false,并且当从管理界面关闭计算机时,回写缓存将被删除。

例如,使用 CustomProperties 参数将 PersistWBC 设置为 true:

<CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Property xsi:type="StringProperty" Name="UseManagedDisks" Value="true" />
<Property xsi:type="StringProperty" Name="StorageAccountType" Value="Premium_LRS" />
<Property xsi:type="StringProperty" Name="ResourceGroups" Value="benvaldev5RG3" />
<Property xsi:type="StringProperty" Name="PersistWBC" Value="true" />
</CustomProperties>
<!--NeedCopy-->

重要:

PersistWBC 属性只能使用 New-ProvScheme PowerShell cmdlet 进行设置。在创建预配方案后尝试更改其 CustomProperties 对计算机目录以及计算机关闭时回写缓存磁盘的持久性没有影响。

例如,将 New-ProvScheme 设置为使用回写缓存,同时将 PersistWBC 属性设置为 true:

New-ProvScheme
-CleanOnBoot
-CustomProperties "<CustomProperties xmlns=`"http://schemas.citrix.com/2014/xd/machinecreation`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`">
<Property xsi:type=`"StringProperty`" Name=`"UseManagedDisks`" Value=`"true`" />
<Property xsi:type=`"StringProperty`" Name=`"StorageAccountType`" Value=`"Premium_LRS`" />
<Property xsi:type=`"StringProperty`" Name=`"ResourceGroups`" Value=`"benvaldev5RG3`" />
<Property xsi:type=`"StringProperty`" Name=`"PersistWBC`" Value=`"true`" />
</CustomProperties>"
-HostingUnitName "adSubnetScale1"
-IdentityPoolName "BV-WBC1-CAT1"
-MasterImageVM "XDHyp:\HostingUnits\adSubnetScale1\image.folder\GoldImages.resourcegroup\W10MCSIO-01_OsDisk_1_a940e6f5bab349019d57ccef65d2c7e3.manageddisk"
-NetworkMapping @{"0"="XDHyp:\HostingUnits\adSubnetScale1\\virtualprivatecloud.folder\CloudScale02.resourcegroup\adVNET.virtualprivatecloud\adSubnetScale1.network"}
-ProvisioningSchemeName "BV-WBC1-CAT1"
-ServiceOffering "XDHyp:\HostingUnits\adSubnetScale1\serviceoffering.folder\Standard_D2s_v3.serviceoffering"
-UseWriteBackCache
-WriteBackCacheDiskSize 127
-WriteBackCacheMemorySize 256
<!--NeedCopy-->

使用 MCSIO 提高启动性能

启用 MCSIO 后,可以提高 Azure 和 GCP 托管磁盘的启动性能。使用 New-ProvScheme 命令中的 PowerShell PersistOSDisk 自定义属性来配置此功能。与 New-ProvScheme 相关的选项包括:

<CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Property xsi:type="StringProperty" Name="UseManagedDisks" Value="true" />
<Property xsi:type="StringProperty" Name="StorageAccountType" Value="Premium_LRS" />
<Property xsi:type="StringProperty" Name="ResourceGroups" Value="benvaldev5RG3" />
<Property xsi:type="StringProperty" Name="PersistOsDisk" Value="true" />
</CustomProperties>
<!--NeedCopy-->

要启用此功能,请将 PersistOSDisk 自定义属性设置为 true。例如:

New-ProvScheme
-CleanOnBoot
-CustomProperties "<CustomProperties xmlns=`"http://schemas.citrix.com/2014/xd/machinecreation`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`"><Property xsi:type=`"StringProperty`" Name=`"UseManagedDisks`" Value=`"true`" /><Property xsi:type=`"StringProperty`" Name=`"StorageAccountType`" Value=`"Premium_LRS`" /><Property xsi:type=`"StringProperty`" Name=`"ResourceGroups`" Value=`"benvaldev5RG3`" /><Property xsi:type=`"StringProperty`" Name=`"PersistOsDisk`" Value=`"true`" /></CustomProperties>"
-HostingUnitName "adSubnetScale1"
-IdentityPoolName "BV-WBC1-CAT1"
-MasterImageVM "XDHyp:\HostingUnits\adSubnetScale1\image.folder\GoldImages.resourcegroup\W10MCSIO-01_OsDisk_1_a940e6f5bab349019d57ccef65d2c7e3.manageddisk"
-NetworkMapping @{"0"="XDHyp:\HostingUnits\adSubnetScale1\\virtualprivatecloud.folder\CloudScale02.resourcegroup\adVNET.virtualprivatecloud\adSubnetScale1.network"}
-ProvisioningSchemeName "BV-WBC1-CAT1"
-ServiceOffering "XDHyp:\HostingUnits\adSubnetScale1\serviceoffering.folder\Standard_D2s_v3.serviceoffering"
-UseWriteBackCache
-WriteBackCacheDiskSize 127
-WriteBackCacheMemorySize 256
<!--NeedCopy-->
回写缓存磁盘