Settings / OpenStack Plans

../_images/openstackplans-list.png

An OpenStack plan is a collection or prices (rules with prices) for individual resources such as Instances, Volumes, Images or Network bandwidth

To create a new plan click the button from the bottom right corner of the screen.

../_images/createopenstackplan.png

The following modal window will popup and you’ll be able to choose:

  • Name: The name associated with the plan
  • Currency: The currency that the pricing plan will use
  • Default billing plan: When a new default billing plan is set it will apply for newly created clients. It does not change for existing clients.
../_images/openstackplan-creation.png

You must always have at least one pricing plan defined but fleio allows you to create additional ones.

The default plan applies to all customers by default and you can define additional pricing plans for various customer categories. For instance, you can to define discounts and use a different currency for a subset of customers.

../_images/openstackplans.png

The currency is selected per plan and applies for all pricing rules in that plan.

Note that a client is always invoiced using his default currency. The exchange rate will be applied to the amount determined by the pricing rules (if the client’s currency is different then the plan’s currency).

Right now you can create pricing rules for instances, volumes, images and L3 bandwidth, assuming L3 networking is used.

Future Fleio releases will support any kind of OpenStack resources, like VPN or Swift objects.

Deleting a plan

../_images/openstackplan-deletion.png

Click the Delete plan icon when hovering over a plan or enter its details page and hover over the action button. If you delete a plan, you’ll need to select another one to migrate the clients in the openstack plan you select.

Pricing Rules

To create a new pricing rule, click the (+) button either from the openstack plan details page or the openstack plans page when hovering an item. You’ll get redirected a new page with the following form that will be explained below.

../_images/openstackplans-pricingrule.png

One plan includes several pricing rules, each with it’s own set of filters and modifiers. The currency set for the billing plan is used for all pricing rules in that plan.

Common Pricing Rules Features

  • Pricing rules are not exclusive:
    • multiple rules can apply to the same cloud resource and the price outcome of each rule will be added to the total price.
  • The pricing rule name is only used for staff reference.
  • The Pricing attribute is used to determine what to charge for.
    For example, in case of an Image, a Pricing Attribute set to size will calculate the price based on the Image size. If the Pricing Attribute would be set to existance, then the price of an image of any size would be set.
  • The Unit can be set for specific attributes like memory_mb or any attribute that can be converted to a different size.
    If you want to charge an instance per GB of memory, you would set the Pricing attribute to memory_mb and the Unit to Gigabytes. Example: Charge $1 per 2GB of Instance RAM/Hour translates to Pricing attribute set to memory_mb, Unit set to Gigabytes, Time unit set to Hour and price set to 1, assuming the Plan currency is USD.
  • The Time unit sets the unit of time the price is for. As an example, a time unit
    of hour and the Pricing attribute set to existance means the price is set for every hour the instance exists in the cloud.
  • The total cost for a resource may end up being negative, especially when negative modifiers are used for discounts.
    Fleio deals with these prices by setting them to zero. This can be controlled from the Fleio settings.py file by setting OSBILLING_NEGATIVE_PRICE_ALWAYS_ZERO to False if you want negative prices (increasing your client’s credit balance in time) or True, which is the default, to always set negative prices to zero.

Filters

Pricing rules are by default applied to all resources of a type. To limit the scope of a pricing rule to a subset of resources, filters should be applied. Typical filters are: instance_type is m1.small or volume_type is SSD. For example, setting the filter instance_type is m1.small on an Instance pricing rule, will configure the pricing rule to only apply on instances with the m1.small flavor set.

Multiple filters can be added. The logical AND is used between them. In other words: the pricing rule applies only if all the filters are true.

Price Modifiers

Price modifiers define additional cost added or subtracted to/from the rule’s base price. For example, if you want to offer a discount of 10% for instances in a specific availability_zone you would create a modifier with the Attribute name set to availability_zone and the name of the availability zone desired, check the Price is percent checkbox and set the percent to -10 (as negative for discount). If you instead would like to charge a fixed amount of $10 for each instance running Windows, you would create a modifier with the os_type attribute set to windows and a fixed price of 10USD and the Time unit set to hour.

Price modifiers can match a list of values when the resource attribute is a normal text. For example, if you wish to match multiple OpenStack Compute cells, you would select the cell_name as the Attribute the In list or Not in list operator and for the value, each name should be separated by “,” as below:

cell1,
cell2,
cell3

Instance Pricing Rule

Price can be applied on compute instances based on one of the following:

  • existence: A price per Time Unit (second, minute, hour, billing cycle).
  • vcpu: The price per Time Unit is multiplied with the number of virtual CPU cores.
  • root_gb: The price per Time Unit is multiplied with the number of GB of the instance’s main disk.
  • memory_mb: The price per Time Unit is multiplied with the number of MB of the instance’s memory.
  • ephemeral_gb: The price per Time Unit is multiplied with the number of GB of the instance’s ephemeral disk size.

Image Pricing Rule

OpenStack Glance image storage can be priced on:

  • existence: A price per Time Unit (second, minute, hour, billing cycle) regardless of the size in GB.
  • size: The price per Time Unit is multiplied with the size of the image. You can select the Size Unit: Bytes, Killobytes, Megabytes, Gugabytes, Terabytes, Petabytes.

Volume Pricing Rule

OpenStack Cinder volumes (also known as block devices) are priced on the same characteristics as images:

  • existence: A price per Time Unit (second, minute, hour, billing cycle) regardless of the size in GB.
  • size: The price per Time Unit is multiplied with the size of the image. You can select the Size Unit: Bytes, Killobytes, Megabytes, Gugabytes, Terabytes, Petabytes.

Network Pricing Rule

This rule applies to the number of GB that have passed through an L3 network.

Flat pricing means that the number of GB is multiplied with the Price per GB that is filled in.

Tiered pricing allows to set difference pricing depending on the volume of GB that is charged. For example you can define that the first 1 000 GB cost 0.05 EUR per GB, the following GB up to 10 000 GB cost 0.045 EUR per GB, and the next GB (from 10 000 GB to infinite) cost 0.04 EUR.

You can also set the first tier to be free. I.e. the first 100 GB are included at no cost.

NOTE How to configure OpenStack to support network bandwidth billing/accounting.

The neutron-metering-agent needs to be installed besides each neutron-l3-agent in order to support L3 networking accounting.

Follow the simple configuration for the metering agent: configure-metering-agent

Assuming we would like to account for the external traffic, we may want to create the following label with rules:

First create a shared label that will automatically be applied to all projects:

openstack network meter create --description Shared --share bandwidth

Create a rule for the bandwidth label to account for the packets leaving the project router

openstack network meter rule create --egress --remote-ip-prefix 0.0.0.0/0 bandwidth

Create another rule to account for the packets entering the project router

openstack network meter rule create --ingress --remote-ip-prefix 0.0.0.0/0 bandwidth

If we wish to exclude any destination we can add another rule together with the –exclude switch:

openstack network meter rule create --exclude --ingress --remote-ip-prefix 0.0.0.0/0 bandwidth

The above rule excludes all traffic going to 10.0.0.0/8

Assuming we have the Neutron L3 metering agent installed and the Ceilometer notification agent and gnocchi and a Fleio princing rule defined for Bandwidth, the traffic accounting should start to display the cost for L3 networking in a few minutes.