Ubuntu 22.04
Sponsored Link

OpenStack Caracal : How to use CloudKitty2024/04/11

 
This is how to use OpenStack Rating Service (CloudKitty).
This example is based on the environment like follows.
------------+--------------------------+--------------------------+------------
            |                          |                          |
        eth0|10.0.0.30             eth0|10.0.0.50             eth0|10.0.0.51
+-----------+-----------+  +-----------+-----------+  +-----------+-----------+
|   [ dlp.srv.world ]   |  | [ network.srv.world ] |  |  [ node01.srv.world ] |
|     (Control Node)    |  |     (Network Node)    |  |     (Compute Node)    |
|                       |  |                       |  |                       |
|  MariaDB    RabbitMQ  |  |  Neutron L2/L3 Agent  |  |        Libvirt        |
|  Memcached  Nginx     |  |   Neutron Metadata    |  |      Nova Compute     |
|  Keystone   httpd     |  |     Open vSwitch      |  |    Neutron L2 Agent   |
|  Glance     Nova API  |  |     iSCSI Target      |  |      Open vSwitch     |
|  Neutron Server       |  |     Cinder Volume     |  |   Ceilometer Compute  |
|  Neutron Metadata     |  |     httpd  Gnocchi    |  |                       |
|  Cinder API           |  |   Ceilometer Central  |  |                       |
|                       |  |     CloudKitty API    |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[1] Add [cloudkitty] user in [rating] role for each project that you like to rate.
root@dlp ~(keystone)#
openstack project list

+----------------------------------+-----------+
| ID                               | Name      |
+----------------------------------+-----------+
| 2bcdd2fecf1d4a8c8faf87f1232cf365 | hiroshima |
| 62980715ee6d434eaf4efddd9b63e9d6 | admin     |
| c9a28e6f0f794ccf889c115bb9c2872c | service   |
+----------------------------------+-----------+

root@dlp ~(keystone)#
openstack role add --user cloudkitty --project hiroshima rating

[2] Enable [Hashmap] module.
root@dlp ~(keystone)#
openstack rating module list

+-----------+---------+----------+
| Module    | Enabled | Priority |
+-----------+---------+----------+
| hashmap   | False   |        1 |
| noop      | True    |        1 |
| pyscripts | False   |        1 |
+-----------+---------+----------+

root@dlp ~(keystone)#
openstack rating module enable hashmap

+---------+---------+----------+
| Module  | Enabled | Priority |
+---------+---------+----------+
| hashmap | True    |        1 |
+---------+---------+----------+

root@dlp ~(keystone)#
openstack rating module list

+-----------+---------+----------+
| Module    | Enabled | Priority |
+-----------+---------+----------+
| hashmap   | True    |        1 |
| noop      | True    |        1 |
| pyscripts | False   |        1 |
+-----------+---------+----------+
[3] Set rate to Instance Uptime.
When users in the project set on [1] create and start instances with [flavor_id] you set, target project is charged at the rate you set every interval of the [period] you set in [cloudkitty.conf].
# add service matching rule

root@dlp ~(keystone)#
openstack rating hashmap service create instance

+----------+--------------------------------------+
| Name     | Service ID                           |
+----------+--------------------------------------+
| instance | 9e064c07-2d99-459e-b5f8-b0a8e4038a2e |
+----------+--------------------------------------+

# add field matching rule

root@dlp ~(keystone)#
openstack rating hashmap field create 9e064c07-2d99-459e-b5f8-b0a8e4038a2e flavor_id

+-----------+--------------------------------+---------------------------------+
| Name      | Field ID                       | Service ID                      |
+-----------+--------------------------------+---------------------------------+
| flavor_id | 21918f30-db40-4187-8bb2-       | 9e064c07-2d99-459e-b5f8-        |
|           | d034b2511c59                   | b0a8e4038a2e                    |
+-----------+--------------------------------+---------------------------------+

root@dlp ~(keystone)#
openstack flavor list

+----+-----------+------+------+-----------+-------+-----------+
| ID | Name      |  RAM | Disk | Ephemeral | VCPUs | Is Public |
+----+-----------+------+------+-----------+-------+-----------+
| 1  | m1.tiny   | 2048 |   10 |         0 |     1 | True      |
| 2  | m1.small  | 4096 |   10 |         0 |     2 | True      |
| 3  | m1.medium | 8192 |   10 |         0 |     4 | True      |
| 4  | m2.medium | 8192 |   10 |        10 |     4 | True      |
+----+-----------+------+------+-----------+-------+-----------+

