Sie können zwischen den Abrechnungsmodellen „Pay-as-you-go“ (PAYG) und „Bring your own subscription“ (BYOS) wechseln, indem Sie eine Lizenzreferenz oder einen Code durch einen anderen ersetzen. Weitere Informationen zu Lizenzcodes und dazu, wie Sie zulässige Lizenzänderungen ermitteln, finden Sie unter Lizenzänderungen und ‑beschränkungen.
Hinweise
-
Richten Sie die Authentifizierung ein, falls Sie dies noch nicht getan haben.
Bei der Authentifizierung wird Ihre Identität für den Zugriff auf Trusted Cloud by S3NS -Dienste und APIs überprüft.
Zum Ausführen von Code oder Beispielen aus einer lokalen Entwicklungsumgebung können Sie sich so bei der Compute Engine authentifizieren:
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
-
Installieren Sie die Google Cloud CLI und melden Sie sich dann mit Ihrer föderierten Identität in der gcloud CLI an. Nach der Anmeldung initialisieren Sie die Google Cloud CLI mit folgendem Befehl:
gcloud init
- Set a default region and zone.
PAYG-Lizenz in BYOS-Lizenz ändern
Wenn Sie eine PAYG-Lizenz durch eine BYOS-Lizenz ersetzen möchten, verwenden Sie die Google Cloud CLI oder die Compute Engine API.
gcloud
Wenn Sie die Lizenz eines Laufwerks durch eine Lizenzreferenz oder einen Lizenzcode ersetzen möchten, verwenden Sie den Befehl
gcloud compute disks update
:gcloud compute disks update DISK_NAME \ --replace-license=PREVIOUS_LICENSE,NEW_LICENSE
Ersetzen Sie Folgendes:
DISK_NAME
: der Name des zu ersetzenden Laufwerks.PREVIOUS_LICENSE
: Die vorherige Lizenzreferenz, die ersetzt wird, z. B."rhel-6-server"
,"rhel-7-server"
.NEW_LICENSE
: die neue Lizenzreferenz, z. B."rhel-6-byos"
,"rhel-7-byos"
.
REST
Wenn Sie die Lizenz eines Laufwerks ersetzen möchten, fügen Sie die neue Lizenz in den Anfragetext ein und lassen Sie die vorherige Lizenz weg. Rufen Sie die folgende
disks.update
v1-Methode auf:PATCH https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/ZONE/disks/DISK_NAME?paths=licenses --data '{"name":"DISK_NAME", "licenses":["https://www.googleapis.com/compute/v1/NEW_LICENSE"]}'
Ersetzen Sie Folgendes:
PROJECT
ist der Name des Projekts.ZONE
ist die Zone mit der VM.DISK_NAME
: Name des LaufwerksNEW_LICENSE
: der neue Lizenzverweis, z. B."rhel-6-byos"
,"rhel-7-byos"
oder Lizenzcode, z. B."4720191914037931587"
,"1492188837615955530"
.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-08-19 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-08-19 (UTC)."],[],[],null,["Linux\n\n*** ** * ** ***\n\nYou can switch between pay-as-you-go (PAYG) and bring your own subscription (BYOS)\nbilling models by replacing one license reference or code with another. Changing between BYOS and PAYG is supported for Red Hat Enterprise Linux (RHEL), RHEL for SAP, SUSE Linux Enterprise Server (SLES), and SLES for SAP.\nFor details on license codes and how to determine allowed license\nmodifications, see [License changes and restrictions](/compute/docs/licenses/license-changes-and-restrictions).\n\n\nBefore you begin\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 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\nChange a BYOS license to a PAYG license\n\nTo replace a BYOS license with a PAYG license, use the Google Cloud CLI or the\nCompute Engine API. \n\ngcloud\n\nTo replace a disk's license with a license reference or code, use the\n[`gcloud compute disks update` command](/sdk/gcloud/reference/compute/disks/update): \n\n```\ngcloud compute disks update DISK_NAME \\\n --replace-license=PREVIOUS_LICENSE,NEW_LICENSE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e: the name of the disk to replace.\n- \u003cvar translate=\"no\"\u003ePREVIOUS_LICENSE\u003c/var\u003e: the previous [license reference](/compute/docs/images/os-details#license-references) being replaced, for example, `\"rhel-7-byos\"`, `\"rhel-8-byos\"`.\n- \u003cvar translate=\"no\"\u003eNEW_LICENSE\u003c/var\u003e: the new [license reference](/compute/docs/images/os-details#license-references), for example, `\"rhel-7-server\"`, `\"rhel-8-server\"`.\n\nREST\n\nTo replace a disk's license, add the new license to the request body and\nomit the previous license. Call the following\n[`disks.update` v1 method](/compute/docs/reference/rest/v1/disks/update): \n\n```\nPATCH https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/ZONE/disks/DISK_NAME?paths=licenses --data '{\"name\":\"DISK_NAME\", \"licenses\":[\"https://www.googleapis.com/compute/v1/NEW_LICENSE\"]}'\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: the name of the project\n- \u003cvar translate=\"no\"\u003eZONE\u003c/var\u003e: the zone containing the VM\n- \u003cvar translate=\"no\"\u003eDISK_NAME\u003c/var\u003e: the name of the disk\n- \u003cvar translate=\"no\"\u003eNEW_LICENSE\u003c/var\u003e: the new [license reference](/compute/docs/images/os-details#license-references), for example, `\"rhel-6-byos\"`, `\"rhel-7-byos\"`, or [license code](/compute/docs/images/os-details#license-codes), for example, `\"4720191914037931587\"`, `\"1492188837615955530\"`."]] -