Quotas and Accounting
Quotas
Each project is assigned a quota which defines how much resources it can use. Operations, such as virtual machine creation, are validated against the maximum quota permitted for the current project.
The project quota can be checked using the Openstack Horizon Dashboard or using the command line below:
$ openstack quota show --fit-width
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| backup-gigabytes | 50000 |
| backups | 50 |
| cores | 200 |
| fixed-ips | -1 |
| floating-ips | 50 |
| gigabytes | 10000 |
| gigabytes_CEPH_1 | -1 |
| gigabytes_CEPH_1_perf1 | -1 |
| gigabytes_CEPH_1_perf2 | -1 |
| gigabytes_CEPH_1_perf3 | -1 |
| gigabytes_CEPH_1_perf4 | -1 |
| groups | 20 |
| injected-file-size | 10240 |
| injected-files | 5 |
| injected-path-size | 255 |
| instances | 50 |
| key-pairs | 100 |
| location | Munch({'cloud': '', 'region_name': '', 'zone': None, 'project': Munch({'id': 'ac4fafd60021431585bbb23470119557', 'name': 'taylor', 'domain_id': None, 'domain_name': 'Default'})}) |
| networks | 50 |
| per-volume-gigabytes | -1 |
| ports | 200 |
| project | ac4fafd60021431585bbb23470119557 |
| project_name | taylor |
| properties | 128 |
| ram | 1048576 |
| rbac_policies | 10 |
| routers | 10 |
| secgroup-rules | 200 |
| secgroups | 20 |
| server-group-members | 10 |
| server-groups | 20 |
| snapshots | 50 |
| snapshots_CEPH_1 | -1 |
| snapshots_CEPH_1_perf1 | -1 |
| snapshots_CEPH_1_perf2 | -1 |
| snapshots_CEPH_1_perf3 | -1 |
| snapshots_CEPH_1_perf4 | -1 |
| subnet_pools | -1 |
| subnets | 50 |
| volumes | 100 |
| volumes_CEPH_1 | -1 |
| volumes_CEPH_1_perf1 | -1 |
| volumes_CEPH_1_perf2 | -1 |
| volumes_CEPH_1_perf3 | -1 |
| volumes_CEPH_1_perf4 | -1 |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
For the Object Storage quota (in bytes) use the command:
openstack object store account show
$ openstack object store account show
+------------+---------------------------------------+
| Field | Value |
+------------+---------------------------------------+
| Account | AUTH_fce31ac00731428ahstd06d5465ff1df |
| Bytes | 0 |
| Containers | 0 |
| Objects | 0 |
| properties | quota-bytes='1099511627776' |
+------------+---------------------------------------+
Info
When displaying quotas, a value of -1
or none
means unlimited.
You can change your quotas from your Infomaniak workspace.
Infomaniak Quotas Packs description
Quota name | infomaniak level1 | infomaniak level2 | infomaniak level3 | Description |
---|---|---|---|---|
backup-gigabytes | 1000 | 5000 | 50000 | Maximum size of backups in GB's (Sum of all backups) |
backups | 10 | 50 | 100 | Number of backups allowed for the project |
cores | 20 | 200 | 500 | Number of instance cores (VCPUs) allowed per project |
fixed-ips | unlimited | unlimited | unlimited | Number of fixed IP addresses allowed per project. This number must be equal to or greater than the number of allowed instances. |
floating-ips | 10 | 50 | 100 | Number of floating IP addresses allowed per project |
gigabytes | 1000 | 10000 | 50000 | Total space in external volumes |
gigabytes_CEPH_1_perf1 | unlimited | unlimited | unlimited | Volumes allowed for this volume storage specific CEPH_1 type |
groups | 10 | 20 | 50 | |
health_monitors | None | None | None | |
injected-file-size | 10240 | 10240 | 10240 | Number of content bytes allowed per injected file |
injected-files | 5 | 5 | 5 | Number of injected files allowed per project |
injected-path-size | 255 | 255 | 255 | Number of bytes allowed per injected file path |
instances | 10 | 50 | 200 | Number of virtual machines allowed per project |
key-pairs | 10 | 100 | 100 | Number of key pairs allowed per user |
l7_policies | None | None | None | Max number of load balancer l7 policies allowed for the project |
listeners | None | None | None | Max number of load balancer listeners allowed for the project |
load_balancers | None | None | None | Max number of load balancers allowed for the project |
location | User default | User default | User default | |
object storage | 1TB | 10TB | 100TB | Maximum object storage space allowed |
name | None | None | None | |
networks | 10 | 50 | 100 | Number of networks allowed for the project |
per-volume-gigabytes | unlimited | unlimited | unlimited | Maximum size in GB's of individual volumes. |
pools | None | None | None | Number of load balancer pools allowed for the project |
ports | 20 | 200 | 500 | Number of network ports allowed for the project |
max-projects-per-account | 3 | 15 | 50 | |
max-users-per-project | 3 | 15 | 50 | |
project_name | PCP-XXXXXXX | PCP-XXXXXXX | PCP-XXXXXXX | |
properties | 128 | 128 | 128 | Number of properties allowed for a project |
ram | 65536 | 1048576 | 2097152 | Total megabytes of instance ram allowed per project |
rbac_policies | 10 | 10 | 10 | Number of rbac policies allowed for the project |
routers | 10 | 10 | 10 | Number of routers allowed for the project |
secgroup-rules | 100 | 200 | 1000 | Number of rules per security group |
secgroups | 10 | 20 | 500 | Number of security groups per project |
server-group-members | 10 | 100 | 200 | Number of servers per server group |
server-groups | 10 | 20 | 100 | Number of server groups per project |
snapshots | 10 | 50 | 100 | Total number of volume snapshots allowed per project |
snapshots_CEPH_1_perf1 | unlimited | unlimited | unlimited | Snapshots allowed for this volume storage specific CEPH_1 type |
subnet_pools | unlimited | unlimited | unlimited | Number of subnet pools allowed for the project |
subnets | 10 | 50 | 100 | Number of subnets allowed for the project |
volumes | 20 | 100 | 500 | Total volumes allowed for the project |
volumes_CEPH_1_perf1 | unlimited | unlimited | unlimited | Volumes allowed for this volume storage specific CEPH_1 type |
Billing, Metering and Rating
Billing uses a virtual currency called ICU (Infomaniak Cloud Unit).
Example :
Currency | Value | Infomaniak Cloud Unit (ICU) |
---|---|---|
CHF | 1 | 50 |
EUR | 1 | 55.5 |
Resources usage (vcpu, ram, disk, IP,... ) are accounted by the Openstack projects Ceilometer and CloudKitty. They are stored into timeseries databases. These metrics can later be used for billing, alerting and/or auto-scaling.
You will find below some typical use cases, please refer to the full documentation for other uses.
You can query these metrics at any time, to verify your resource consumption for example.
Billing
Billing is accounted with a virtual currency called ICU (Infomaniak Cloud Unit), you can find the currency converter here.
Example :
Currency | Value | Infomaniak Cloud Unit (ICU) |
---|---|---|
CHF | 1 | 50 |
EUR | 1 | 55.5 |
Installing The Clients
sudo apt install python3-gnocchiclient
sudo apt install python3-cloudkittyclient
Or using pip:
python3 -m pip install python-openstackclient gnocchiclient python-cloudkittyclient
Using The Clients
How much money have I been charged ?
This can be calculated by summing all the ICU ratings for the desired period and then dividing by the ICU's monetary equivalent in the wanted currency.
For example, using shell command subsitution to get the past date and some jq to make the calculation,
the following snippet calculates the CHF cost (50 ICUs equalling to CHF 1.-) of the last hour :
openstack rating dataframes get -b $(date +'%Y-%m-%dT%H:00:00+00:00' -u --date="2 hours ago") -c Resources -f json \
| jq 'map(.Resources[].rating | tonumber) | add | . / 50'
Info
You may wonder why the command specify 2 hours ago
instead of 1 hour
. The reason to this is that the billing is calculated every hour, therefore the last hour has not been calculated yet. A more precise term would be last calculated hour
.
Resources rated
To list all the resources rated you can use the command below.
$ openstack rating info metric list
+---------------------------------------+--------------+-----------------+
| Metric | Unit | Metadata |
+---------------------------------------+--------------+-----------------+
| instance_up | instance | ['flavor_name'] |
| instance_reserved | instance | ['flavor_name'] |
| image.size | GiB | [] |
| volume.size | GiB | ['volume_type'] |
| volume.snapshot.size | GiB | ['type'] |
| snapshot.size | GiB | ['type'] |
| ip.floating | ip | ['state'] |
| network.ports.ext-net1 | ip | [] |
| network.ports.router-gw-ext-floating1 | ip | [] |
| network.subnets.public | ip | [] |
| network.services.lb.loadbalancer | loadbalancer | [] |
| storage.objects.size | Gib | [] |
| storage.objects.outgoing.bytes | Gib | [] |
| volume.backup.size | Gib | [] |
+---------------------------------------+--------------+-----------------+
Get rating for a specific resource
The example below will display the amount of ICU consumed for the resource type storage.objects.outgoing.bytes
.
Info
The 10TB free tier for storage.objects.outgoing.bytes
isn't accounted here meaning you' ll start being charged if storage.objects.outgoing.bytes
> 10000000000000
.
$ openstack rating summary get -b $(date +'%Y-%m-%dT%H:00:00+00:00' -u --date="2022-01-01") -s storage.objects.outgoing.bytes
+----------------------------------+--------------------------------+-------------+---------------------+---------------------+
| Tenant ID | Resource Type | Rate | Begin Time | End Time |
+----------------------------------+--------------------------------+-------------+---------------------+---------------------+
| 638e9cb746924467a37b0bd1865ba3f5 | storage.objects.outgoing.bytes | 10349.48817 | 2022-01-01T00:00:00 | 2022-02-01T00:00:00 |
+----------------------------------+--------------------------------+-------------+---------------------+---------------------+
Get rating for all resources
The command below will display the amount of ICU consumed for each type of resources since 2022-01-01
$ for metric in $(openstack rating info metric list -f value -c Metric); do echo -n "$metric: "; openstack rating summary get -b $(date +'%Y-%m-%dT%H:00:00+00:00' -u --date="2022-01-01") -s $metric -f value -c Rate; done
instance_up: 874.49036
instance_reserved: 122.3492
image.size: 0.45206
volume.size: 3661.71077
volume.snapshot.size: 0
snapshot.size: 0
ip.floating: 483.33332
network.ports.ext-net1: 44.97717
network.ports.router-gw-ext-floating1: 146.80365
network.subnets.public: 0
network.services.lb.loadbalancer: 49.31507
storage.objects.size: 0.0
storage.objects.outgoing.bytes: 0.00291
volume.backup.size: 0
Get rating/hour
For example, command below shows the rating value per hour for the running VM instances for the period starting the 2021-11-01 :
$ openstack rating dataframes get -b 2021-11-01 -r instance_up --fit-width
+---------------------+---------------------+----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| Begin | End | Project ID | Resources |
+---------------------+---------------------+----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
| 2021-11-01T00:00:00 | 2021-11-01T01:00:00 | 247f44b372c44205b59bfeacc2ea86bc | [{'rating': '0.402435', 'service': 'instance_up', 'desc': {'flavor_name': 'a2-ram4-disk20-perf1', 'id': |
| | | | '10736315-bd1a-406c-b90a-2f2fcce8674f', 'project_id': '247f44b372c44205b59bfeacc2ea86bc', 'tenant_id': |
| | | | '247f44b372c44205b59bfeacc2ea86bc'}, 'volume': '1', 'rate_value': '0.4024'}] |
| 2021-11-01T00:00:00 | 2021-11-01T01:00:00 | 247f44b372c44205b59bfeacc2ea86bc | [{'rating': '0.804869', 'service': 'instance_up', 'desc': {'flavor_name': 'a4-ram8-disk20-perf1', 'id': |
| | | | 'b8880e4e-9cb7-4419-b2cf-d20254ce53da', 'project_id': '247f44b372c44205b59bfeacc2ea86bc', 'tenant_id': |
| | | | '247f44b372c44205b59bfeacc2ea86bc'}, 'volume': '1', 'rate_value': '0.8049'}] |
| 2021-11-01T01:00:00 | 2021-11-01T02:00:00 | 247f44b372c44205b59bfeacc2ea86bc | [{'rating': '0.402435', 'service': 'instance_up', 'desc': {'flavor_name': 'a2-ram4-disk20-perf1', 'id': |
| | | | '10736315-bd1a-406c-b90a-2f2fcce8674f', 'project_id': '247f44b372c44205b59bfeacc2ea86bc', 'tenant_id': |
| | | | '247f44b372c44205b59bfeacc2ea86bc'}, 'volume': '1', 'rate_value': '0.4024'}] |
| 2021-11-01T01:00:00 | 2021-11-01T02:00:00 | 247f44b372c44205b59bfeacc2ea86bc | [{'rating': '0.804869', 'service': 'instance_up', 'desc': {'flavor_name': 'a4-ram8-disk20-perf1', 'id': |
| | | | 'b8880e4e-9cb7-4419-b2cf-d20254ce53da', 'project_id': '247f44b372c44205b59bfeacc2ea86bc', 'tenant_id': |
| | | | '247f44b372c44205b59bfeacc2ea86bc'}, 'volume': '1', 'rate_value': '0.8049'}] |
+---------------------+---------------------+----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------
- Instance with id
10736315-bd1a-406c-b90a-2f2fcce8674f
is/was rated 0.4024 ICU/hour - Instance with id
b8880e4e-9cb7-4419-b2cf-d20254ce53da
is/was rated 0.8049 ICU/hour
Info
Please note the -r
argument, which is used here to filter on the 'instance_up' resource type.
This only shows rating for the VM running cost (reserved CPU/RAM), but does not include HDD/GPU, which are also billed
when the instance is not running and are thus rated under the 'instance_reserved' resource type.
So, to have a full breakdown of your compute costs, you have to add up both resource types.
Apart from instance resources, several other resource types exist, each rating different metrics for your infrastructure. Here's a snippet to find out about all your project's used resource types, again using some jq :
$ openstack rating dataframes get -c Resources -f json | jq -r 'map(.Resources | map(.service)) | flatten | unique | .[]'
image.size
instance_reserved
instance_up
ip.floating
network.ports.ext-net1
network.ports.router-gw-ext-floating1
storage.objects.size
volume.size
Get resources usage for the past 30 days
$ openstack usage show
Usage from 2021-04-21 to 2021-05-20 on project 0c92a99218894f148b297bf539ce521a:
+---------------+------------+
| Field | Value |
+---------------+------------+
| CPU Hours | 999.54 |
| Disk GB-Hours | 13581.45 |
| RAM MB-Hours | 2047067.84 |
| Servers | 41 |
+---------------+------------+
Display Available Metrics
Metrics are available for all types of resources: VM instances, volumes, floating IP addresses, or anything else...
You can either display all available metrics in your project (and grep
what you're looking for).
$ # The column "resource_id" corresponds to the id of your VM instance or volume or floating IP, etc...
$ # In this example we only want the metrics for the VM instance with ID "36886229-f6f0-4784-a389-e78feab9b42a"
$ openstack metric list | grep "36886229-f6f0-4784-a389-e78feab9b42a"
| 460f10c7-2d5c-44e9-bd8c-3c8f4a4fe15c | ik-medium-rate | disk.ephemeral.size | GB | 36886229-f6f0-4784-a389-e78feab9b42a |
| 67ad4165-0e79-4dd8-8a8c-83c6c74e176b | ik-medium-rate | memory | MB | 36886229-f6f0-4784-a389-e78feab9b42a |
| 687c8882-86a9-46bb-9f3c-229636a0a222 | ik-medium-rate | memory.usage | MB | 36886229-f6f0-4784-a389-e78feab9b42a |
| 6fce8350-e606-4dbc-85dd-1a6df0edfb54 | ik-medium-rate | vcpus | vcpu | 36886229-f6f0-4784-a389-e78feab9b42a |
| dd88f6f3-400a-47eb-b633-69d55f356206 | ik-medium-rate | disk.root.size | GB | 36886229-f6f0-4784-a389-e78feab9b42a |
| e3aebc62-77d9-4516-a49a-2580686575e3 | ik-medium-rate | cpu | ns | 36886229-f6f0-4784-a389-e78feab9b42a |
| fe4f55e9-9603-4b66-9719-107b349f3f14 | ik-medium-rate | compute.instance.booting.time | sec | 36886229-f6f0-4784-a389-e78feab9b42a |
Or display available metrics for a specific resource:
$ openstack metric resource show 36886229-f6f0-4784-a389-e78feab9b42a -c metrics
+---------+---------------------------------------------------------------------+
| Field | Value |
+---------+---------------------------------------------------------------------+
| metrics | compute.instance.booting.time: fe4f55e9-9603-4b66-9719-107b349f3f14 |
| | cpu: e3aebc62-77d9-4516-a49a-2580686575e3 |
| | disk.ephemeral.size: 460f10c7-2d5c-44e9-bd8c-3c8f4a4fe15c |
| | disk.root.size: dd88f6f3-400a-47eb-b633-69d55f356206 |
| | memory.usage: 687c8882-86a9-46bb-9f3c-229636a0a222 |
| | memory: 67ad4165-0e79-4dd8-8a8c-83c6c74e176b |
| | vcpus: 6fce8350-e606-4dbc-85dd-1a6df0edfb54 |
+---------+---------------------------------------------------------------------+
Warning
Sometimes there are multiple resources for a given instance (for example a VM and its volume), so metrics can be linked to another resource than your instance id. In this case, you can use the search function:
$ # notice the "%" after the instance id in the search
$ openstack metric resource search "original_resource_id like '36886229-f6f0-4784-a389-e78feab9b42a%'"
+--------------------------------------+---------------+----------------------------------+----------------------------------+------------------------------------------+----------------------------------+----------+----------------------------------+--------------+-------------------------------------------------------------------+
| id | type | project_id | user_id | original_resource_id | started_at | ended_at | revision_start | revision_end | creator |
+--------------------------------------+---------------+----------------------------------+----------------------------------+------------------------------------------+----------------------------------+----------+----------------------------------+--------------+-------------------------------------------------------------------+
| 33d60f84-ce92-5dd8-a9bd-971bc221543d | instance_disk | d1440aa24a65411fb9bac2b842c8defa | 153855c4fa1b4415bdd768f88c559f72 | 36886229-f6f0-4784-a389-e78feab9b42a-vda | 2021-04-29T07:15:19.775934+00:00 | None | 2021-04-29T07:15:19.775950+00:00 | None | 35b89d95e2504576866fa01215247181:d1860cf28a264c6c8bbf0b5468c9b9c8 |
| 36886229-f6f0-4784-a389-e78feab9b42a | instance | d1440aa24a65411fb9bac2b842c8defa | 153855c4fa1b4415bdd768f88c559f72 | 36886229-f6f0-4784-a389-e78feab9b42a | 2021-04-29T07:12:06.362575+00:00 | None | 2021-04-29T08:00:26.396108+00:00 | None | 35b89d95e2504576866fa01215247181:d1860cf28a264c6c8bbf0b5468c9b9c8 |
+--------------------------------------+---------------+----------------------------------+----------------------------------+------------------------------------------+----------------------------------+----------+----------------------------------+--------------+-------------------------------------------------------------------+
Display Measures
Once you identified the metric you are interested in, you can display its measures. For example to display vcpus
metric of our instance 36886229-f6f0-4784-a389-e78feab9b42a
:
$ openstack metric measures show 6fce8350-e606-4dbc-85dd-1a6df0edfb54
+---------------------------+-------------+-------+
| timestamp | granularity | value |
+---------------------------+-------------+-------+
| 2021-04-29T06:00:00+00:00 | 21600.0 | 2.0 |
| 2021-04-29T12:00:00+00:00 | 21600.0 | 1.4 |
| 2021-04-29T18:00:00+00:00 | 21600.0 | 1.0 |
| 2021-04-30T00:00:00+00:00 | 21600.0 | 1.0 |
| 2021-04-30T06:00:00+00:00 | 21600.0 | 1.0 |
| 2021-04-30T12:00:00+00:00 | 21600.0 | 1.0 |
| 2021-04-29T07:00:00+00:00 | 3600.0 | 1.0 |
| 2021-04-29T08:00:00+00:00 | 3600.0 | 1.0 |
...
| 2021-04-30T11:00:00+00:00 | 3600.0 | 1.0 |
| 2021-04-30T12:00:00+00:00 | 3600.0 | 1.0 |
| 2021-04-29T09:00:00+00:00 | 300.0 | 1.0 |
| 2021-04-29T10:00:00+00:00 | 300.0 | 1.0 |
...
| 2021-04-30T11:00:00+00:00 | 300.0 | 1.0 |
| 2021-04-30T12:00:00+00:00 | 300.0 | 1.0 |
+---------------------------+-------------+-------+
The granularity varies over time, according to the archive policy of the metric (see next section).
Tip
There is a shortcut if you don't know the metric's id:
$ openstack metric measures show --resource-id 36886229-f6f0-4784-a389-e78feab9b42a vcpus
+---------------------------+-------------+-------+
| timestamp | granularity | value |
+---------------------------+-------------+-------+
| 2021-04-29T06:00:00+00:00 | 21600.0 | 2.0 |
...
| 2021-04-30T12:00:00+00:00 | 300.0 | 1.0 |
+---------------------------+-------------+-------+
You can also resample measures if you prefer to get a daily usage for example:
$ openstack metric measures show --start 2021-03-08T00:00:00 --granularity 3600 --resample 86400 --resource-id 3fa780c7-3897-4fd2-a177-120bc2a94b65 vcpus
+---------------------------+-------------+--------------------+
| timestamp | granularity | value |
+---------------------------+-------------+--------------------+
| 2021-03-08T01:00:00+01:00 | 86400.0 | 1.2285714285714284 |
| 2021-03-09T01:00:00+01:00 | 86400.0 | 1.0 |
| 2021-03-10T01:00:00+01:00 | 86400.0 | 1.0 |
+---------------------------+-------------+--------------------+
Archive Policy
All metrics are stored according to the ik-medium-rate
policy:
$ openstack metric archive-policy show ik-medium-rate
+---------------------+-------------------------------------------------------------------+
| Field | Value |
+---------------------+-------------------------------------------------------------------+
| aggregation_methods | mean, rate:mean, std, count, max, min, sum |
| back_window | 0 |
| definition | - timespan: 62 days, 0:00:00, granularity: 1:00:00, points: 1488 |
| | - timespan: 732 days, 0:00:00, granularity: 6:00:00, points: 2928 |
| | - timespan: 7 days, 0:00:00, granularity: 0:05:00, points: 2016 |
| name | ik-medium-rate |
+---------------------+-------------------------------------------------------------------+