许可所有者可以更改给定许可的有效许可变更。本指南概述了如何查找特定许可的当前有效许可变更。此外,还概述了更改该许可时适用的任何限制。
准备工作
-
如果您尚未设置身份验证,请进行设置。身份验证是通过其进行身份验证以访问 Trusted Cloud by S3NS 服务和 API 的过程。如需从本地开发环境运行代码或示例,您可以通过选择以下选项之一向 Compute Engine 进行身份验证:
Select the tab for how you plan to use the samples on this page:
Console
When you use the Trusted Cloud console to access Trusted Cloud by S3NS services and APIs, you don't need to set up authentication.
gcloud
-
安装 Google Cloud CLI,然后 使用联合身份登录 gcloud CLI。 登录后,运行以下命令初始化 Google Cloud CLI:
gcloud init
- Set a default region and zone.
查看许可信息
在 Cloud Shell 中,运行以下命令。将 LICENSE_URL 替换为您要调查的许可。如需查看常见 Linux 许可网址的列表,请参阅有效许可表。
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" LICENSE_URL
例如,如需检查 RHEL 7 PAYG 许可,请执行以下操作:
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server
输出类似于以下内容:
{ "kind": "compute#license", "name": "rhel-7-server", "chargesUseFee": true, "id": "6080198135500386054", "licenseCode": "1000006", "creationTimestamp": "2013-08-19T17:17:57.000-07:00", "description": "RedHat Enterprise Linux 7", "transferable": true, "selfLink": "https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server", "selfLinkWithId": "https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/6080198135500386054", "appendableToDisk": true, "removableFromDisk": false, "allowedReplacementLicenses": [ "1492188837615955530", "8475125252192923229", "601259152637613565", "489291035512960571", "1270685562947480748" ], "osLicense": false, "soleTenantOnly": false, "multiTenantOnly": false, "minimumRetention": { "seconds": "0", "nanos": 0 }, "updateTimestamp": "" }
响应概述了以下关键字段:
removableFromDisk
:如果值为true
,则可以从磁盘中移除许可。如果值为false
,则无法移除许可,除非将其替换为有效许可。allowedReplacementLicenses
:这是一个许可代码列表,其中包含可作为有效替代项的许可。如需了解哪个许可代码对应哪个许可,请参阅有效许可。minimumRetention
:许可需要在虚拟机上存在的最短时间,之后才能应用其他许可更改。
示例:将 RHEL 7 PAYG 替换为 RHEL 8 PAYG
如需将 RHEL 7 PAYG 许可替换为 RHEL 8 PAYG 许可,请使用以下信息查找 RHEL 8 PAYG 的许可代码和许可网址:
许可名称 许可代码 许可网址 RHEL 8 PAYG 601259152637613565 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-8-server
由于 RHEL 8 PAYG 的许可代码 (601259152637613565) 列在 RHEL 7 PAYG 的
allowedReplacementLicenses
下,因此这表示可以进行有效的许可替换。如需执行许可替换,请使用以下命令:
gcloud compute disks update DISK_NAME --replace-license=projects/rhel-cloud/global/licenses/rhel-7-server,projects/rhel-cloud/global/licenses/rhel-8-server --zone=DISK_ZONE
有效许可
下表列出了 RHEL、Ubuntu 和 Ubuntu Pro 的有效许可。
RHEL 许可信息
许可名称 许可代码 许可网址 RHEL 6 PAYG 1000002 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-6-server
RHEL 7 PAYG 1000006 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server
RHEL 7 ELS 4646774207868449156 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-els
RHEL 8 PAYG 601259152637613565 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-8-server
RHEL 9 PAYG 7883559014960410759 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-9-server
RHEL 6 BYOS 4720191914037931587 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-6-byos
RHEL 7 BYOS 1492188837615955530 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-byos
RHEL 8 BYOS 8475125252192923229 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-8-byos
RHEL 9 BYOS 3837518230911135854 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-9-byos
RHEL 8 for SAP PAYG 1270685562947480748 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-8-sap
RHEL 9 for SAP PAYG 8291906032809750558 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-9-sap
RHEL 8 for SAP BYOS 489291035512960571 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-8-sap-byos
RHEL 9 for SAP BYOS 6753525580035552782 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-9-sap-byos
Ubuntu 和 Ubuntu Pro 许可信息
许可名称 许可代码 许可网址 Ubuntu 16.04 (Xenial Xerus) 1000201 https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-1604-xenial
Ubuntu Pro 16.04 (Xenial Xerus) 8045211386737108299 https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-1604-lts
Ubuntu 18.04 LTS (Bionic Beaver) 5926592092274602096 https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-1804-lts
Ubuntu Pro 18.04 LTS (Bionic Beaver) 6022427724719891830 https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-1804-lts
Ubuntu 20.04 LTS (Focal Fossa) 2211838267635035815 https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-2004-lts
Ubuntu Pro 20.04 LTS (Focal Fossa) 599959289349842382 https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2004-lts
Ubuntu 22.04 LTS (Jammy Jellyfish) 5511465778777431107 https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-2204-lts
Ubuntu Pro 22.04 LTS (Jammy Jellyfish) 2592866803419978320 https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2204-lts
Ubuntu 24.04 LTS (Noble Numbat) 3242930272766215801 https://www.googleapis.com/compute/v1/projects/ubuntu-os-cloud/global/licenses/ubuntu-2404-lts
Ubuntu Pro 24.04 LTS (Noble Numbat) 2176054482269786025 https://www.googleapis.com/compute/v1/projects/ubuntu-os-pro-cloud/global/licenses/ubuntu-pro-2404-lts
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-19。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-19。"],[],[],null,[]] -