Le titulaire de la licence peut modifier les informations valides d'une licence donnée. Ce guide explique comment trouver les modifications de licence valides actuelles pour une licence spécifique. Il décrit également les restrictions qui s'appliquent à la modification de cette licence.
Avant de commencer
-
Si ce n'est pas déjà fait, configurez l'authentification.
L'authentification est le processus permettant de valider votre identité pour accéder aux services et aux API Trusted Cloud by S3NS .
Pour exécuter du code ou des exemples depuis un environnement de développement local, vous pouvez vous authentifier auprès de Compute Engine en sélectionnant l'une des options suivantes :
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
-
Installez la Google Cloud CLI, puis connectez-vous à la gcloud CLI avec votre identité fédérée. Après vous être connecté, initialisez Google Cloud CLI en exécutant la commande suivante :
gcloud init
- Set a default region and zone.
Vérifier les informations sur la licence
Dans Cloud Shell, exécutez la commande suivante : Remplacez LICENSE_URL par la licence que vous souhaitez examiner. Pour obtenir la liste des URL de licence Linux courantes, consultez le tableau Licences valides.
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" LICENSE_URL
Par exemple, pour examiner la licence PAYG RHEL 7 :
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
Le résultat ressemble à ce qui suit :
{ "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": "" }
La réponse décrit les champs clés suivants :
removableFromDisk
: si la valeur esttrue
, la licence peut être supprimée du disque. Si la valeur estfalse
, la licence ne peut pas être supprimée sans être remplacée par une licence valide.allowedReplacementLicenses
: liste des codes de licence pouvant servir de remplacement valide. Pour savoir à quelle licence correspond chaque code, consultez la liste des licences valides.minimumRetention
: durée minimale pendant laquelle la licence doit être présente sur la VM avant qu'un autre changement de licence puisse être appliqué.
Exemple : Remplacer RHEL 7 PAYG par RHEL 8 PAYG
Pour remplacer une licence RHEL 7 PAYG par une licence RHEL 8 PAYG, utilisez les informations suivantes pour trouver le code et l'URL de la licence RHEL 8 PAYG :
Nom de la licence Code de licence URL de la licence RHEL 8 PAYG 601259152637613565 https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-8-server
Étant donné que le code de licence pour RHEL 8 PAYG (601259152637613565) était indiqué sous
allowedReplacementLicenses
pour RHEL 7 PAYG, cela signifie qu'il est possible de remplacer la licence par une licence valide.Pour remplacer la licence, utilisez la commande suivante :
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
Licences valides
Les licences valides pour RHEL, Ubuntu et Ubuntu Pro sont listées dans les tableaux suivants.
Informations sur la licence RHEL
Nom de la licence Code de licence URL de la licence 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 pour SAP PAYG 1270685562947480748 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-8-sap
RHEL 9 pour SAP PAYG 8291906032809750558 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-9-sap
RHEL 8 pour SAP BYOS 489291035512960571 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-8-sap-byos
RHEL 9 pour SAP BYOS 6753525580035552782 https://www.googleapis.com/compute/v1/projects/rhel-sap-cloud/global/licenses/rhel-9-sap-byos
Informations sur les licences Ubuntu et Ubuntu Pro
Nom de la licence Code de licence URL de la licence 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
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/08/19 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/08/19 (UTC)."],[],[],null,["# License changes and restrictions\n\nLinux\n\n*** ** * ** ***\n\nOnly certain Premium Linux OS licenses are eligible to be appended, removed, or replaced. License changes are supported for Red Hat Enterprise Linux (RHEL), RHEL for SAP, SUSE Linux Enterprise Server (SLES), SLES for SAP, Ubuntu, and Ubuntu Pro for the following use cases:\n\n- Changing between BYOS and PAYG billing models for RHEL, RHEL for SAP, SLES, and SLES for SAP\n- In-place upgrades from Ubuntu to Ubuntu Pro\n- Adding or removing RHEL ELS add-on licenses\n\nThe license owner can change valid license changes for a given license. Before you change a license, confirm that the target license change is valid. This\nguide outlines how to find the current valid license changes for a particular\nlicense. It also outlines any restrictions that apply to changing that license.\n\nBefore you begin\n----------------\n\n- If you haven't already, set up [authentication](/compute/docs/authentication). Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:\n\n Select the tab for how you plan to use the samples on this page: \n\n ### Console\n\n\n When you use the Google Cloud console to access Google Cloud services and\n APIs, you don't need to set up authentication.\n\n ### gcloud\n\n 1.\n [Install](/sdk/docs/install) the Google Cloud CLI.\n\n After installation,\n [initialize](/sdk/docs/initializing) the Google Cloud CLI by running the following command:\n\n ```bash\n gcloud init\n ```\n\n\n If you're using an external identity provider (IdP), you must first\n [sign in to the gcloud CLI with your federated identity](/iam/docs/workforce-log-in-gcloud).\n | **Note:** If you installed the gcloud CLI previously, make sure you have the latest version by running `gcloud components update`.\n 2. [Set a default region and zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\nReview license information\n--------------------------\n\nIn Cloud Shell, run the following command. Replace \u003cvar translate=\"no\"\u003eLICENSE_URL\u003c/var\u003e\nwith the license that you want to investigate. For a list of common Linux\nlicense URLs, see the [Valid licenses](#valid-licenses) table. \n\n```\ncurl -H \"Authorization: Bearer $(gcloud auth print-access-token)\" -H \"Content-Type: application/json\" LICENSE_URL\n```\n\nFor example, to examine the RHEL 7 PAYG License: \n\n```\ncurl -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\n```\n\nThe output is similar to the following: \n\n```\n{\n \"kind\": \"compute#license\",\n \"name\": \"rhel-7-server\",\n \"chargesUseFee\": true,\n \"id\": \"6080198135500386054\",\n \"licenseCode\": \"1000006\",\n \"creationTimestamp\": \"2013-08-19T17:17:57.000-07:00\",\n \"description\": \"RedHat Enterprise Linux 7\",\n \"transferable\": true,\n \"selfLink\": \"https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-7-server\",\n \"selfLinkWithId\": \"https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/6080198135500386054\",\n \"appendableToDisk\": true,\n \"removableFromDisk\": false,\n \"allowedReplacementLicenses\": [\n \"1492188837615955530\",\n \"8475125252192923229\",\n \"601259152637613565\",\n \"489291035512960571\",\n \"1270685562947480748\"\n ],\n \"osLicense\": false,\n \"soleTenantOnly\": false,\n \"multiTenantOnly\": false,\n \"minimumRetention\": {\n \"seconds\": \"0\",\n \"nanos\": 0\n },\n \"updateTimestamp\": \"\"\n}\n```\n\nThe response outlines the following key fields:\n\n- **`removableFromDisk`** : if `true`, the license can be removed from the disk. If `false`, the license cannot be removed without replacing it with a valid license.\n- **`allowedReplacementLicenses`** : this is a list of license codes for licenses that can serve as valid replacements. To find out which license code corresponds to which license, see [valid licenses](#valid-licenses).\n- **`minimumRetention`**: the minimum amount of time that the license needs to be present on the VM before another license change can be applied.\n\nExample: Replace RHEL 7 PAYG with RHEL 8 PAYG\n---------------------------------------------\n\nTo replace a RHEL 7 PAYG license with a RHEL 8 PAYG license, use the following\ninformation to find the license code and license URL for RHEL 8 PAYG:\n\nSince the license code for RHEL 8 PAYG (601259152637613565) was listed under\n`allowedReplacementLicenses` for RHEL 7 PAYG, this indicates that a valid\nlicense replacement is possible.\n\nTo perform the license replacement, use the following command: \n\n```\n gcloud compute disks update DISK_NAME\n --replace-license=projects/rhel-cloud/global/licenses/rhel-7-server,projects/rhel-cloud/global/licenses/rhel-8-server\n --zone=DISK_ZONE\n```\n\nValid licenses\n--------------\n\nValid licenses for RHEL, SLES, Ubuntu, and Ubuntu Pro are listed in the following\ntables. \n\n### RHEL license information\n\n### SLES license information\n\n### Ubuntu and Ubuntu Pro license information"]] -