Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 2. Setting up a cost model

download PDF

Configure cost models in cost management based on your requirements.

2.1. Applying a markup or discount to cloud integrations

Create a AWS, Azure, or Google Cloud cost model to apply a markup or discount to your cloud infrastructure costs.

As cloud infrastructure integrations (AWS, Azure, or Google Cloud) 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.

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 or discount to your Azure or Google Cloud costs.

Note

Creating, editing, or deleting a cost model only updates calculations starting from the first day of the current month.

Prerequisites

Procedure

  1. From cost management, click Cost Management Settings.
  2. In the Cost models tab, click Create cost model to open the cost model wizard.
  3. Enter a name and description for the cost model, and select Amazon Web Services (AWS) as the integration type to apply the cost model to. Click Next.
  4. 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 AWS integrations to assign the cost model to and click Next. Selecting a integration with a cost model already assigned will override its previous cost model. You can also assign integrations 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 summary page, you can review information about your cost models, including:

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

    • From the Cost models summary page, click a cost model name to bring up the details page where you can edit the cost model, including integration assignments, markup, and other Settings.
  • To delete a cost model:

    • From the Cost models summary page, click More options More options icon , then Delete.
  • 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 integrations do not have costs associated, you must create a cost model to associate a price to resources.

Creating a cost model for an OpenShift integration includes assigning prices for usage and requests using CPU, memory, node, cluster, storage, or persistent volume claim metrics, and applying a markup or discount to determine the total costs of your OpenShift infrastructure. You can also use tags to measure costs for specific parts of your infrastructure, such as various storage methods, giving you greater control over your individual requirements. See Managing cost data using tagging for more information about tagging in cost management.

This example shows how to design and apply a cost model for an OpenShift Container Platform cluster on cloud infrastructure (for example, AWS or Azure). 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 accurately reflect the costs of running the cluster.

Note

Creating, editing, or deleting a cost model only updates calculations starting from the first day of the current month.

Prerequisites

Procedure

  1. From cost management, click Cost Management Settings.
  2. In the Cost models tab, click Create cost model to open the cost model wizard.
  3. Enter a name and description for the cost model, and select OpenShift Container Platform as the integration type to apply the cost model to. Click Next.
  4. Create a price list so you can assign rates to usage or requests. The cost management service 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 Create rate.
      2. For Metric, select Node.
      3. For Measurement, select Count (node-month).
      4. The cost management service classifies node and cluster costs as infrastructure costs by default. To change the cost type you are calculating, select it under Calculation type. See Key concepts to learn more.
      5. In the Rate field, enter 1000 to assign a $1,000 per price to each node in the integrations you select (in a later step).
      6. Click Create rate to save the node rate.
    2. To apply a rate to CPU requests:

      1. Click Create rate.
      2. For Metric, select CPU.
      3. For Measurement, select Request (core-hours).
      4. The cost management service classifies metrics-based data such as CPU requests as supplementary costs by default. To change the cost type you are calculating, select it under Calculation type. See Key concepts to learn more.
      5. In the Rate field, enter 0.09 to apply a $0.09 cost to each core-hour of CPU requests.
      6. Click Create rate to save the CPU request rate.
    3. To apply tag-based rates to persistent volume claims:

      1. Click Create rate.
      2. For Metric, select Persistent volume claims.
      3. For Measurement, select Count (pvc-month).
      4. The cost management service classifies persistent volume claim rates as infrastructure costs by default. To change the cost type you are calculating, select it under Calculation type. See Key concepts to learn more.
      5. Select Enter rate by tag.
      6. Enter a tag key in the Filter by tag key field.
      7. Enter a Tag value and Rate. You can select Default to specify a rate as default for that tag key.

        Note
        • Specifying a default rate will apply that rate to all tag values for the corresponding tag key that are not defined. You can enter a rate of 0 for any tag value that you do not want the default rate applied to.
      8. Click Add more tag values to add as many tag values as you require.
      9. Click Create rate to save the persistent volume claim rates.
    4. Add additional rates by repeating the previous steps, or click Next to finish configuring your price list.
  5. 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.
  6. On the Cost distribution page, select the CPU or Memory distribution type. The distribution type distributes costs based on CPU or memory metrics in project cost breakdowns. If your cluster has high memory usage, select Memory. If your cluster has high CPU usage, select CPU.
  7. On the Cost distribution page, select whether or not to distribute your Platform or Worker unallocated costs into your projects and click Next.
  8. Select one or multiple OpenShift integrations to assign the cost model to and click Next. Selecting a integration with a cost model already assigned will override its previous cost model. You can also assign integrations to your cost model later.
  9. Review the cost model details, and click Create.
  10. 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 integration type the cost model was created for
    • The number of integrations assigned to the cost model
    • The date the cost model was last modified
  • To see more information, assign, or edit a cost model:

    • From the Cost models summary page, click a cost model name to bring up the details page where you can edit the cost model, including integration assignments, price list, markup, and other Settings.
  • To delete a cost model:

    • From the Cost models summary page, click More options More options icon , then Delete. .
  • 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.3. Calculating effective usage with cost models

Cloud providers charge for the infrastructure costs of running a cluster, regardless of your overall usage. By calculating the effective usage in cost management, you can more accurately correlate cloud costs with a pod or namespace by considering their direct utilization.

A pod typically requests resources, such as CPU or memory, from a cluster. The cluster then reserves these requested resources as a minimum, but the pod might use more or less than it initially requested. The effective usage metric in cost management uses whichever kind of usage, CPU or memory, is greater per hour.

You can create a cost model in cost management to estimate your effective usage. Ultimately, you can use this data to understand how infrastructure cost is distributed to your OpenShift project.

Prerequisites

Procedure

  1. Log in to Red Hat Hybrid Cloud Console.
  2. From the Services menu, click Spend Management Cost Management.
  3. In the Global Navigation, click Cost Management Settings.
  4. In the Cost Models tab, click Create cost model to open the cost model wizard.
  5. Enter a name and description for the cost model and select OpenShift Container Platform as the integration type. Click Next.
  6. Create a price list so that you can assign rates to usage or requests. The cost management service collects these metrics from OpenShift but there is no cost attached to them in cost management until you apply a cost model.

    1. To create a price list to calculate effective CPU usage, click Create rate.

      1. Add a description. In this example, enter effective cpu usage.
      2. In the Metric field, select CPU.
      3. In the Measurement field, select Effective-usage (core-hours).
      4. In the Rate field, enter the rate you pay for CPU usage. In this example, enter 2. Click Create rate.
    2. To create a price list to calculate effective memory usage, click Create rate.

      1. Add a description. In this example, enter effective memory usage.
      2. In the Metric field, select Memory.
      3. In the Measurement field, select Effective-usage (GB-hours).
      4. In the Rate field, enter the rate you pay for memory usage. In this example, enter 1. Click Create rate.
  7. Click Next.
  8. (Optional) On the Cost calculations page, apply a markup or discount to change how raw costs are calculated for your integrations. 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.
  9. On the Cost distribution page, select the CPU or Memory distribution type. The distribution type distributes costs based on CPU or memory metrics in project cost breakdowns. If your cluster has high memory usage, select Memory. If your cluster has high CPU usage, select CPU. Click Next.
  10. Assign an integration to your cost model and then click Next.
  11. Review the details and then click Create.
  12. To review the results of your cost model on a integration, in the Global Navigation, click Cost Management OpenShift.
  13. Select a project and view the results.
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.