# 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 the General Configuration guide, available from https://access.redhat.com/documentation/en/red-hat-cloudforms/.

## 5.1. Chargeback Rates

CloudForms Management Engine 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.

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

### 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

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).

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).

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).

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

## 5.2. Creating Chargeback Rates

CloudForms Management Engine allows you to create your own set of computing and storage costs.

Procedure: To Create Chargeback Rates

1. Navigate to Cloud IntelligenceChargeback.
2. Click the Rates accordion and select either Compute or Storage.

• Use Compute to set chargeback rates for CPU, disk I/O, memory, network I/O, and fixed items.
3. * Use Storage to set chargeback rates for fixed and storage items.
4. Click , to create a new chargeback rate.
5. Type in a Description for the chargeback rate.
6. For each item that you want to set, type in a rate and select a time option.
7. Click .

## 5.3. Assigning Chargeback Rates

CloudForms Management Engine allows you to assign chargeback rates by choosing from Compute and Storage.

Procedure: To Assign Chargeback Rates

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, or Tagged VMs and Instances.
• Use Storage to assign a storage chargeback rate.
2. You can assign chargeback rates to The Enterprise, Selected Datastores, or Tagged Datastores.
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 .

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

Note

Note that 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

CloudForms Management Engine allows you to create chargeback reports to monitor costs you charged.

Procedure: To Create a Chargeback Report

1. Navigate to Cloud IntelligenceReports.
2. Click the Reports accordion.
3. Click , .
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 . 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 or .
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 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.