There are two ways to pay for a Reserved Instance (RI) in Azure: you can pay the whole cost of the RI upfront, or you can pay in monthly installments. Monthly payment RIs are amortized by Azure, but All Upfront RIs have a custom amortization calculated by CCM.
APIs
CCM uses 3 Azure APIs to collect customer data about RIs:
Upfront Payment RIs
Amortization
- First, CCM calculates the total cost and quantity of the RI
- Then, we use that data and the total length of the term of the RI to calculate a per-hour cost for that RI
- Then, we calculate the number of hours that RI was active in the given month to determine the total cost for that RI, amortized for the current month
- All rows in the bill that represent usage of that RI are given a cost and rate in proportion to the quantity of usage
- Any RI capacity that was unused gets put in an "Unused RI" row, to represent the opportunity cost of paying for an RI that was not used
The sum of the cost for RI usage and Unused RI rows is the total cost of that RI for the given month
Example:
A customer buys a Reserved Instance for 1 VM for $12000 for 1 year, and they buy it in the middle of January. The monthly cost for that RI is $12000/12 months, or $1000 a month. Because the RI was only active for half of January, their amortized RI cost for January will be $500. If they use half of their available capacity for that RI, they will see $250 of usage rows, and a $250 Unused RI row for that RI.
Refunds
When a customer gets a refund on an RI, that refund is also spread over the term of the RI. This means that if an RI is refunded several months after it was purchased, previous months may need to be re-run in order to apply the refund to those months. Because the RI will continue to incur amortized costs over the original term, this can cause some confusion. If the customer got a full refund on their RI, they may wonder why they are still being charged for it after the refund. Refunds are always spread over the entire term of the original RI. Previous months must be re-run, and future months will incur amortized costs even if the RI was completely refunded.
Example:
A customer buys a 1-year RI for $12000. After 6 months, they get a refund on the remaining capacity of the RI ($6000). For those first 6 months, CCM had calculated the monthly cost of the RI to be $1000 (no refund). Once the refund goes through, if the customer re-runs the connector for those months, the refund of $6000 will be applied, and the cost of the RI for those months will be adjusted to $500. The remaining 6 months of the term of the RI after the refund will also have a monthly amortized cost of $500.
Monthly Payment RIs
Amortization
Monthly Payment RIs are not amortized by CCM. Azure tells us exactly how much quantity and cost the RI incurred this month, and CCM uses those numbers to calculate the rate and cost of usage and unused capacity.
Refunds
Refund events for monthly payment RIs are generated for the month in which the refund was given. CCM takes the total quantity and cost of the RI by summing the refund and the monthly payment and uses that to calculate rate and cost. Note: Refunds do not get their own row in the CCM output. They are included in the overall cost of the RI.
Reconciling with Azure and Cloudability
Because CCM does custom amortization of Azure RI costs and the Azure portal and Cloudability do not, the costs will not appear to reconcile at first glance. In order to reconcile, the user must
- Filter out rows where Offering Type = All Upfront
- Take the sum of the Cost column, this is the total cost of on-demand usage and monthly payment RIs.
- Then, filter only for rows where Offering Type = All Upfront and Reservation Start Date is in the current month
- Sum the Reservation Upfront Cost column, this is the total cost of RI purchases in the given month
- Add the numbers from steps 2 and 4 together to get the total invoice cost for the month. This number should be the same as the monthly costs reported by Azure and Cloudability.
Note: Refunds are not included in the Reservation Upfront Cost column, and are not given their own row in the month which they occur, so if a refund occurred in the month that the user is trying to reconcile, they will need to find the amount refunded in the Azure portal and subtract that from the number in step 5 in order to reconcile.