Rates in CloudBolt

Rates can be assigned to hardware, operating systems, applications, blueprint items, and other parameters in CloudBolt to provide users with a preview of the rate that their orders will incur before they submit their request. Provisioned servers and resources will have rates associated with them, which are aggregated and reported by CloudBolt in various ways, showing the spend incurred by servers, groups, environments, and individual users.

How CloudBolt Rates can be Used

CB rates are useful for internal showback and chargeback to different groups to show/charge them for what they used for a particular month. This can be done by using the export_server_info command-line command from the CB server (for more info, see Export and/or Email Simple CSV Report) or one of the graphical reports from the Reports section of the CB UI.

Rates for Public Cloud Servers

CloudBolt uses data provided by AWS, Azure, and GCE to provide cost predictions when users order VMs from these public cloud providers. In the case of AWS and GCE, CloudBolt periodically downloads the rate data files provided by them so it can quickly lookup and calculate the predicted rate for a VM as the user changes options on the order form. In the case of Azure, a rate data sheet is not made available, so CloudBolt calls into Azure’s API when users change parameters to determine the predicted rate.

The logic that CloudBolt uses to compute these rates can be seen by admins within CloudBolt Plug-ins in the user interface: AdminOrchestration ActionsOtherCompute Server Rate.

Setting Up Rates for Servers

Rates can be assigned to any of the following from the Admin > Rates section of the UI:

  • CPUs
  • GB of memory
  • GB of disk
  • OS Build
  • Application
  • Any boolean parameter
  • Any integer or decimal parameter

A rate for each of these can be set globally, and also set per-environment to override the global default with more specific rates for an environment.

These rates will be applied to any server orders and servers for which no orchestration actions apply for computing their rate (see below).

Note

When changing rates globally or per-environment, all affected servers will have their rate and quota impact recalculated and stored, which may take some time to complete.

Setting Up Rates for Resources

Within the “Build” tab of a blueprint, several types of items can have rates associated with them. When the blueprint is deployed, the rate will be shown on the order form so users can see the impact of their orders. When a resource is created, the sum of all the rates of these items will be associated with the deployed resource. This rate will in turn be included in the rate for the group that is shown on the group detail page.

To get started setting up rates on resources, click the edit pencil on the right-hand side of a blueprint item of type “action”, “pod”, or “load balancer” and enter a rate for the item.

Multipliers

Multipliers can be used to implement tiers of a given rate. For example, if you have SSD storage and HDD storage, you may want to make the SSD storage twice the price of the normal HDD rate.

When creating a disk storage multiplier, you can choose what disk type will trigger the multiplier and the amount to multiply the base disk rate by.

Disk types are currently only supported for VMware vCenter.

Compute Server Rate Orchestration Action

If you’d like to write your own rate calculation logic, you can specify a Compute Server Rate orchestration action in AdminOrchestration ActionsOtherCompute Server Rate.

To use your custom logic, write a CloudBolt plugin that implements a function called compute_rate. This function can use the following keyword arguments:

  • group: the group deploying the server
  • environment: the envrionment where the server will be deployed
  • resource_technology: the technology of the server’s resource handler
  • cfvs: a list of parameter values
  • pcvss: a list of preconfiguration values
  • os_build: the server’s OS build
  • apps: the applications to deploy to the server
  • quantity: the number of servers to deploy
  • server: the server object - Note that this is only available in some contexts, and not available in many (e.g., the order form) so your plugin must be able to handle it not being provided

The compute_rate function should return a dictionary containing three top-level keys: Hardware, Software, and Extra. These keys are case sensitive. The value of each key should a monthly rate expressed as a string, or a dictionary with a more detailed rate breakdown.

Example return values of compute_rate:

{
    "Hardware": "3",
    "Software": "1.55",
    "Extra": "0"
}
{
    "Hardware": {
        "CPUs": "20.04",
        "Mem Size": "13.30",
        "Disk Size": "0.67"
    },
    "Software": {
        "OS Build": "1.21",
        "Applications": "30.00"
    },
    "Extra": "2.01"
}