连接到 Google 云环境
创建和管理连接和资源 描述了用于创建连接的向导。以下信息涵盖了 Google 云环境特有的详细信息。
注意:
在创建到 Google 云环境的连接之前,您需要首先将 Google 云帐户设置为资源位置。请参阅 (/zh-cn/citrix-virtual-apps-desktops/2503/install-configure/install-prepare/gcp.html)。
添加连接
请遵循 创建连接和资源 中的指导。以下说明将指导您完成托管连接的设置:
-
在管理 > 配置中,选择左侧窗格中的托管。
-
在操作栏中选择添加连接和资源。
-
在连接页面上,选择创建新连接和 Citrix provisioning™ tools,然后选择下一步。
- 连接类型。从菜单中选择 Google Cloud。
- 连接名称。键入连接的名称。
-
在区域页面上,从菜单中选择一个项目名称,选择包含要使用的资源的区域,然后选择下一步。
-
在网络页面上,键入资源的名称,从菜单中选择一个虚拟网络,选择一个子集,然后选择下一步。资源名称有助于识别区域和网络组合。名称后附加 (Shared) 后缀的虚拟网络表示共享 VPC。如果为共享 VPC 配置了子网级 IAM 角色,则只有共享 VPC 的特定子网会显示在子网列表中。
注意:
- 资源名称可以包含 1–64 个字符,并且不能只包含空格或字符
\ / ; : # . * ? = < > | [ ] { } " ' ( ) ' )。
- 资源名称可以包含 1–64 个字符,并且不能只包含空格或字符
-
在“摘要”页面上,确认信息,然后选择“完成”以退出“添加连接和资源”窗口。
在创建连接和资源之后,您所创建的连接和资源将会被列出。要配置此连接,请选择该连接,然后在操作栏中选择相应的选项。
同样,您可以删除、重命名或测试在该连接下创建的资源。为此,请选择连接下的资源,然后在操作栏中选择适用的选项。
服务端点 URL
您必须有权访问以下 URL:
https://oauth2.googleapis.comhttps://cloudresourcemanager.googleapis.comhttps://compute.googleapis.comhttps://storage.googleapis.comhttps://cloudbuild.googleapis.com
Google Cloud projects
Google Cloud 项目主要有两种类型:
- 预配项目:在这种情况下,当前管理员帐户拥有项目中预配的计算机。此项目也称为本地项目。
- 共享 VPC 项目:在此项目中,预配项目中创建的计算机使用共享 VPC 项目中的 VPC。用于预配项目的管理员帐户在此项目中具有有限的权限,具体来说,仅具有使用 VPC 的权限。
为 GCP 托管流量创建安全环境
您可以允许私有 Google 访问您的 Google Cloud 项目。此实施可增强安全性以处理敏感数据。为此,您可以执行以下操作之一:
-
为 Cloud Build 服务帐户包含 VPC 服务控制的以下入站规则。如果执行此步骤,则无需遵循以下为 GCP 托管流量创建安全环境的步骤。
Ingress Rule 1 From: Identities: <ProjectID>@cloudbuild.gserviceaccount.com Source > All sources allowed To: Projects = All projects Services = Service name: All services <!--NeedCopy--> -
如果您正在使用私有工作池,请在
CustomProperties中添加UsePrivateWorkerPool。有关私有工作池的信息,请参阅 私有池概述。
为 GCP 托管流量创建安全环境的要求
为 GCP 托管流量创建安全环境的要求如下:
- 在更新自定义属性时,请确保托管连接处于维护模式。
- 要使用私有工作池,需要进行以下更改:
- 对于 Citrix Cloud™ 服务帐户,添加以下 IAM 角色:
- 云构建服务帐户
- 计算实例管理员
- 服务帐户用户
- 服务帐户令牌创建者
- 云构建工作池所有者
- 在用于创建托管连接的同一项目中创建 Citrix Cloud 服务帐户。
-
按照 DNS 配置 中所述,为
private.googleapis.com和gcr.io设置 DNS 区域。

-
设置专用网络地址转换 (NAT) 或使用专用服务连接。有关详细信息,请参阅 通过端点访问 Google API。

