Using cost models

OpenShift Container Platform 4.3

Configuring cost models to reflect your cloud costs

Red Hat Customer Content Services

Abstract

This guide explains the cost model feature, configuration and related terminology.

Chapter 1. Using cost models

This document describes how to use cost models in cost management to apply a price to usage in your cloud environment, then distribute the costs to resources.

Note

Cost management is currently Technology Preview. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

If you have a suggestion for improving this guide or have found an error, please submit a Bugzilla report at http://bugzilla.redhat.com against Cloud Software Services (cloud.redhat.com) for the Cost Management component.

1.1. What is a cost model?

It can be difficult to find out the real cost of the cloud. Different sources provide a variety of cost data and metrics, which can be complicated to calculate together and accurately distribute the costs.

Using a cost model, cost management allows you to associate a price to metrics provided by your sources to charge for utilization of resources. In some cases, those costs are related to the raw costs of the infrastructure, while others will be based on a price list that associates usage to charges. The data must be normalized before you can add a markup to it to cover your overhead, and then distribute the charges to your resources and/or end customers.

Being able to charge based on usage is a key requirement for chargeback and showback, as it provides the ability to set up a price by usage. It helps to align costs to utilization: those customers that use a resource more will be charged more.

1.2. Cost model terminology

These terms and concepts are important for understanding cost management’s cost model workflow.

Cost model
A framework used to define the calculations for the costs stored in cost management, using base costs and metrics. The cost model is used for budgeting and accounting, and also the visualization and analysis of costs — in cost management it provides the basis for the cost information that the user will view. Costs generated by a cost model can be recorded, categorized and allocated to specific customers, business units or projects.
Raw metrics and costs
Raw metrics and costs are the metrics and costs provided by a third party that have not been modified in any way, such as the AWS costs provided by the AWS Cost and Usage Report files or the API, and the OpenShift metrics provided through Operator Metering.
Base costs
Base costs originate from different sources, such as metrics, inventory, or reports, which are normalized so a markup can be applied. Base costs can be calculated directly in the cost management application by applying a price list to metrics or inventory, or they can be calculated externally (for example, AWS provided costs). In the cost management application’s cost model, a markup is applied to base costs to get calculated costs.
Price list
A price list is a list of rates used within the application’s cost model to calculate the base cost of resources.
Markup
In the cost management application, the markup is the ratio, positive or negative, between the base cost and the calculated cost.
Calculated costs
Calculated costs are the costs stored in the application after a markup is added to the base costs.
Distributed costs
Calculated costs become distributed costs once they are associated to higher level application concepts, such as user, team, project, account, service, and so on.

1.3. The cost model workflow

The following diagram shows the cost model workflow that cost management uses to apply a price to metrics and inventory, normalize cost data from different sources, apply a markup (or discount), then distribute the costs across the relevant resources.

The cost model also helps differentiate raw costs from the costs used in cost management.

costmodel workflow

  1. Cost management collects cost data from several sources:

    • Inventory - A list of all the resources that are or were present in your source, whether they are in use or not. For example, if your OpenShift Container Platform environment contains a host that is not in use, that host still costs $x amount per month. There are several ways of collecting inventory data into cost management: for instance, cost management can generate inventory from the AWS Cost and Usage Report files and OpenShift Metering Operator reports, or it can be provided by a topology service.
    • Metrics - A subset of the inventory showing usage and consumption for each resource.
    • AWS Cost and Usage Report - AWS provides an hourly report to cost management that lists consumption of AWS resources. The metrics in this report contain prices assigned by Amazon (raw costs), which cost management uses as is in calculations. As a result, configuring a custom price list is not necessary for AWS sources.
  2. The cost model normalizes costs from your different sources, and allows you to apply a markup or discount of your choice to account for other costs and overhead. These steps are completed within the cost model to produce the calculated costs:

    1. For OpenShift Container Platform sources - Since the metrics and inventory data do not have a price assigned to usage, you must create and assign a price list to your sources to determine the calculated costs of these resources. A price list includes rates for usage and requests for storage, memory, CPU, and nodes.
    2. For AWS and Azure sources - You can also create cost models for these sources to account for any extra costs or overhead in your environment, and apply a markup (or discount) as a percentage.

      Note

      For more about configuring a cost model, see Chapter 2, Assigning a cost to metrics and usage using a cost model.

  3. The AWS and Azure raw costs and OpenShift Container Platform calculated costs (metrics and inventory with rates applied from the price list) are then collected together in cost management as total costs. The total costs include both infrastructure costs and other costs not related to the cloud infrastructure.
  4. The total costs are then distributed to resources across the environment according to tags and labels. Depending on your organization, these resources may include OpenShift projects, nodes, or clusters, and AWS or Azure services or accounts. You can also use tagging to distribute the costs by team, project, or group within your organization.
Note

For more information about configuring tagging for cost management, see Managing cost data using tagging.

