Purchase software commitments for OS licenses

Compute Engine provides resource-based committed use discounts (CUDs) for your predictable workloads that use applicable premium operating system (OS) licenses. You can purchase commitments for licenses to run VM instances that use applicable SLES, SLES for SAP, or RHEL images.

This document explains how to purchase resource-based commitments for OS licenses by using the Google Cloud console, the gcloud CLI, or REST.

To learn more about license commitments, including the qualifying images and discount rates, see Software license commitments .

Before you begin

  • If you haven't already, set up 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:

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. Install the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:

      gcloud  
      init

      If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity .

    2. Set a default region and zone .

    REST

    To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.

      Install the Google Cloud CLI.

      If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity .

    For more information, see Authenticate for using REST in the Google Cloud authentication documentation.

Required roles

To get the permission that you need to purchase commitments for licenses, ask your administrator to grant you the Compute Admin ( roles/compute.admin ) IAM role on your project. For more information about granting roles, see Manage access to projects, folders, and organizations .

This predefined role contains the compute.commitments.create permission, which is required to purchase commitments for licenses.

You might also be able to get this permission with custom roles or other predefined roles .

By default, project owners have permission to purchase resource-based commitments. However, it's possible for owners to create custom roles that include or exclude certain users. Read about access control to make sure that you have permission to purchase a resource-based commitment.

Purchase an OS license commitment

Purchase software resource-based commitments for OS licenses using the Google Cloud console, the gcloud CLI, or REST.

After you purchase a commitment, your commitment becomes active on the following day at 12 AM US and Canadian Pacific Time (UTC-8, or UTC-7 during daylight saving time). Compute Engine maintains a lien on your project for each region in your project where you purchase a commitment. When you purchase a new commitment for any region in your project, Compute Engine associates the lien for that region with the newly created commitment.

Between the time of your commitment purchase and its activation time, the status of your commitment remains as NOT_YET_ACTIVE (or as PENDING on the Google Cloud console). After activation, the status of your commitment changes to ACTIVE . For example, suppose you purchase your commitment on January 20, 2024, at 10:00 PM US and Canadian Pacific Time (UTC-8 or UTC-7). Compute Engine creates your commitment immediately with its status as NOT_YET_ACTIVE . Your commitment becomes ACTIVE on January 21, 2024, at 12:00 AM US and Canadian Pacific Time (UTC-8 or UTC-7).

Console

Before you purchase a commitment using the Google Cloud console, select the project where you want to use the resources and apply your CUDs. If you enabled CUD sharing for your project's Cloud Billing account, then you can purchase the commitment for any project from that Cloud Billing account.

After you select the project, perform the following steps:

  1. In the Google Cloud console, go to the Committed use discountspage.

    Go to Committed use discounts

    The Commitment listpage appears and displays the Hardware commitmentstab.

  2. Click Software license commitments.

  3. Click Purchase commitment.

    The Purchase a committed use discountpage appears.

  4. In the Namefield, enter a name for your commitment.

  5. In the Regionfield, select the region where you want to use resources at committed-use-discounted prices.

  6. For Duration, select either 1 yearor 3 yearsas the plan for your commitment. The plan determines the CUD rate and preset term duration of your commitment.

  7. In the License familyfield, select the OS license for which you want to purchase the commitment.

  8. In the License type and quantitysection, do the following:

    1. For Type, select the number of vCPUs that applies.
    2. For Number of licenses, enter the number of OS licenses that you want to commit to purchasing.
  9. In the Summarypane, review your commitment timeline and details.

  10. To purchase your commitment, do the following:

    1. Click Purchase. The Purchase a committed use discountdialog appears.

    2. In the dialog, review the acceptance disclosures regarding monthly fees, commitment terms, and the service specific terms .

    3. To confirm your commitment purchase, click Purchase.

gcloud

Using the gcloud CLI, run the gcloud compute commitments create-license command to purchase a license commitment.

gcloud compute commitments create-license COMMITMENT_NAME 
\
    --license ` LICENSE_URI 
`
    --amount NUMBER_OF_LICENSES 
\
    --cores-per-license CORES_PER_LICENSE 
\
    --plan PLAN 
\
    --region REGION 
\

Replace the following:

  • COMMITMENT_NAME : the name for your commitment.
  • LICENSE_URI : the license URI. For example: https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-sap-12
  • NUMBER_OF_LICENSES : the number of licenses you plan to purchase.
  • CORES_PER_LICENSE : the number of cores per license. Enter 1-2 , 3-4 , or 5+ .
  • PLAN : enter the plan length: 12-month or 36-month .
  • REGION : the region where this commitment applies.

For example, to purchase a 3-year commitment for 4 SAP licenses with 3-4 cores per license in the us-central1 region, run the following command:

gcloud compute commitments create-license commitment-1
    --license https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-12
    --amount=4
    --cores-per-license=3-4
    --plan=36-month
    --region=us-central1

For example, to purchase a 1-year commitment for 2 SLES for SAP licenses with 1-2 cores per license in the us-central1 region, run the following command:

gcloud compute commitments create-license commitment-2
    --license https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-sap-12
    --amount=2
    --cores-per-license=1-2
    --plan=12-month
    --region=us-central1

REST

Use the regionCommitments.insert method and include the licenseResource field to define the license commitment's properties.

POST https://compute.googleapis.com/compute/v1/projects/ PROJECT_ID 
/regions/ REGION 
/commitments?requestId= OPTIONAL_UNIQUE_ID 
{
    "name": " COMMITMENT_NAME 
",
    "plan": " PLAN 
",
    "category": "LICENSE",
    "licenseResource": {
      "coresPerLicense": " CORES_PER_LICENSE 
",
      "amount": " NUMBER_OF_LICENSES 
",
      "license": " LICENSE_URI 
"
    }
}

Replace the following:

  • PROJECT_ID : the ID of the project where you want to purchase the commitment.
  • OPTIONAL_UNIQUE_ID : Optional. A unique request ID to help prevent unintended duplicate requests.
  • COMMITMENT_NAME : the name for your commitment.
  • LICENSE_URI : the license URI. For example: https://www.googleapis.com/compute/v1/projects/myproject/global/licenses/sles-sap-12
  • NUMBER_OF_LICENSES : the number of licenses you plan to purchase.
  • CORES_PER_LICENSE : the number of cores per license. Enter 1-2 , 3-4 , or 5+ .
  • PLAN : enter the plan length: 12-month or 36-month .
  • REGION : the region where this commitment applies.

For example, to purchase a 3-year commitment for 4 SLES for SAP licenses with 3-4 cores per license in the us-central1 region, make the following POST request:

POST https://compute.googleapis.com/compute/v1/projects/myproject/regions/us-central1/commitments

{
    "name": "commitment-3",
    "plan": "THIRTY_SIX_MONTH",
    "category": "LICENSE",
    "licenseResource": {
      "coresPerLicense": "3-4",
      "amount": "4",
      "license": "https://www.googleapis.com/compute/v1/projects/suse-sap-cloud/global/licenses/sles-sap-12"
      }
}
Design a Mobile Site
View Site in Mobile | Classic
Share by: