Chapter 5. Chargeback

The chargeback feature allows you to calculate monetary virtual machine charges based on owner or company tag. To use this feature you must be collecting capacity and utilization data.

For information on server control settings and capacity & utilization collection settings, see General Configuration.

5.1. Chargeback Rates

Red Hat CloudForms provides a default set of rates for calculating chargeback costs, but you can create your own set of computing and storage costs by navigating to Cloud IntelligenceChargeback and clicking the Rates accordion.

You can configure chargeback rates for various resources by selecting either Compute or Storage in the Rates accordion. Compute sets chargeback rates for CPU, disk I/O, fixed compute cost, memory, and network I/O items, while Storage sets chargeback rates for fixed storage cost and disk storage.

Chargeback costs are computed using a set formula based on hourly cost per unit and hourly usage.

Chargeback can be calculated in the following currencies:

  • United States Dollars (USD)
  • Euro (EUR)
  • Pound Sterling (GBP)
  • Japanese Yen (JPY)

Chargeback rates can be assigned at a single rate or by tiers, where rates are assigned in ranges depending on level of usage.

Additionally, chargeback can be calculated at one fixed rate, or by a combination of fixed and variable rates per tier. Fixed rates are charged once per unit of time, and the variable rate is calculated by the level of usage multiplied by the number of resources used in a unit of time.

5.1.1. Memory Used Cost

Calculating the Memory Used Cost in dollars ($) for a day can be expressed in the following ways:

  • Memory allocation per hour (in MB) * Hourly Allocation cost per megabyte * Number of Memory Allocation metrics available for the day
  • Sum of Memory allocation for the day (in MB) * Hourly Allocation cost per megabyte
  • Sum of Memory allocation for the day (in MB) * Daily Allocation cost per megabyte / 24

Memory costs can be measured in B, KB, MB, GB, or TB.

Example 5.1. Memory Used Cost

In a scenario where 9.29 GB of memory is used in a day with the chargeback rate set at one dollar ($1) per megabyte per day, the Memory Used Cost would be $396.42.

  • 9.29 GB = 9514.08 MB
  • 9514.08 MB * $1 (per MB per day) = $9514.08
  • $9514.08 / 24 = $396.42 Memory Used Cost

5.1.2. CPU Total Cost

The CPU Total Cost is defined as the number of virtual CPUs over the selected interval (hour, day, week, month). CPU costs can be measured in units of Hz, KHz, MHz, GHz, or THz, as specified when creating a chargeback rate.

Example 5.2. CPU Total Cost

In a scenario where 16 CPUs are used in a day with the chargeback rate set at one dollar per CPU per day, the CPU Total Cost would be $16.

  • 16 CPUs * $1 (per CPU per day) = $16 CPU Total Cost

5.1.3. CPU Used Cost

The CPU Used Cost is defined as the average CPU used in MHz over the selected rate interval (hour, day, week, month). CPU Used Cost is not supported for containers providers.

Example 5.3. CPU Used Cost

In a scenario where 2.5 GHz is used in a day with the chargeback rate set at $0.01 per MHz per day, the CPU Used Cost would be $25.

  • 2.5 GHz = 2500 MHz
  • 2500 MHz * $0.01 (per MHz per day) = $25 CPU Used Cost

5.1.4. Storage Allocated Cost

The Storage Allocated Cost is defined as the Allocated Disk Storage in bytes over the selected rate interval (hour, day, week, month). Storage costs can be measured in B, KB, MB, GB, or TB.

Example 5.4. Storage Allocated Cost

In a scenario where 500 GB are used in a day with the chargeback rate set at $0.10 per GB per day, the Storage Allocated Cost would be $50.

  • 536,870,912,000 bytes = 500 GB
  • 500 GB * $0.10 (per GB per day) = $50 Storage Allocated Cost

5.1.5. Storage Total Cost

The Storage Total Cost is defined as the Used Disk Storage in bytes over the selected rate interval (hour, day, week, month).

Example 5.5. Storage Total Cost

In a scenario where 250 GB are used in a day with the chargeback rate set at $0.10 per GB per day, the Storage Total Cost would be $25.

  • 268,435,456,000 bytes = 250 GB
  • 250 GB * $0.10 (per GB per day) = $25 Storage Total Cost

5.1.6. Storage Used Cost

The Storage Used Cost is defined as the Used Disk Storage in bytes over the selected rate interval (hour, day, week, month).

Example 5.6. Storage Used Cost

In a scenario where 250 GB are used in a day with the chargeback rate set at $0.10 per GB per day, the Storage Used Cost would be $25.

  • 268,435,456,000 bytes = 250 GB
  • 250 GB * $0.10 (per GB per day) = $25 Storage Used Cost
Note

The following chargeback rates are not supported for containers providers:

  • Allocated CPU count
  • Used CPU
  • Used disk I/O
  • Allocated memory

5.2. Creating Chargeback Rates

Red Hat CloudForms allows you to create your own set of computing and storage costs to use for billing.

Chargeback rates can be configured at a single rate or in tiers, where one rate is assigned to one usage range, and another rate is assigned to a different usage range. You can also assign fixed and variable rates per tier if desired.

There are three methods to create a chargeback rate: editing or copying an existing rate, or creating a new rate.

5.2.1. Editing a Chargeback Rate

  1. Navigate to Cloud IntelChargeback.
  2. Click the Rates accordion and select an existing rate from under Compute or Storage.
  3. Click 1847 (Configuration) and 1851 (Edit this Chargeback Rate).
  4. Edit the rate as desired.
  5. Click Save at the bottom of the screen to save the chargeback rate.

5.2.2. Copying a Chargeback Rate

  1. Navigate to Cloud IntelChargeback.
  2. Click the Rates accordion and select an existing rate from under Compute or Storage.
  3. Click 1847 (Configuration) and 1859 (Copy this Chargeback Rate).
  4. Edit the rate as desired.
  5. Click Add at the bottom of the screen to save the chargeback rate.

5.2.3. Adding a Chargeback Rate

The following example shows a scenario to create a new chargeback rate for allocated CPU usage in Euro per week measured by the following tiers, calculating both fixed and variable costs:

Example: Creating a tiered chargeback rate

  • Tier 1: 0-2 CPU = 1 Euro fixed + 0.5 Euro variable
  • Tier 2: 2-4 CPU = 0.8 Euro fixed + 0.4 Euro variable
  • Tier 3: 4 CPU and above = 0.6 Euro fixed + 0.2 Euro variable

To configure this rate:

  1. Navigate to Cloud IntelChargeback.
  2. Click the Rates accordion and select Compute to create a CPU chargeback rate.
  3. Click 1847 (Configuration) and 1862 (Add a new Chargeback Rate).
  4. Type in a Description for the chargeback rate.
  5. Select Euro for currency.
  6. In Rate Details, select the time, and fill in the range and rates for each tier. Alternatively, a single chargeback rate can be configured by using only one tier. For this example, in Allocated CPU Count, configure:

    1. For tier 1, set:

      1. In Per Time, select Hourly.
      2. In Range, specify the CPU range: Start remains as 0.0 and Finish is 2.
      3. In Rate, specify 1 for the Fixed rate, and 0.5 for the Variable rate.
      4. Click Add under Actions to create a new, blank Allocated CPU Count line for tier 2.
    2. For tier 2, set:

      1. In the new line in Range, specify the CPU range: Start is 2 and Finish is 4.
      2. In Rate, specify 0.8 for the Fixed rate, and 0.4 for the Variable rate.
      3. Click Add under Actions to create another new, blank Allocated CPU Count line for tier 3.
    3. For tier 3, set:

      1. In the new line in Range, specify the CPU range: Start is 4 and leave Finish as Infinity.
      2. In Rate, specify 0.6 for the Fixed rate, and 0.2 for Variable.

        Tiered Chargeback

  7. Click Add at the bottom of the screen to save the chargeback rate.

The rate can now be assigned.

5.3. Assigning Chargeback Rates

Red Hat CloudForms allows you to assign chargeback rates by choosing from Compute and Storage.

  1. Navigate to Cloud IntelligenceChargeback. Click the Assignments accordion, and click either Compute or Storage.

    • Use Compute to assign a compute chargeback rate. You can assign chargeback rates to The Enterprise, Selected Clusters, Selected Infrastructure Providers, Tagged VMs and Instances, or Tenants.
    • Use Storage to assign a storage chargeback rate.
  2. You can assign chargeback rates to The Enterprise, Selected Datastores, Tagged Datastores, or Tenants.
  3. From the Basic Info area, use the Assign To list to select a type of assignee to assign the rate set to. The options displayed vary based on the type you selected.
  4. For each item to set, select the chargeback rate to use.
  5. Click Save.

The rate is assigned. The next time you generate a chargeback report, these values will be used.

Note

When viewing chargeback, there is a rate for a virtual machine for the number of the CPUs. The chargeback for this parameter is calculated based on when the virtual machine is running. If the virtual machine is not running, then it is not charged for CPU allocation.

5.4. Creating a Chargeback Report

Red Hat CloudForms allows you to create chargeback reports to monitor costs you charged.

  1. Navigate to Cloud IntelligenceReports.
  2. Click the Reports accordion.
  3. Click 1847 (Configuration), 1862 (Add a new Report).
  4. On the Columns tab, fill out the Basic Report Info area.

    • Type a unique name in Menu Name for how you want the report described in the menu list.
    • Type the Title to display on the report.
  5. Add fields in the Configure Report Columns area.

    • From the Base the report on list, select Chargebacks.
    • Select the fields to include in the report from the Available Fields list, then click 2289 (Move selected fields down). In addition to the fields, you can also select any tags that you have created and assigned.
    • Change the order of the fields in the report by clicking 2290 (Move selected fields up) or 2289 (Move selected fields down)].
  6. Click the Formatting tab to set the size of paper for a PDF and column header format.

    • From the PDF Output area, select the page size from the Page Size list.
    • From Specify Column Headers and Formats, type the text to display for each field. For each numeric field, you can also set the numeric format.
  7. Click the Filter tab to set filters for the data displayed in the report.

    • From Chargeback Filters, select how you want the costs to show, the tag category, the tag, and how you want the items grouped.
    • From Chargeback Interval, select the time interval. You must have a full interval worth of data in order to select an option other than Partial in the Daily Ending With list.
  8. Click the Preview tab, and then Load to see what the report will look like.
  9. When you are satisfied that you have the report that you want, click Add to create the new report.

The new report is created. To make the report accessible from the Report menu, you must add it to a report menu.