这篇文章已经过机器翻译.放弃
在 Azure 中创建准备好的映像计算机目录
使用以下方法创建准备好的映像并使用准备好的映像创建 MCS 计算机目录:
使用准备好的映像创建 MCS 计算机目录的关键步骤是:
- 创建映像定义和初始映像版本。
- 使用映像版本作为准备好的映像来创建目录
使用 Studio
创建映像定义和初始映像版本
要创建映像定义和初始映像版本,请执行以下操作:
- 从 Studio 中,转到 图像 节点,然后单击 创建映像定义. 点击 下一个 在 介绍 页。
- 在 图像定义 页面上,指定 OS 类型 和 会话类型 对于映像定义。
- 选择现有资源组或创建一个新资源组来保存映像资源。 要启用映像共享,请选择 置入图像版本 ,然后选择创建新库或使用现有库来保存其映像版本。
-
在 图像 页面上,选择 资源 (仅列出适用于设置连接的资源)和主映像,以用作创建映像版本的模板。 您可以选择 使用计算机配置文件 复选框,然后选择计算机配置文件。
注意:
在选择映像之前,请验证主映像是否安装了 VDA 2311 或更高版本,并且 MCSIO 驱动程序已安装在 VDA 上。
-
在 存储和许可证类型 页面上,选择要在映像准备过程中使用的存储和许可证类型。
注意:
如果您在 图像 页面上,计算机配置文件的许可证类型将根据配置文件设置预先选择。
- 在 机器规格 页面上,选择计算机大小。 如果您在 图像 页面上,则默认选择计算机配置文件的计算机大小。
- 在 网卡 页面上,为准备映像选择或添加 NIC。 对于每个 NIC,选择一个关联的虚拟网络。
- 在 磁盘设置 页面上,选择客户管理的加密密钥 (CMEK)。 如果计算机配置文件没有 CMEK,但主映像有,则会从主映像中预先选择 CMEK。
- 在 版本描述 页面上,输入创建的初始映像版本的描述。
- 在 总结 页面上,检查映像定义和创建的初始映像版本的详细信息。 输入映像定义的名称和描述。 单击完成。
创建映像版本
映像版本允许管理特定映像的不同迭代或更新。 此功能使您能够维护映像的多个版本以用于不同目的。
要从初始映像版本创建映像版本,请执行以下操作:
注意:
所有映像版本的托管单元必须相同。
- 转到 图像 节点中,选择镜像版本或镜像定义,然后单击 创建映像版本.
- 在 Image definition (映像定义) 页面上,您可以更改托管单元,然后重新选择该映像版本的主映像和计算机配置文件。
- 如果您希望映像版本的配置与初始配置的映像版本不同,请在 存储和许可证类型, 机器规格, 网卡和 磁盘设置 页面的 创建映像版本 对话。
- 添加映像版本的描述。 单击完成。
注意:
如果映像版本的创建因任何原因失败,则 解决 选项卡提供了 重试 选择。
共享的准备好的映像
要在 Azure 的不同主机单元之间共享准备好的映像,请执行以下步骤:
- 右键单击映像版本,然后选择 管理映像共享. 将列出所选连接下的所有主机单元。 对于任何操作,从中创建映像版本的资源都处于禁用状态。
- 选择要与之共享映像的主机单元,然后单击 救. 这 共享状态 列显示 In progress。
- 单击 资源 选项卡,了解有关共享状态的更多详细信息。
注意:
当映像版本共享的状态为 in progress (正在进行) 时,选项 删除映像版本 或 管理映像共享 已禁用。
从 Images 节点创建计算机目录
使用 创建目录 选项中的 图像 节点创建目录,以使用映像版本创建目录。
或者,您也可以在 计算机目录 节点,链接到目录创建工作流程中的 Prepared Image 选项。 看 从 Machine Catalogs 节点创建计算机目录
要从 图像 节点中,请执行以下操作:
- 选择镜像版本,然后单击 创建目录. 点击 下一个 在 介绍 页。
- 在 桌面体验 页面上,选择所需的桌面体验。
- 从 图像 page 设置为 磁盘设置 页面上,将根据所选映像版本预先选择设置。
- 在 资源组 页面上,您可以选择创建新的资源组或使用现有资源组来放置此目录的资源。
- 完成以下页面上的设置。
- 在 总结 页面上,检查计算机目录的详细信息。 输入计算机目录的名称和描述。 单击完成。
- 转到 计算机目录 节点以查看已创建的计算机目录。
从 Machine Catalogs 节点创建计算机目录
要从 计算机目录 节点中,请执行以下操作:
- 点击 计算机目录 在左侧导航窗格中。
- 点击 创建计算机目录. 这 计算机目录设置 页面。 点击 下一个 通过 介绍 和 机器类型 页面。
- 在 机器管理 页面上,选择以下设置:
- 选择 受电源管理的计算机(例如,虚拟机或刀片式 PC)。
- 选择 Citrix Provisioning 技术. 然后,选择 Citrix Machine Creation 服务.
- 在 资源 字段中,将列出属于不同区域的资源。 选择任何 Azure 网络资源,然后单击 下一个.
- 在 图像 页: 对于 Maste 图像类型,请执行以下步骤:
- 选择 主映像.
- 在 主映像 下,选择一个映像。 边栏选项卡列出了与 Resources (资源) 属于同一区域的所有图像。
- 单击 Done。 对于 Prepared image type (准备的图像类型),请执行以下步骤:
- 选择 准备好的图片.
- 在 准备好的图片中,选择映像定义的映像版本。
- 单击镜像版本名称。 要查看有关所选映像版本的更多详细信息,请单击带下划线的版本号。
- 如果所选映像版本配置了计算机配置文件,请选择计算机配置文件。 如果所选映像版本未配置计算机配置文件,则无法选择使用计算机配置文件。
- 在以下页面上配置设置。
- 在 磁盘设置 页面上,如果所选准备好的映像使用磁盘加密集,则无法删除加密集,但可以将密钥更改为其他加密密钥。
- 在 资源组 页面上,您可以选择创建新的资源组或使用现有资源组来放置此目录的资源。
- 完成以下页面上的设置。
- 在 总结 页面上,检查计算机目录的详细信息。 输入计算机目录的名称和描述。 单击完成。
使用 PowerShell
创建准备好的映像
用于创建准备好的映像版本规范的详细 PowerShell 命令如下:
-
使用
Test-ProvImageDefinitionNameAvailable 命令
. 例如,Test-ProvImageDefinitionNameAvailable -ImageDefinitionName <string[]>
-
使用
新特性图像定义
命令。 例如,New-ProvImageDefinition -ImageDefinitionName image1 -OsType Windows -VdaSessionSupport MultiSession
-
使用
Add-ProvImageDefinitionConnection
命令。这
自定义属性
为Add-ProvImageDefinitionConnection
可以包括以下内容。 如果不使用这些参数,则使用默认值。-
资源组
:具有基础磁盘的资源组。 -
使用共享图像库
:基础磁盘类型的指示器。 用真
对于 ACG(图像共享)和假
用于快照。 -
图片库
:基础磁盘为 ACG 镜像版本时的 Gallery 名称。
例如,
-
如果是快照和客户提供的资源组:
$CustomerOwnRsourceGroupProperties = @" <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="yangj_image" /> </CustomProperties> "@
-
如果是 ACG 和客户提供的资源组和图片库:
$CustomerOwnAllProperties = @" <CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Property xsi:type="StringProperty" Name="UseSharedImageGallery" Value="true" /> <Property xsi:type="StringProperty" Name="ResourceGroups" Value="rg" /> <Property xsi:type="StringProperty" Name="ImageGallery" Value="gallery" /> </CustomProperties> "@
-
In case of ACG and customer provided resource group only:
$CustomerOwnResourceGroupProperties = @" <CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Property xsi:type="StringProperty" Name="UseSharedImageGallery" Value="true" /> <Property xsi:type="StringProperty" Name="ResourceGroups" Value="rg" /> </CustomProperties> “@
-
In case of ACG and resource group and image gallery managed by Citrix:
$CustomerOwnResourceGroupNothingProperties = @" <CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Property xsi:type="StringProperty" Name="UseSharedImageGallery" Value="true" /> </CustomProperties> “@
```
-
Add-ProvImageDefinitionConnection -ImageDefinitionName image1 -HypervisorConnectionName Azure28 [-CustomProperties $CustomProperties]
1. Create an image version using the `New-ProvImageVersion` command. For example,
```
New-ProvImageVersion -ImageDefinitionName image1 -Description “version 1”
- Add a master image version spec to the image version using the
Add-ProvImageVersionSpec
command. For example,
```
Add-ProvImageVersionSpec -ImageDefinitionName image1 -ImageVersionNumber 1 -HostingUnitName azure -MasterImagePath “XDHyp:\HostingUnits\azure\image.folder\azureresourcegroup.resourcegroup\win2022-snapshot.snapshot”
> **注意:**
>
> 您只能将一个主映像版本规范添加到托管单元的一个映像版本中。
1. Create a prepared image version spec from the master image version spec using the `New-ProvImageVersionSpec` command. For example,
```
New-ProvImageVersionSpec (新 ProvImageVersionSpec) -SourceImageVersionSpecUid c6e7384c-b2f8-46d6-9519-29a2c57ed3cb -NetworkMapping @{“0”=“XDHyp:\HostingUnits\azure\virtualprivatecloud.folder\azureresourcegroup.resourcegroup\azure-vnet-eastus.virtualprivatecloud\dev.network”} -ServiceOffering“XDHyp:\HostingUnits\azure\serviceoffering.folder\Standard_B2ms.serviceoffering” -CustomProperties ”<CustomProperties xmlns=`"http://schemas.citrix.com/2014/xd/machinecreation`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`"></CustomProperties>“ -RunAsynchronously
- You can also share prepared image version spec with another hosting unit within the same hosting connection using the
Add-ProvImageVersionSpecHostingUnit
command. For example,
```
Add-ProvImageVersionSpecHostingUnit -ImageVersionSpecUid xxxxxxx -HostingUnitName AzureWest
> **注意:**
>
> 一个托管单元和准备类型只能有一个准备好的实例。
**Example of the complete set of Powershell commands to create image definition, image version, and prepared image version spec**:
New-ProvImageDefinition-ImageDefinitionName image1-OsType Windows-VdaSessionSupport MultiSession
$CustomProperties = @” -HostingUnitUid $hostingunit.HostingUnitUid
-MasterImagePath “XDHyp:\HostingUnits\azure28\image.folder\abc.resourcegroup\def-snapshot.snapshot”
New-ProvImageVersionSpec -NetworkMapping @{“0” = “XDHyp:\HostingUnits\azure28\virtualprivatecloud.folder\East US.region\virtualprivatecloud.folder\studio-mcs-infrastructure.resourcegroup\studio-mcs-vnet-eastus.virtualprivatecloud\mcs-dev.network” } -CustomProperties ”<CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation
” xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
”><Property xsi:type="StringProperty
” Name="LicenseType
” Value="Windows_Server
” /></CustomProperties>“ -ServiceOffering ”XDHyp:\HostingUnits\azure28\serviceoffering.folder\Standard_B2s.serviceoffering“ -SourceImageVersionSpecUid $SourceImageVersionSpec.ImageVersionSpecUid (图像版本SpecUid) Add-ProvImageVersionSpecHostingUnit -ImageVersionSpecUid xxxxxxx -HostingUnitName AzureWest $PreparedImageVersionSpec = Get-ProvImageVersionSpec -ImageVersionUid $imageVersion.ImageVersionUid |其中 SourceImageVersionSpecUid-eq $SourceImageVersionSpec.ImageVersionSpecUid (图像版本SpecUid)
> **注意:**
>
> - 映像定义中的所有映像版本规范必须属于同一托管单元。
> - 一个映像版本只能有一个主映像版本规范和一个准备好的映像版本规范。
> - 所有映像版本规范都必须具有计算机配置文件,或者任何映像版本规范都不必具有计算机配置文件。
### Create a catalog using a prepared image version spec
Create an MCS machine catalog from the prepared image version spec using the `New-ProvScheme` command. For example,
New-ProvScheme -ProvisioningSchemeName
Or,
New-ProvScheme -ProvisioningSchemeName
If you want to use an ACG image version spec, then set `UseSharedImageGallery` as `true`. For example,
$provSchemeCustomProperties= @”
</CustomProperties> “@ New-ProvScheme -ProvisioningSchemeName assignimage -ImageVersionSpecUid $PreparedImageVersionSpec.ImageVersionSpecUid (图像版本SpecUid) -HostingUnitUid $hostingunit.HostingUnitUid
-身份池 $IdentityPool.IdentityPoolUid -CleanOnBoot -范围 @() -SecurityGroup @()
-ServiceOffering “XDHyp:\HostingUnits\azure28\serviceoffering.folder\Standard_B2s.serviceoffering” -NetworkMapping @{“0”=“XDHyp:\HostingUnits\azure28\virtualprivatecloud.folder\East US.region\virtualprivatecloud.folder\studio-mcs-infrastructure.resourcegroup\studio-mcs-vnet-eastus.virtualprivatecloud\mcs-dev.network”}
-自定义属性 $provSchemeCustomProperties
**Example of the complete set of Powershell commands to create a catalog:**
$Catalog = New-BrokerCatalog -AllocationType “随机” -IsRemotePC $False -MinimumFunctionalLevel “L7_20” -Name “azurecatalog” -PersistUserChanges “discard” -ProvisioningType “MCS” -scope @() -SessionSupport “MultiSession”
$IdentityPool = New-AcctIdentityPool -AllowUnicode -Domain “azure.local” -IdentityPoolName “azurecatalog” -IdentityType “ActiveDirectory” -NamingScheme “azure##” -NamingSchemeType “数字” -范围 @()
$PreparedImageVersionSpec = Get-ProvImageVersionSpec -ImageDefinitionName image1 -ImageVersionNumber 1 -Filter “PreparationType -eq ‘Mcs’”
$Task = New-ProvScheme -ProvisioningSchemeName azurecatalog -ImageVersionSpecUid $PreparedImageVersionSpec.ImageVersionSpecUid -HostingUnitName azure -IdentityPoolName azurecatalog -CleanOnBoot -Scope @() -SecurityGroup @() -ServiceOffering “XDHyp:\HostingUnits\azure\serviceoffering.folder\Standard_B2s.serviceoffering” -NetworkMapping @{“0”=“XDHyp:\HostingUnits\azure\virtualprivatecloud.folder\azureresourcegroup.resourcegroup\azure-vnet-eastus.virtualprivatecloud\dev.network”} -CustomProperties ”<CustomProperties xmlns="http://schemas.citrix.com/2014/xd/machinecreation
” xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
”> "StringProperty
” Name="StorageAccountType
” Value="StandardSSD_LRS
” /></CustomProperties>“ -RunAsynchronously
Get-ProvTask -TaskId $Task.TaskId $ProvScheme = Get-ProvScheme -ProvisioningSchemeName azurecatalog
Set-BrokerCatalog -名称 $Catalog.名称 -ProvisioningSchemeId $ProvScheme.ProvisioningSchemeUid
### Create Azure AD joined and Microsoft Intune enrolled catalogs with prepared images
You can now use prepared images to create Azure Active Directory joined and Microsoft Intune enrolled catalogs. This feature is applicable to single and multi-session persistent and non-persistent type MCS catalogs. This implementation significantly reduces the storage and time costs, and simplifies the VM deployment and image update process.
#### Examples
- To create an Azure AD catalog using a prepared image.
```
New-ProvScheme -ProvisioningSchemeName <name> -ImageVersionSpecUid <preparedVersionSpecUid> -HostingUnitUid <hostingUnitUid> -IdentityPoolUid <IdentityPoolUid> [-CleanOnBoot] -NetworkMapping @{"0"="XDHyp:\HostingUnits\<hostingunitName>\<region>.region\virtualprivatecloud.folder\<resourcegroupName>.resourcegroup\<vnetName>.virtualprivatecloud\<sunNetName>.network"} -ServiceOffering <serviceofferingPath> [-MachineProfile <machineProfilePath>] [-CustomProperties <>]
-
To create an Azure AD catalog enrolled in Microsoft Intune using a prepared image:
New-ProvScheme -ProvisioningSchemeName <name> -ImageVersionSpecUid <preparedVersionSpecUid> -HostingUnitUid <hostingUnitUid> -IdentityPoolUid <IdentityPoolUid> [-CleanOnBoot] -NetworkMapping @{"0"="XDHyp:\HostingUnits\<hostingunitName>\<region>.region\virtualprivatecloud.folder\<resourcegroupName>.resourcegroup\<vnetName>.virtualprivatecloud\<sunNetName>.network"} -ServiceOffering <serviceofferingPath> [-MachineProfile <machineProfilePath>] [-CustomProperties <>]