-
如果使用对等 VPC,请创建 Cloud DNS 区域对等互连到对等 VPC。有关详细信息,请参阅 创建对等区域。

-
在 VPC 服务控制中,设置出站规则,以便 API 和 VM 可以与 Internet 通信。入站规则是可选的。例如:
Egress Rule 1 From: Identities:ANY_IDENTITY To: Projects = All projects Service = Service name: All services <!--NeedCopy-->
- 对于 Citrix Cloud™ 服务帐户,添加以下 IAM 角色:
启用专用工作程序池
要启用专用工作程序池,请在主机连接上按如下方式设置自定义属性:
- 从 Delivery Controller 主机打开 PowerShell 窗口或使用远程 PowerShell 软件开发工具包。有关远程 PowerShell 软件开发工具包的更多信息,请参阅 软件开发工具包和 API。
-
运行以下命令:
Add-PSSnapin citrix*cd XDHyp:\Connections\dir
- 将
CustomProperties从连接复制到记事本。 -
追加属性设置
<Property xsi:type="StringProperty" Name="UsePrivateWorkerPool" Value="True"/>。例如:``` <CustomProperties xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.citrix.com/2014/xd/machinecreation"> <Property xsi:type="StringProperty" Name="UsePrivateWorkerPool" Value="True"/> </CustomProperties> <!--NeedCopy--> ``` - 在 PowerShell 窗口中,将变量分配给修改后的自定义属性。例如:
$customProperty = '<CustomProperties…</CustomProperties>'。 - 运行
$gcpServiceAccount = "<ENTER YOUR SERVICE ACCOUNT EMAIL HERE>"。 - 运行
$gcpPrivateKey = "<ENTER YOUR SERVICE ACCOUNT PRIVATE KEY HERE AFTER REMOVING ALL INSTANCES OF \n >"。 - 运行
$securePassword = ConvertTo-SecureString $gcpPrivateKey -AsPlainText -Force。 -
运行以下命令以更新现有主机连接:
Set-Item -PassThru -Path @('XDHyp:\\Connections\\<ENTER YOUR CONNECTION NAME HERE>') -SecurePassword $securePassword -UserName $gcpServiceAccount -CustomProperties $customProperty <!--NeedCopy-->
指定 CMEK 全局和区域密钥
注意:
GCP 中对 CMEK 的支持目前处于预览阶段。
GCP 中有两种类型的客户管理的加密密钥 (CMEK):
- 区域: 只能由同一区域中的资源使用的加密密钥。
- 全局: 可由来自多个区域的资源使用的加密密钥。
您可以浏览和使用服务帐户可访问的所有项目中的全局或区域客户管理的加密密钥 (CMEK)。然后,您可以使用该密钥创建启用 CMEK 的 MCS 计算机目录,并使用 Set-ProvScheme 命令更新现有启用 CMEK 的 MCS 计算机目录。有关使用 PowerShell 创建启用 CMEK 的目录的信息,请参阅使用自定义属性创建启用 CMEK 的目录。
对于此功能,您需要以下两个服务帐户的额外权限:
- 与当前项目关联的、用于创建托管连接的服务帐号。
- 当前项目的 Compute Engine 服务代理(其电子邮件为:
service-PROJECT_NUMBER@compute-system.iam.gserviceaccount.com)。有关详细信息,请参阅 Compute Engine 服务代理。
在“服务帐户”中,您必须在使用加密密钥的项目(例如,共享项目)中分配以下角色:
- 云密钥管理服务查看者
- Cloud KMS 加密密钥加密器/解密器
如果您没有被分配到这些角色,那么请确保您拥有以下权限:
- resourcemanager.projects.get
- cloudkms.keyRings.list
- 云密钥管理服务.密钥环.获取
- cloudkms.加密密钥.获取
- 云密钥管理服务.加密密钥.列出
- 云密钥管理服务.加密密钥版本.用于解密
- 云密钥管理服务.加密密钥版本.用于加密
列出加密密钥
您可以使用 PowerShell 命令列出同一项目和所有其他可访问项目中的全局和区域加密密钥。为此,请执行以下操作:
- 从 交付控制器™ 主机或远程 PowerShell 打开 PowerShell 窗口。
- 运行命令
asnp citrix*以加载 Citrix 特定的 PowerShell 模块。 -
运行以下命令以列出加密密钥。示例:
-
要列出
encryptionKeys文件夹的内容:Get-ChildItem XDHyp:\HostingUnits\my-hostingunit\encryptionKeys.folder <!--NeedCopy--> -
要在同一项目中获取全局加密密钥:
Get-Item XDHyp:\HostingUnits\my-hostingunit\encryptionKeys.folder\myglobalkeyring.globalkeyring\myglobalkey.cryptokey <!--NeedCopy--> -
要在同一项目中获取区域加密密钥:
Get-Item XDHyp:\HostingUnits\my-hostingunit\encryptionKeys.folder\regional-ring.keyring\shared-key.cryptokey <!--NeedCopy--> -
要从另一个可访问的项目(例如:myanotherproject)获取全局加密密钥:
Get-Item XDHyp:\HostingUnits\my-hostingunit\encryptionKeys.folder\myanotherproject.project\shared-global-ring.globalkeyring\shared-key.cryptokey <!--NeedCopy--> -
要从另一个可访问的项目(例如:myanotherproject)获取区域加密密钥:
Get-Item XDHyp:\HostingUnits\my-hostingunit\encryptionKeys.folder\myanotherproject .project.project\shared-uscentral.keyring\shared-uscentral-key.cryptokey <!--NeedCopy-->
-
注意:
- 全局密钥环的密钥环清单项的扩展名为
.globalkeyring。- 全局密钥环的 ID 中包含单词
global。
所需的 GCP 权限
本节包含 GCP 权限的完整列表。请使用本节中提供的完整权限集,以确保功能正常运行。
注意:
GCP 将在 2024 年 4 月 29 日之后对 Cloud Build Services 的默认行为和服务帐户的使用进行更改。有关详细信息,请参阅 Cloud Build Service Account Change。您在 2024 年 4 月 29 日之前启用了 Cloud Build API 的现有 Google 项目不受此更改的影响。但是,如果您希望在 4 月 29 日之后仍保持现有的 Cloud Build Service 行为,则可以在启用 API 之前创建或应用组织策略以禁用约束强制执行。如果您设置了新的组织策略,则仍可以遵循本节中现有的权限以及标记为 Before Cloud Build Service Account Change 的项目。否则,请遵循标记为 After Cloud Build Service Account Change 的现有权限和项目。
主机连接的创建
-
在预配项目中,Citrix Cloud 服务帐户所需的最低权限:
compute.instanceTemplates.list compute.instances.list compute.networks.list compute.projects.get compute.regions.list compute.subnetworks.list compute.zones.list resourcemanager.projects.get <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 计算管理员
- 云数据存储用户
-
在共享 VPC 项目中,Citrix Cloud 服务帐户的共享 VPC 所需的额外权限:
compute.networks.list compute.subnetworks.list resourcemanager.projects.get <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 计算网络用户
-
在服务帐户中,您必须在使用加密密钥的项目(例如,共享项目)中分配以下角色:
- 云密钥管理服务查看者
- Cloud KMS 加密密钥加密者/解密者
如果您未被授予这些角色,则请确保您拥有以下权限:
- resourcemanager.projects.get
- 列出云密钥管理服务密钥环
- 获取云密钥管理服务密钥环
- cloudkms.cryptoKeys.get
- cloudkms.加密密钥.列出
- cloudkms.加密密钥版本.用于解密
- cloudkms.加密密钥版本.用于加密
虚拟机的电源管理
仅针对电源管理的目录,预配项目中的 Citrix Cloud 服务帐户所需的最低权限:
compute.instanceTemplates.list
compute.instances.list
compute.instances.get
compute.instances.reset
compute.instances.resume
compute.instances.start
compute.instances.stop
compute.instances.suspend
compute.networks.list
compute.projects.get
compute.regions.list
compute.subnetworks.list
compute.zones.list
resourcemanager.projects.get
compute.zoneOperations.get
<!--NeedCopy-->
以下 Google 定义的角色具有上述权限:
- 计算管理员
- 云数据存储用户
创建、更新或删除虚拟机
-
预配项目中的 Citrix Cloud 服务帐户所需的最低权限:
cloudbuild.builds.create cloudbuild.builds.get cloudbuild.builds.list compute.acceleratorTypes.list compute.diskTypes.get compute.diskTypes.list compute.disks.create compute.disks.createSnapshot compute.disks.delete compute.disks.get compute.disks.list compute.disks.setLabels compute.disks.use compute.disks.useReadOnly compute.firewalls.create compute.firewalls.delete compute.firewalls.list compute.globalOperations.get compute.images.create compute.images.delete compute.images.get compute.images.list compute.images.setLabels compute.images.useReadOnly compute.instanceTemplates.create compute.instanceTemplates.delete compute.instanceTemplates.get compute.instanceTemplates.list compute.instanceTemplates.useReadOnly compute.instances.attachDisk compute.instances.create compute.instances.delete compute.instances.detachDisk compute.instances.get compute.instances.getSerialPortOutput compute.instances.list compute.instances.reset compute.instances.resume compute.instances.setDeletionProtection compute.instances.setLabels compute.instances.setMetadata compute.instances.setServiceAccount compute.instances.setTags compute.instances.start compute.instances.stop compute.instances.suspend compute.machineTypes.get compute.machineTypes.list compute.networks.list compute.networks.updatePolicy compute.nodeGroups.list compute.nodeTemplates.get compute.projects.get compute.regions.list compute.snapshots.create compute.snapshots.delete compute.snapshots.list compute.snapshots.get compute.snapshots.setLabels compute.snapshots.useReadOnly compute.subnetworks.get compute.subnetworks.list compute.subnetworks.use compute.zoneOperations.get compute.zoneOperations.list compute.zones.get compute.zones.list iam.serviceAccounts.actAs resourcemanager.projects.get storage.buckets.create storage.buckets.delete storage.buckets.get storage.buckets.list storage.buckets.update storage.objects.create storage.objects.delete storage.objects.get storage.objects.list compute.networks.get compute.resourcePolicies.use <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 计算管理员
- 存储管理员
- 云构建编辑者
- 服务帐户用户
- 云数据存储用户
-
Citrix Cloud 服务帐户在共享 VPC 项目中创建使用共享 VPC 项目中的 VPC 和子网的托管单元所需的共享 VPC 附加权限:
compute.firewalls.list compute.networks.list compute.projects.get compute.regions.list compute.subnetworks.get compute.subnetworks.list compute.subnetworks.use compute.zones.list resourcemanager.projects.get <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 计算网络用户
- 云数据存储用户
将准备说明磁盘下载到 MCS 时所需的最低权限:
- (在 Cloud Build 服务帐户更改之前):将这些权限分配给预配项目中的 Cloud Build 服务帐户。
- (在 Cloud Build 服务帐户更改之后):将这些权限分配给预配项目中的 Cloud Compute 服务帐户。
compute.disks.create compute.disks.delete compute.disks.get compute.disks.list compute.disks.setLabels compute.disks.use compute.disks.useReadOnly compute.images.get compute.images.list compute.images.useReadOnly compute.instances.create compute.instances.delete compute.instances.get compute.instances.getSerialPortOutput compute.instances.list compute.instances.setLabels compute.instances.setMetadata compute.instances.setServiceAccount compute.machineTypes.list compute.networks.get compute.networks.list compute.projects.get compute.subnetworks.list compute.subnetworks.use compute.subnetworks.useExternalIp compute.zoneOperations.get compute.zones.list iam.serviceAccounts.actAs logging.logEntries.create pubsub.topics.publish resourcemanager.projects.get source.repos.get source.repos.list storage.buckets.create storage.buckets.get storage.buckets.list storage.objects.create storage.objects.delete storage.objects.get storage.objects.list <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 云构建服务帐号(在云构建服务帐号更改后,它是云计算服务帐号)
- 计算实例管理员
- 服务帐户用户
-
Google Cloud Build 服务在将准备说明磁盘下载到 MCS 时,预配项目中的 Cloud Compute 服务帐户所需的最低权限:
resourcemanager.projects.get storage.objects.create storage.objects.get storage.objects.list <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 计算网络用户
- 存储账户用户
- 云数据存储用户
将准备说明磁盘下载到 MCS 时,共享 VPC 所需的额外权限:
- (在 Cloud Build 服务帐户更改之前):将这些权限分配给预配项目中的 Cloud Build 服务帐户。
- (在 Cloud Build 服务帐户更改之后):将这些权限分配给预配项目中的 Cloud Compute 服务帐户。
compute.firewalls.list compute.networks.list compute.subnetworks.list compute.subnetworks.use resourcemanager.projects.get <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 计算网络用户
- 存储账户用户
- 云数据存储用户
-
预配项目中 Citrix Cloud 服务帐户的云密钥管理服务 (KMS) 所需的额外权限:
cloudkms.cryptoKeys.get cloudkms.cryptoKeys.list cloudkms.keyRings.get cloudkms.keyRings.list <!--NeedCopy-->以下 Google 定义的角色具有上述权限:
- 计算 KMS 查看器
常规权限设置
以下是预配项目中 Citrix Cloud 服务帐户在 MCS 中支持的所有功能所需的权限。这些权限提供了最佳的未来兼容性:
resourcemanager.projects.get
cloudbuild.builds.create
cloudbuild.builds.get
cloudbuild.builds.list
compute.acceleratorTypes.list
compute.diskTypes.get
compute.diskTypes.list
compute.disks.create
compute.disks.createSnapshot
compute.disks.delete
compute.disks.get
compute.disks.setLabels
compute.disks.use
compute.disks.useReadOnly
compute.firewalls.create
compute.firewalls.delete
compute.firewalls.list
compute.globalOperations.get
compute.images.create
compute.images.delete
compute.images.get
compute.images.list
compute.images.setLabels
compute.images.useReadOnly
compute.instanceTemplates.create
compute.instanceTemplates.delete
compute.instanceTemplates.get
compute.instanceTemplates.list
compute.instanceTemplates.useReadOnly
compute.instances.attachDisk
compute.instances.create
compute.instances.delete
compute.instances.detachDisk
compute.instances.get
compute.instances.getSerialPortOutput
compute.instances.list
compute.instances.reset
compute.instances.resume
compute.instances.setDeletionProtection
compute.instances.setLabels
compute.instances.setMetadata
compute.instances.setTags
compute.instances.start
compute.instances.stop
compute.instances.suspend
compute.instances.update
compute.instances.updateAccessConfig
compute.instances.updateDisplayDevice
compute.instances.updateSecurity
compute.instances.updateShieldedInstanceConfig
compute.instances.updateShieldedVmConfig
compute.machineTypes.get
compute.machineTypes.list
compute.networks.list
compute.networks.updatePolicy
compute.nodeGroups.list
compute.nodeTemplates.get
compute.projects.get
compute.regions.list
compute.snapshots.create
compute.snapshots.delete
compute.snapshots.list
compute.snapshots.get
compute.snapshots.setLabels
compute.snapshots.useReadOnly
compute.subnetworks.get
compute.subnetworks.list
compute.subnetworks.use
compute.subnetworks.useExternalIp
compute.zoneOperations.get
compute.zoneOperations.list
compute.zones.get
compute.zones.list
resourcemanager.projects.get
storage.buckets.create
storage.buckets.delete
storage.buckets.get
storage.buckets.list
storage.buckets.update
storage.objects.create
storage.objects.delete
storage.objects.get
storage.objects.list
cloudkms.cryptoKeys.get
cloudkms.cryptoKeys.list
cloudkms.keyRings.get
cloudkms.keyRings.list
compute.disks.list
compute.instances.setServiceAccount
compute.networks.get
compute.networks.use
compute.networks.useExternalIp
iam.serviceAccounts.actAs
compute.resourcePolicies.use
cloudkms.cryptoKeyVersions.useToDecrypt
cloudkms.cryptoKeyVersions.useToEncrypt
<!--NeedCopy-->