# add mapping rule
# set a cost of [0.5] to instances with [flavor_id] = [2]
root@dlp ~(keystone)# openstack rating hashmap mapping create 0.5 \
--field-id 21918f30-db40-4187-8bb2-d034b2511c59 \
--value 2 -t flat 
+------------+-------+----------+------+----------+------------+----------+------------+
| Mapping ID | Value | Cost     | Type | Field ID | Service ID | Group ID | Project ID |
+------------+-------+----------+------+----------+------------+----------+------------+
| a8b18a85-  | 2     | 0.500000 | flat | 21918f30 | None       | None     | None       |
| 836e-4ad4- |       | 00000000 |      | -db40-   |            |          |            |
| afb8-      |       | 00000000 |      | 4187-    |            |          |            |
| 0888bf6bc3 |       | 000000   |      | 8bb2-    |            |          |            |
| 45         |       |          |      | d034b251 |            |          |            |
|            |       |          |      | 1c59     |            |          |            |
+------------+-------+----------+------+----------+------------+----------+------------+
[4] Verify settings with an user who is in the project you set on [1] to create or start an instance.
ubuntu@dlp ~(keystone)$
openstack server list

+--------------+-------------+---------+--------------+------------+----------+
| ID           | Name        | Status  | Networks     | Image      | Flavor   |
+--------------+-------------+---------+--------------+------------+----------+
| e7feb65c-    | Ubuntu-2204 | SHUTOFF | private=10.0 | Ubuntu2204 | m1.small |
| 1482-48a9-   |             |         | .0.250, 192. |            |          |
| 9d45-        |             |         | 168.100.188  |            |          |
| e74196a5ea92 |             |         |              |            |          |
+--------------+-------------+---------+--------------+------------+----------+

ubuntu@dlp ~(keystone)$
openstack server start Ubuntu-2204
# after a certain period of time, costs are charged

ubuntu@dlp ~(keystone)$
openstack rating summary get

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 2bcdd2fecf1d4a8 | ALL           | 0.5  | 2024-04-        | 2024-05-        |
| c8faf87f1232cf3 |               |      | 01T00:00:00     | 01T00:00:00     |
| 65              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

# if the instance continues to run, costs are charged every [period] of time

ubuntu@dlp ~(keystone)$
openstack rating summary get

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 2bcdd2fecf1d4a8 | ALL           | 1.0  | 2024-04-        | 2024-05-        |
| c8faf87f1232cf3 |               |      | 01T00:00:00     | 01T00:00:00     |
| 65              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

# display data frames

ubuntu@dlp ~(keystone)$
openstack rating dataframes get

+------------------+------------------+------------------+---------------------+
| Begin            | End              | Project ID       | Resources           |
+------------------+------------------+------------------+---------------------+
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T04:20:00      | 11T04:30:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:00:00      | 11T05:10:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T05:00:00      | 11T05:10:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:10:00      | 11T05:20:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T05:10:00      | 11T05:20:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
+------------------+------------------+------------------+---------------------+
[5] Set rate to Volume Size.
When users in the project set on [1] create cinder volumes, target project is charged at the rate you set per gigabyte.
# add service matching rule

root@dlp ~(keystone)#
openstack rating hashmap service create volume.size

+-------------+--------------------------------------+
| Name        | Service ID                           |
+-------------+--------------------------------------+
| volume.size | 47bc0c48-ec95-4ade-8ae7-2cdb6ada40b9 |
+-------------+--------------------------------------+

# add mapping rule
# set a cost of [1.5] per gigabyte
root@dlp ~(keystone)# openstack rating hashmap mapping create 1.5 \
-s 47bc0c48-ec95-4ade-8ae7-2cdb6ada40b9 \
-t flat 
+------------+-------+----------+------+----------+------------+----------+------------+
| Mapping ID | Value | Cost     | Type | Field ID | Service ID | Group ID | Project ID |
+------------+-------+----------+------+----------+------------+----------+------------+
| 9535b73b-  | None  | 1.500000 | flat | None     | 47bc0c48-  | None     | None       |
| 5448-4ca7- |       | 00000000 |      |          | ec95-4ade- |          |            |
| 8868-      |       | 00000000 |      |          | 8ae7-      |          |            |
| 51021a9217 |       | 000000   |      |          | 2cdb6ada40 |          |            |
| c9         |       |          |      |          | b9         |          |            |
+------------+-------+----------+------+----------+------------+----------+------------+

# set a 10% discount on over 30 GB volumes
root@dlp ~(keystone)# openstack rating hashmap threshold create 30 0.90 \
-s 47bc0c48-ec95-4ade-8ae7-2cdb6ada40b9 \
-t rate 
+--------------+----------+----------+------+----------+------------+----------+------------+
| Threshold ID | Level    | Cost     | Type | Field ID | Service ID | Group ID | Project ID |
+--------------+----------+----------+------+----------+------------+----------+------------+
| ac6d6eb9-    | 30.00000 | 0.900000 | rate | None     | 47bc0c48-  | None     | None       |
| ee24-493f-   | 000      | 00000000 |      |          | ec95-4ade- |          |            |
| 938d-        |          | 00222044 |      |          | 8ae7-      |          |            |
| 9310d2dd87be |          | 604925   |      |          | 2cdb6ada40 |          |            |
|              |          |          |      |          | b9         |          |            |
+--------------+----------+----------+------+----------+------------+----------+------------+
[6] Verify settings with an user who is in the project you set on [1] to create volumes.
ubuntu@dlp ~(keystone)$
openstack rating summary get

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 2bcdd2fecf1d4a8 | ALL           | 1.5  | 2024-04-        | 2024-05-        |
| c8faf87f1232cf3 |               |      | 01T00:00:00     | 01T00:00:00     |
| 65              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

