Using cost models

OpenShift Container Platform 4.6

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 hybrid cloud environment, then distribute the costs to resources.

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 cloud-based IT systems. Different sources provide a variety of cost data and metrics, which can be complicated to calculate together and accurately distribute the costs.

A cost model is a framework used to define the calculations for the costs stored in cost management. Using a cost model, you can 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 costs. 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. It helps to align costs to utilization: those customers that use a resource more will be charged more.

1.2. Cost model concepts

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

Cost model
A cost model is a framework used to define the calculations for the costs stored in cost management, using raw 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.

1.2.1. Cost layers

Costs can be created at different layers of the environment. In cost management, all costs can be classified as either infrastructure or supplementary costs (including your costs that are not identified as infrastructure). In your cost model, you can choose to allocate and present your costs as any of those cost layers. As a result, you can customize what cost management shows on each details page.

Infrastructure cost

This cost can come from two different sources:

  • Costs directly reported by a cloud provider, via an Amazon (AWS) Cost and Usage Report or Microsoft Azure export. In the current version of cost management, all cloud costs are considered infrastructure costs.
  • Costs calculated from a price list for rates specifically marked as infrastructure.

    Note

    OpenShift Container Platform node and cluster cost per month rates are classified as infrastructure cost by default, but can be optionally classified as supplementary.

Supplementary cost
All costs not directly attributed to infrastructure are identified as supplementary costs. In the current version of cost management, these costs come from applying a price list to metrics obtained from an OpenShift cluster. The rates in the price list must be specified as supplementary. This is the default for all OpenShift costs except node and cluster cost per month.

1.2.2. Cost model terminology

Cost
The sum of infrastructure and supplementary costs. This can be thought of as the "total cost" for the filtered data being shown (for example, cost for a particular account, region, or service).
Raw cost
The costs reported by a cloud provider without any cost model calculations applied.
Markup

The portion of cost calculated by applying markup or discount to infrastructure raw cost in the cost management application.

Example: For a raw cost of $100 and a markup of 10%, the markup would be $10, and the cost would be $110 (sum of both).

Usage cost

The portion of cost calculated by applying hourly and/or monthly price list rates to metrics.

Example: For a metric of 100 core-hours and a rate of $1/core-hour, the usage cost would be $100.

Monthly cost

The portion of cost calculated by applying monthly price list rates to metrics returned as part of usage cost. Monthly cost can be configured for OpenShift nodes or clusters in a cost model to account for subscription costs, for example.

Monthly costs are currently shown as part of the usage costs in the cost management API and interface.

Note

These costs are not currently amortized over the reported period in the API, so when viewing a daily breakdown of cost, monthly costs will only show on the first of the month.

Example: For an OpenShift cluster with 10 nodes at a rate of $10,000 per node per month, the monthly cost would be $100,000.

Price list
A list of rates used within the application’s cost model to calculate the usage cost of resources.
Distributed costs
The costs calculated by the cost model are distributed to higher level application concepts, such as project, account, service, and so on. How the costs are distributed depends on the cost type (infrastructure or supplementary) assigned in the cost model.

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 resources that are or were running in your source, whether they are presently in use or not. For example, if your OpenShift Container Platform environment contains a node that is not in use, that node still costs $x amount per month. There are several ways of collecting inventory data into cost management: cost management can generate inventory from the AWS Cost and Usage Report, Azure export, or OpenShift Metering Operator reports.
    • Metrics - A subset of the OpenShift inventory showing usage and consumption for each resource.
    • Cloud raw costs - AWS and Azure provide regular reports to cost management listing hourly consumption of resources and their costs, which cost management uses as is in calculations. As a result, configuring a custom price list is not necessary for cloud sources.
  2. The cost model allows you to apply a markup or discount of your choice to account for other costs and overhead, and provides options for assigning a cost layer (infrastructure or supplementary) to 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 usage cost of these resources. A price list includes rates for storage, memory, CPU usage and requests, and clusters and nodes.
    2. For AWS and Azure sources - You can create cost models for these sources to account for any extra costs or overhead in your environment by applying a markup percentage, or a negative percentage to calculate a discount.
  3. Costs from sources are then collected together and allocated as infrastructure cost and supplementary cost.
  4. The cost is then distributed to resources across the environment. 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. Setting up a cost model

