与 Google Cloud 环境的连接
创建和管理连接和资源介绍了用于创建连接的向导。 以下信息涵盖了特定于 Google Cloud 环境的详细信息。
注意:
在创建与 Google 云环境的连接之前,您需要先完成将 Google 云账户设置为资源位置。 看 Google Cloud 虚拟化环境.
添加连接
在 Studio 中,按照 创建和管理连接和资源. 以下描述将指导您设置托管连接:
- 从 Studio 中,选择 好客 在左侧窗格中。
- 选择 添加连接和资源 在操作栏中。
-
在 连接 页面上,选择 创建新连接 和 Citrix Provisioning 工具,然后选择 下一个.
- 区域名称. 选择您希望主机资源所在的区域 (相当于资源位置)。 当您创建资源位置并向其添加 Cloud Connector 时,会自动创建区域。 有关更多信息,请参阅 区.
- 连接类型. 选择 Google Cloud 平台 从菜单中。
-
服务账户密钥. 导入 Google 凭据文件 (.json) 中包含的密钥。 您可以从凭据文件中粘贴密钥,也可以浏览到凭据文件。 要粘贴密钥:
- 找到您的凭证文件
- 使用记事本(或任何文本编辑器)打开文件
- 复制内容。
- 返回 连接 页面上,选择 添加密钥,粘贴内容,然后选择 做.
- 服务账户 ID. 该字段会自动填充服务帐户密钥中的信息。
- 连接名称. 键入连接的名称。
-
通过 Citrix Cloud Connector 路由流量. 要通过可用的 Citrix Cloud Connector 路由 API 请求,请选中此复选框。 您还可以选择 启用 Google Cloud Build 以使用专用池 复选框以获得额外的安全层。
或者,您可以使用 PowerShell 启用此功能。 有关更多信息,请参阅 为 GCP 管理的流量创建安全环境.
注意:
仅当您的部署中有活动的 Citrix Cloud Connector 时,此选项才可用。 目前,Connector Appliance 不支持此功能。
- 使用 创建虚拟机. 选择创建虚拟机的方法。
-
在 地区 页面上,从菜单中选择项目名称,选择包含要使用的资源的区域,然后选择 下一个.
-
在 网络 页面上,键入资源的名称,从菜单中选择一个虚拟网络,选择一个子集,然后选择 下一个. 资源名称有助于识别区域和网络组合。 具有 (共享) 附加到其名称的后缀表示共享 VPC。 如果您为共享 VPC 配置子网级 IAM 角色,则只有共享 VPC 的特定子网会显示在子网列表中。
注意:
- 资源名称可以包含 1 到 64 个字符,并且不能仅包含空格或字符
\ / ;: # . * ? = < > |[ ] { } " ' ( ) ' )
.
- 资源名称可以包含 1 到 64 个字符,并且不能仅包含空格或字符
- 在 总结 页面上,确认信息,然后选择 完成 退出 添加连接和资源 窗。
创建连接和资源后,将列出您创建的连接和资源。 要配置连接,请选择连接,然后在操作栏中选择适用的选项。
同样,您可以删除、重命名或测试在连接下创建的资源。 为此,请选择连接下的资源,然后在操作栏中选择适用的选项。
为 GCP 托管流量创建安全环境
您只能允许 Google 私有访问您的 Google Cloud 项目。 此实现增强了处理敏感数据的安全性。 为此,您需要:
- 在要实施 VPC 服务控制的 VPC 中安装 Cloud Connector。 看 VPC 服务控制 了解更多信息。
- 加
代理虚拟机管理程序TrafficThroughConnector
在自定义属性
如果是 Citrix Cloud 部署。 如果您使用的是专用工作程序池,请在CustomProperties
中添加UsePrivateWorkerPool
。 有关私有工作线程池的信息,请参阅 专用池概述.
注意:
目前,Connector Appliance 不支持此功能。
为 GCP 托管流量创建安全环境的要求
为 GCP 托管流量创建安全环境的要求是:
- 确保在更新自定义属性时,托管连接处于维护模式。
- 要使用私有 worker 池,需要进行以下更改:
- 对于 Citrix Cloud Service 帐户,请添加以下 IAM 角色:
- Cloud Build 服务帐户
- 计算实例管理员
- 服务帐户用户
- 服务帐户令牌创建者
- Cloud Build WorkerPool 所有者
- 在用于创建托管连接的同一项目中创建 Citrix Cloud Service 帐户。
-
设置 DNS 区域
private.googleapis.com
和gcr.io
如 DNS 配置. -
设置私有网络地址转换 (NAT) 或使用私有服务连接。 有关更多信息,请参阅 通过端点访问 Google API.
-
如果使用对等 VPC,请创建与对等 VPC 对等的 Cloud DNS 区域对等。 有关更多信息,请参阅 创建对等区域.
-
在 VPC 服务控制中,设置出口规则,以便 API 和虚拟机可以与 Internet 通信。 入站规则是可选的。 例如:
Egress Rule 1 From: Identities:ANY_IDENTITY To: Projects = All projects Service = Service name: All services <!--NeedCopy-->
- 对于 Citrix Cloud Service 帐户,请添加以下 IAM 角色:
启用代理
要启用代理,请在主机连接上设置自定义属性,如下所示:
- 从 Delivery Controller 主机打开 PowerShell 窗口或使用远程 PowerShell SDK。 有关远程 PowerShell SDK 的更多信息,请参阅 SDK 和 API.
-
运行以下命令:
Add-PSSnapin citrix*
- ‘cd XDHyp:\连接'
dir
- 复制
自定义属性
从连接到记事本。 -
按如下方式附加属性设置:
-
云部署(使用公共池)时:附加属性设置
<Property xsi:type="StringProperty" Name="ProxyHypervisorTrafficThroughConnector" 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="ProxyHypervisorTrafficThroughConnector" Value="True"/> </CustomProperties> <!--NeedCopy-->
允许 VPC 服务边界中的 Cloud Build Service 账户的入口规则。 例如:
Ingress Rule 1 From: Identities: <ProjectID>@cloudbuild.gserviceaccount.com Source > All sources allowed To: Projects = All projects Services = Service name: All services <!--NeedCopy-->
有关 VPC 服务边界的信息,请参阅 服务边界详细信息和配置.
-
如果云部署中存在私有工作线程池,请附加属性设置
<Property xsi:type="StringProperty" Name="ProxyHypervisorTrafficThroughConnector" Value="True"/>
和<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="ProxyHypervisorTrafficThroughConnector" Value="True"/> <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):
- Regional:只能由同一区域中的资源使用的加密密钥。
- Global:可供多个区域中的资源使用的加密密钥。
您可以从服务账户可访问的所有项目中浏览和使用全局或区域客户管理的加密密钥 (CMEK)。 然后,您可以使用该密钥创建启用了 CMEK 的 MCS 计算机目录,并使用 Set-ProvScheme
命令。 有关使用 PowerShell 创建已启用 CMEK 的目录的信息,请参阅 使用自定义属性通过 CMEK 创建目录.
对于此功能,您需要以下两个服务账户的额外权限:
- 用于创建托管连接的当前项目的服务帐户。
- 当前项目的 Compute Engine Service Agent(电子邮件为:
service-PROJECT_NUMBER@compute-system.iam.gserviceaccount.com
). 有关更多信息,请参阅 Compute Engine 服务代理.
在 Service accounts (服务账户) 中,您必须在具有要使用的加密密钥的项目(例如,共享项目)中分配以下角色:
- Cloud KMS 查看器
- Cloud KMS CryptoKey 加密器/解密器
如果您未分配给角色,请确保您具有以下权限:
- resourcemanager.projects.get
- cloudkms.keyRings.列表
- cloudkms.keyRings.get
- cloudkms.cryptoKeys.get
- cloudkms.cryptoKeys.list
- cloudkms.cryptoKeyVersions.useToDecrypt
- cloudkms.cryptoKeyVersions.useToEncrypt
列出加密密钥
您可以使用 PowerShell 命令列出同一项目和所有其他可访问项目中的全局和区域加密密钥。 为此,您需要:
- 从 Delivery Controller 主机或远程 PowerShell 打开 PowerShell 窗口。
- 运行命令
ASNP Citrix *
以加载特定于 Citrix 的 PowerShell 模块。 -
运行以下命令以列出加密密钥。 Example:
-
要列出 的内容
加密密钥
文件夹: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 包含单词
全球
在其中。
所需的 GCP 权限
此部分包含 GCP 权限的完整列表。 使用本部分中给出的完整权限集以使该功能正常运行。
注意:
GCP 将在 2024 年 4 月 29 日之后对 Cloud Build Services 的默认行为和服务帐号的使用进行更改。 有关详细信息,请参阅 Cloud Build Service 帐户变更。 在 2024 年 4 月 29 日之前启用了 Cloud Build API 的现有 Google 项目不受此变更的影响。 但是,如果您希望在 4 月 29 日之后拥有现有的 Cloud Build Service 行为,则可以在启用 API 之前创建或应用组织策略以禁用约束强制执行。 如果您设置了新的组织策略,您仍然可以遵循此部分中的现有权限以及标记的项目 Cloud Build 服务帐户更改前. 如果没有,请遵循标记的现有权限和项目 更改 Cloud Build 服务帐户后.
创建主机连接
-
Provisioning 项目中 Citrix Cloud Service Account 所需的最低权限:
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 定义的角色具有上面列出的权限:
- 计算管理员
- Cloud Datastore 用户
-
共享 VPC 项目中 Citrix Cloud 服务帐户的共享 VPC 所需的其他权限:
compute.networks.list compute.subnetworks.list resourcemanager.projects.get <!--NeedCopy-->
以下 Google 定义的角色具有上面列出的权限:
- 计算网络用户
-
在 Service accounts (服务账户) 中,您必须在具有要使用的加密密钥的项目(例如,共享项目)中分配以下角色:
- Cloud KMS 查看器
- Cloud KMS CryptoKey 加密器/解密器
如果您未分配给角色,请确保您具有以下权限:
- resourcemanager.projects.get
- cloudkms.keyRings.列表
- cloudkms.keyRings.get
- cloudkms.cryptoKeys.get
- cloudkms.cryptoKeys.list
- cloudkms.cryptoKeyVersions.useToDecrypt
- cloudkms.cryptoKeyVersions.useToEncrypt
VM 的电源管理
如果是仅电源管理的目录,则 Provisioning 项目中的 Citrix Cloud Service Account 所需的最低权限:
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 定义的角色具有上面列出的权限:
- 计算管理员
- Cloud Datastore 用户
创建、更新或删除 VM
-
Provisioning 项目中 Citrix Cloud Service Account 所需的最低权限:
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 定义的角色具有上面列出的权限:
- 计算管理员
- 存储管理员
- Cloud Build 编辑器
- 服务帐户用户
- Cloud Datastore 用户
-
共享 VPC 项目中 Citrix Cloud 服务帐户的共享 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 定义的角色具有上面列出的权限:
- 计算网络用户
- Cloud Datastore 用户
-
(Cloud Build Service 帐户更改前):将准备说明磁盘下载到 MCS 时,Google Cloud Build Service 所需的 Provisioning 项目中 Cloud Build Service 帐户所需的最低权限:
-
(云构建服务账户变更后):Google 云计算服务在下载准备指令盘到 MCS 时,所需的 Provisioning 项目中云计算服务账户所需的最低权限:
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 定义的角色具有上面列出的权限:
- Cloud Build Service 账户(Cloud Build Service 账户变更后,为 Cloud Compute Service 账户)
- 计算实例管理员
- 服务帐户用户
-
将准备指令磁盘下载到 MCS 时,Google Cloud Build 服务所需的 Provisioning 项目中 Cloud Compute Service Account 所需的最低权限:
resourcemanager.projects.get storage.objects.create storage.objects.get storage.objects.list <!--NeedCopy-->
以下 Google 定义的角色具有上面列出的权限:
- 计算网络用户
- 存储帐户用户
- Cloud Datastore 用户
- (Cloud Build Service 帐户更改前):将准备指令盘下载到 MCS 时,Google Cloud Build Service 所需的 Provisioning 项目中 Cloud Build Service 帐户共享 VPC 所需的额外权限:
-
(Cloud Build Service 帐户更改后):将准备指令磁盘下载到 MCS 时,Google Cloud Compute Service 需要的 Provisioning 项目中 Cloud Compute Service 帐户的共享 VPC 所需的额外权限:
compute.firewalls.list compute.networks.list compute.subnetworks.list compute.subnetworks.use resourcemanager.projects.get <!--NeedCopy-->
以下 Google 定义的角色具有上面列出的权限:
- 计算网络用户
- 存储帐户用户
- Cloud Datastore 用户
-
Provisioning 项目中 Citrix Cloud Service 帐户的 Cloud Key Management Service (KMS) 所需的其他权限:
cloudkms.cryptoKeys.get cloudkms.cryptoKeys.list cloudkms.keyRings.get cloudkms.keyRings.list <!--NeedCopy-->
以下 Google 定义的角色具有上面列出的权限:
- 计算 KMS 查看器
一般权限
以下是 Provisioning 项目中 Citrix Cloud Service Account 对 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
cloudkms.cryptoKeyVersions.useToDecrypt
cloudkms.cryptoKeyVersions.useToEncrypt
<!--NeedCopy-->
下一步的去向
- 如果您处于初始部署过程中,请参阅创建计算机目录。
- 有关 Google Cloud Platform (GCP) 特定信息,请参阅 创建 Google Cloud Platform 目录.