ubuntu@dlp ~(keystone)$ openstack volume create --size 10 disk01 

ubuntu@dlp ~(keystone)$
openstack volume list

+------------------------------------+--------+-----------+------+-------------+
| ID                                 | Name   | Status    | Size | Attached to |
+------------------------------------+--------+-----------+------+-------------+
| 5a4ed269-ab3d-4d10-b5f0-           | disk01 | available |   10 |             |
| ef2722664b40                       |        |           |      |             |
+------------------------------------+--------+-----------+------+-------------+

# after a certain period of time, costs are charged

ubuntu@dlp ~(keystone)$
openstack rating summary get

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 2bcdd2fecf1d4a8 | ALL           | 16.5 | 2024-04-        | 2024-05-        |
| c8faf87f1232cf3 |               |      | 01T00:00:00     | 01T00:00:00     |
| 65              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

ubuntu@dlp ~(keystone)$
openstack rating dataframes get

+------------------+------------------+------------------+---------------------+
| Begin            | End              | Project ID       | Resources           |
+------------------+------------------+------------------+---------------------+
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T04:20:00      | 11T04:30:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:00:00      | 11T05:10:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T05:00:00      | 11T05:10:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:10:00      | 11T05:20:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T05:10:00      | 11T05:20:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:20:00      | 11T05:30:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '15.0', |
| 11T05:20:00      | 11T05:30:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '1.5000'}]          |
+------------------+------------------+------------------+---------------------+

ubuntu@dlp ~(keystone)$
openstack volume create --size 30 disk02

ubuntu@dlp ~(keystone)$
openstack volume list

+------------------------------------+--------+-----------+------+-------------+
| ID                                 | Name   | Status    | Size | Attached to |
+------------------------------------+--------+-----------+------+-------------+
| 4d93db47-f90b-4b2d-bc8d-           | disk02 | available |   30 |             |
| f103a1253e18                       |        |           |      |             |
| 5a4ed269-ab3d-4d10-b5f0-           | disk01 | available |   10 |             |
| ef2722664b40                       |        |           |      |             |
+------------------------------------+--------+-----------+------+-------------+

# after a certain period of time, costs are charged
# 1.5 x 30 x 0.9 = 40.5

ubuntu@dlp ~(keystone)$
openstack rating summary get

+----------------+---------------+------+----------------+-------------------+
| Tenant ID      | Resource Type | Rate | Begin Time     | End Time          |
+----------------+---------------+------+----------------+-------------------+
| 2bcdd2fecf1d4a | ALL           | 57.0 | 2024-04-       | 2024-05-          |
| 8c8faf87f1232c |               |      | 01T00:00:00    | 01T00:00:00       |
| f365           |               |      |                |                   |
+----------------+---------------+------+----------------+-------------------+

ubuntu@dlp ~(keystone)$
openstack rating dataframes get

+------------------+------------------+------------------+---------------------+
| Begin            | End              | Project ID       | Resources           |
+------------------+------------------+------------------+---------------------+
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T04:20:00      | 11T04:30:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:00:00      | 11T05:10:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T05:00:00      | 11T05:10:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:10:00      | 11T05:20:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.0',  |
| 11T05:10:00      | 11T05:20:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '0.5',  |
| 11T05:20:00      | 11T05:30:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | 'e7feb65c-1482-     |
|                  |                  |                  | 48a9-9d45-          |
|                  |                  |                  | e74196a5ea92',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '15.0', |
| 11T05:20:00      | 11T05:30:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'ae09164d-    |
|                  |                  |                  | dcdb-4af1-ba6c-     |
|                  |                  |                  | 41c9e30a6e82',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '1.5000'}]          |
| 2024-04-         | 2024-04-         | 2bcdd2fecf1d4a8c | [{'rating': '40.5', |
| 11T05:40:00      | 11T05:50:00      | 8faf87f1232cf365 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': '4d93db47-    |
|                  |                  |                  | f90b-4b2d-bc8d-     |
|                  |                  |                  | f103a1253e18',      |
|                  |                  |                  | 'project_id': '2bcd |
|                  |                  |                  | d2fecf1d4a8c8faf87f |
|                  |                  |                  | 1232cf365',         |
|                  |                  |                  | 'user_id': 'e682843 |
|                  |                  |                  | 492a44937b745ef945b |
|                  |                  |                  | facf70',            |
|                  |                  |                  | 'tenant_id': '2bcdd |
|                  |                  |                  | 2fecf1d4a8c8faf87f1 |
|                  |                  |                  | 232cf365'},         |
|                  |                  |                  | 'volume': '3E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '1.3500'}]          |
+------------------+------------------+------------------+---------------------+
Matched Content