连接到 Google 云环境
创建和管理连接和资源 介绍了创建连接的向导。以下信息涵盖了 Google 云环境特有的详细信息。
注意:
在创建到 Google 云环境的连接之前,您需要首先将您的 Google 云帐户设置为资源位置。请参阅 Google Cloud 环境。
添加连接
请遵循 创建连接和资源 中的指导。以下说明将指导您设置托管连接:
-
从 管理 > 配置 中,在左侧窗格中选择 托管。
-
在操作栏中选择 添加连接和资源。
-
在 连接 页面上,选择 创建新连接 和 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 角色:
启用专用工作池功能
要启用专用工作池,请在主机连接上按如下方式设置自定义属性:
- 从交付控制器主机打开 PowerShell 窗口或使用远程 PowerShell SDK。有关远程 PowerShell SDK 的更多信息,请参阅 SDK 和 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-->
所需的 GCP 权限
本节包含 GCP 权限的完整列表。请使用本节中提供的完整权限集,以确保功能正常运行。
注意:
GCP 正在引入对 Cloud Build Services 默认行为和服务帐户使用方式的更改,这些更改将于 2024 年 4 月 29 日之后生效。有关更多信息,请参阅 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 定义的角色具有上述权限:
- 计算网络用户
VM 的电源管理
在仅电源管理的目录情况下,预配项目中 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 定义的角色具有上述权限:
- 计算管理员
- 云数据存储用户
创建、更新或删除 VM
-
预配项目中 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.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 定义的角色具有上述权限:
- 计算管理员
- 存储管理员
- 云构建编辑者
- 服务帐户用户
- 云数据存储用户
-
共享 VPC 所需的额外权限,适用于共享 VPC 项目中的 Citrix Cloud 服务帐户,以使用共享 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 定义的角色具有上述权限:
- 云构建服务帐户(在云构建服务帐户更改后,它是云计算服务帐户)
- 计算实例管理员
- 服务帐户用户
-
将准备说明磁盘下载到 MCS 时,Google Cloud Build 服务在预配项目中为 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.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
<!--NeedCopy-->
后续步骤
- 如果您处于初始部署过程中,请参阅 创建计算机目录
- 有关 Google 云平台 (GCP) 的特定信息,请参阅 创建 Google 云平台目录