2.1. Creating an AWS or Azure cost model with a markup

As cloud infrastructure sources collect cost and usage data into cost management with prices already assigned, you only need to assign a markup or discount (if desired) to accurately reflect your costs. These raw costs are collected in cost management from AWS Cost and Usage Reports or Azure exports.

Adding a markup to your raw costs can allow you to account for your overhead costs, such as the cost of administering your AWS account, Azure subscription, or other support costs. A markup is an estimation to cover your costs not shown by metrics or usage.

This example shows how to add a 10% markup to the information collected from the AWS Cost and Usage Reports. The same method can be used to apply a markup to your Azure costs.

Prerequisites

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 10% markup to the base costs of your resources, enter 10 in the as the Markup rate and click Next.

    Note
    • 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.
  4. Select one or multiple AWS 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 summary page, you can review information about your cost models, including:

    • The source type the cost model was created for
    • The number of sources assigned to the cost model
    • The date the cost model was last modified
  • To see more information or edit a cost model:

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

2.2. Creating a cost model for an OpenShift Container Platform cluster

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.

This example shows an OpenShift cluster running on-premises, meaning that while your cluster is running on cloud infrastructure (for example, AWS or Azure), you are not managing the infrastructure yourself. The cloud infrastructure costs are seen in cost management as part of the cluster cost, so creating a cost model allows you to distribute the underlying infrastructure cost to OpenShift.

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

You can assign your desired rates to CPU, Memory, Node, Cluster, or Storage metrics. You can set one rate per metric.

This example shows how to design and apply a cost model to your OpenShift on-premises cluster to accurately reflect the costs of running the cluster, including:

  • How to account for monthly OpenShift cluster and node costs
  • How to assign rates to OpenShift metrics and usage
  • How to classify costs as infrastructure or supplementary
  • How to apply a markup against your raw cost to get the usage cost

Prerequisites

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. You can also create your price list later.

    1. To apply a monthly node cost of $1,000:

      1. Click Add rate.
      2. For Metric, select Node.
      3. For Measurement, select Price (node-month).
      4. In the Rate field, enter 1000 to assign a $1,000 per price to each node in the sources you select (in a later step).
      5. Cost management classifies node and cluster costs as infrastructure costs by default. To change the cost type you are calculating, use the toggle under Rate. See Section 1.2.1, “Cost layers” to learn more.
      6. Click Add rate to save the node rate.
    2. To apply a rate to CPU requests:

      1. For Metric, select CPU.
      2. For Measurement, select Request (core-hours).
      3. In the Rate field, enter 0.09 to apply a $0.09 cost to each core-hour of CPU requests.
      4. Cost management classifies metrics-based data such as CPU requests as supplementary costs by default. To change the cost type you are calculating, use the toggle under Rate. See Section 1.2.1, “Cost layers” to learn more.
      5. Click Add rate to save the CPU request rate.
    3. Add additional rates by repeating the previous steps, or click Next to finish configuring your price list.
  4. If desired, set a markup or discount. To apply a 10% markup to the base costs of your resources, enter 10 in the as the Markup rate and click Next.

    Note
    • 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.
  5. Select one or multiple OpenShift 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 later.
  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 summary page, you can review information about your cost models, including:

    • The source type the cost model was created for
    • The number of sources assigned to the cost model
    • The date the cost model was last modified
  • To see more information or edit a cost model:

    • From the Cost models summary page, click more options (more options), then View details or Delete the cost model. From the View details option, you can edit the cost model, including source assignments, markup, and other settings.
  • Review your tags and tagging strategy to ensure that costs are being distributed to the correct resources, cost centers, or teams. See Managing cost data using tagging 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.