Skip to main content

Committed Use Discounts

Elastigroup assists in optimizing the usage of committed use discounts (CUDs) to ensure minimal waste. Elastigroup strategically allocates reservations for maximum benefit, improving estimation accuracy for commitment usage. This provides visibility into savings plans and RI utilization, enabling enhanced methods for effectively utilizing vacant plans and maximizing cost savings.

This feature enables you to utilize your existing committed use discounts before considering the addition of extra resources and makes efficient use of your cloud resources.

Elastigroup manages the committed use discount virtual machines by automatic:

  • Scale up: Elastigroup uses the commitment utilization status to decide when to scale up on-demand virtual machines instead of spot instances. This helps utilize commitment plans in markets they apply to.

  • Scale down: Instances that use commitment plans are given priority during the scale down process, ensuring the commitment plan strategy is maintained.

  • Revert to reserved: Elastigroup ensures that the group’s strategy to utilize commitment plans is maintained. This is done by checking if there are spot instances in the group that can be replaced with on-demand instances that utilize commitment plans.

You can utilize your GCP committed use discounts in your Elastigroup:

Resource-Based and Spend-Based Commitments

  1. Sign in to the GCP console and type IAM & Admin in the search bar.

  2. In the left main menu, click IAM.

  3. On the View by Principal tab, click the Security Insights of a principal that begins with spotinst-role-act-xyz.

    commited-use-discounts-2
  4. Make sure that the compute.commitments.list permission for Spot’s generated service account is in the Spot policy.

Spend-Based Commitments

Connect all your GCP projects to Spot accounts, with one account assigned to each project.

  1. For projects that are not managed by Spot, create a Spot account with read-only permissions (required for calculating the commitment plans utilization status).

    The required permission for read only accounts is compute.instances.list on Spot's generated service accounts.

    commited-use-discounts-3
  2. In the search bar in the GCP console, type API Library.

  3. In the search bar, type Cloud Commerce Consumer Procurement API and select the option that appears in the dropdown menu.

  4. Click the Cloud Commerce Consumer Procurement API option that opens.

  5. In the Cloud Commerce Consumer Procurement API window that opens, click Enable.

  6. Return to the search bar and type Cloud Billing API and select the option that appears in the dropdown menu.

  7. Click the Cloud Billing API option that opens.

  8. In the Cloud Billing API window that opens, click Enable.

Resource-Based Commitment with a Billing Account

A resource-based commitment with a billing account scope enables you to use the same CUD in multiple projects, as mentioned in GCP. Connect all of your GCP projects to Spot accounts, with one account assigned to each project, similar to Spend-Based Commitments.

For projects that Spot does not manage, a Spot account with read-only permissions should be created to calculate the status of the commitment plan usage: compute.instances.list on Spot's generated service accounts.

The compute.instances.list permission for the project that purchased the CUD.

Connect the spotinst-role-act Template

For all Spot service accounts created by the template spotinst-role-act, complete the following steps:

  1. In the left main menu in the GCP console, click Billing > Account Management.
  2. Click Add Principal in the top right. In the Grant access to My Billing Account window, enter the Service Account Name in the New Principal field.
  3. Add the Consumer Procurement Order Viewer role to all the Spot service accounts permissions in your billing account that is linked to all the Spot service accounts that you found.

Enable Committed Use Discounts

To start utilizing commitment plans in your Elastigroup, the shouldUtilizeCommitments value should be true in the Elastigroup API.