Switch between PAYG and BYOS

Linux

This page explains how to switch between pay-as-you-go (PAYG) and bring-your-own-subscription (BYOS) billing models for the following Linux operating systems:

  • Red Hat Enterprise Linux (RHEL)
  • RHEL for SAP
  • SUSE Linux Enterprise Server (SLES)
  • SLES for SAP

For switching Windows Server from bring-your-own-license (BYOL) to PAYG, seeSwitch Windows Server from BYOL to PAYG.For details on license codes and how to determine allowed licensemodifications, seeLicense changes and restrictions.

Before you begin

Change a BYOS license to a PAYG license

To replace a BYOS license with a PAYG license, use the Google Cloud CLI or theCompute Engine API.

gcloud

To replace a disk's license with a license reference or code, use thegcloud compute disks update command:

gcloud compute disks updateDISK_NAME \    --replace-license=PREVIOUS_LICENSE,NEW_LICENSE

Replace the following:

  • DISK_NAME: the name of the disk to replace.
  • PREVIOUS_LICENSE: the previous license referencebeing replaced, for example,"rhel-7-byos","rhel-8-byos".
  • NEW_LICENSE: the new license reference,for example,"rhel-7-server","rhel-8-server".

REST

To replace a disk's license, add the new license to the request body andomit the previous license. Call the followingdisks.update v1 method:

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"]}'

Replace the following:

  • PROJECT: the name of the project
  • ZONE: the zone containing the VM
  • DISK_NAME: the name of the disk
  • NEW_LICENSE: the new license reference,for example,"rhel-6-byos","rhel-7-byos", or license code, forexample,"4720191914037931587","1492188837615955530".

Validate the license change

To validate that your license has been changed on the boot disk, use the following procedure:

  1. Get information about the boot disk by running thegcloud compute disks describe command:

    gcloud compute disks describeDISK_NAME \    --zone=ZONE \    --format="value(licenses)"

    Replace the following:

    • DISK_NAME: the name of the boot disk to validate the license of
    • ZONE: the zone containing the boot disk to validate the license of
  2. Verify that the output is similar to the following:

    https://www.googleapis.com/compute/v1/projects/rhel-cloud/global/licenses/rhel-10-server

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-19 UTC.