Chapter 2. Assigning a cost to metrics and usage using a cost model

2.1. Creating an AWS cost model

Since Amazon AWS cost and usage data is collected into cost management with prices already assigned, you only need to assign a markup or discount (if desired) for your AWS sources.

Procedure

  1. From the Cost models menu, click Create cost model to open the cost model wizard.
  2. Enter a name and description for the cost model, and select Amazon Web Services (AWS) as the source type to apply the cost model to. Click Next.
  3. To apply a markup to the base costs of your resources, enter a percentage value and click Next.

    • To apply a discount rather than a markup, enter a minus sign with the value (for example, -15).
    • If you do not want to apply a markup or discount, enter 0.

      Note

      You can use a markup to account for your overhead costs, such as the cost of administering the cluster, or support costs, for example. A markup is an estimation to cover your costs not shown by metrics or usage.

  4. Optionally, select one or multiple sources to assign the cost model to and click Next. Selecting a source with a cost model already assigned will override its previous cost model. You can also assign sources to your cost model at a later time.
  5. Review the cost model details, and click Create.
  6. Click Close to exit the cost model wizard.

Your new cost model will appear in the list on the Cost models page.

Next steps

  • From the Cost models page, click the more options button to View details or Delete the cost model. From the View details option, you can edit the cost model, including source assignments, markup, and more settings.
  • Review your tags and tagging strategy to ensure that costs are being distributed to the correct resources, cost centers, or teams. See the guide Using tagging to manage cost data for more information.

2.2. Creating an Azure cost model

Since Microsoft Azure cost and usage data is collected into cost management with prices already assigned, you only need to assign a markup or discount (if desired) for your Azure sources.

Procedure

  1. From the Cost models menu, click Create cost model to open the cost model wizard.
  2. Enter a name and description for the cost model, and select Microsoft Azure as the source type to apply the cost model to. Click Next.
  3. To apply a markup to the base costs of your resources, enter a percentage value and click Next.

    • To apply a discount rather than a markup, enter a minus sign with the value (for example, -15).
    • If you do not want to apply a markup or discount, enter 0.

      Note

      You can use a markup to account for your overhead costs, such as the cost of administering the cluster, or support costs, for example. A markup is an estimation to cover your costs not shown by metrics or usage.

  4. Optionally, select one or multiple sources to assign the cost model to and click Next. Selecting a source with a cost model already assigned will override its previous cost model. You can also assign sources to your cost model at a later time.
  5. Review the cost model details, and click Create.
  6. Click Close to exit the cost model wizard.

Your new cost model will appear in the list on the Cost models page.

Next steps

  • From the Cost models page, click the more options button to View details or Delete the cost model. From the View details option, you can edit the cost model, including source assignments, markup, and more settings.
  • Review your tags and tagging strategy to ensure that costs are being distributed to the correct resources, cost centers, or teams. See the guide Using tagging to manage cost data for more information.

2.3. Creating an OpenShift Container Platform cost model

As metrics and inventory from OpenShift Container Platform sources do not have costs associated, you must create a cost model to associate a price to resources.

Creating a cost model for an OpenShift source includes assigning prices for usage and requests, as well as applying a markup or discount to determine the total costs of your OpenShift infrastructure.

Procedure

  1. From the Cost models menu, click Create cost model to open the cost model wizard.
  2. Enter a name and description for the cost model, and select OpenShift Container Platform as the source type to apply the cost model to. Click Next.
  3. Create a price list so you can assign rates to usage or requests. Cost management collects these metrics from OpenShift but there is no cost attached to them in cost management until you apply a cost model.

    1. Select a metric to apply a value to and click Next. Available metrics are CPU, Memory, Node, or Storage.
    2. Select a measurement for the metric.
    3. Enter a rate and save it.
    4. Add another rate by repeating the previous steps, or click Next to finish configuring your price list.
  4. To apply a markup to the base costs of your resources, enter a percentage value and click Next.

    • To apply a discount instead of a markup, enter a minus sign with the value (for example, -15).
    • If you do not want to apply a markup or discount, enter 0.

      Note

      You can use a markup to account for your overhead costs, such as the cost of administering the cluster, or support costs, for example. A markup is an estimation to cover your costs not shown by metrics or usage.

  5. Optionally, select one or multiple sources to assign the cost model to and click Next. Selecting a source with a cost model already assigned will override its previous cost model. You can also assign sources to your cost model at a later time.
  6. Review the cost model details, and click Create.
  7. Click Close to exit the cost model wizard.

Your new cost model will appear in the list on the Cost models page.

Next steps

  • From the Cost models page, click the more options button to View details or Delete the cost model. From the View details option, you can edit the cost model, including source assignments, markup, and more settings.
  • Review your tags and tagging strategy to ensure that costs are being distributed to the correct resources, cost centers, or teams. See the guide Using tagging to manage cost data for more information.

Legal Notice

Copyright © 2020 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.