Ubuntu 24.04
Sponsored Link

OpenStack Caracal : CloudKitty 利用方法2024/05/23

 

OpenStack Rating Service (CloudKitty) の利用方法です。

当例では以下のような環境を例に CloudKitty をインストールしています。

------------+--------------------------+--------------------------+------------
            |                          |                          |
        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] レートを設定したい各々のプロジェクトで、[cloudkitty] ユーザーを [rating] ロールに追加しておきます。
root@dlp ~(keystone)#
openstack project list

+----------------------------------+-----------+
| ID                               | Name      |
+----------------------------------+-----------+
| 18ede7365bdc430093e8fd4a90f77369 | hiroshima |
| 9c5145f76fd84324bdd2b1b61658a282 | admin     |
| ab9749e59bdb48e4807a18abb83c9f99 | service   |
+----------------------------------+-----------+

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

[2] [Hashmap] モジュールを有効にします。
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] Instance Uptime にレートを設定します。
[1] で設定したプロジェクト所属ユーザーが、設定した [flavor_id] でインスタンスを起動した場合、[cloudkitty.conf] で設定した [period] の間隔毎に、設定したレートで課金されます。
# サービス マッチング ルールを追加

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

+----------+--------------------------------------+
| Name     | Service ID                           |
+----------+--------------------------------------+
| instance | bcf7fd50-df0c-448f-b156-d9df88bc01a0 |
+----------+--------------------------------------+

# フィールド マッチング ルールを追加

root@dlp ~(keystone)#
openstack rating hashmap field create bcf7fd50-df0c-448f-b156-d9df88bc01a0 flavor_id

+-----------+--------------------------------+---------------------------------+
| Name      | Field ID                       | Service ID                      |
+-----------+--------------------------------+---------------------------------+
| flavor_id | 01d3df54-63d2-45e7-bd82-       | bcf7fd50-df0c-448f-b156-        |
|           | 7ca034f1e712                   | d9df88bc01a0                    |
+-----------+--------------------------------+---------------------------------+

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      |
+----+-----------+------+------+-----------+-------+-----------+

# マッピングを作成
# [flavor_id] が [2] のインスタンスに [0.5] ドルのコストを設定
root@dlp ~(keystone)# openstack rating hashmap mapping create 0.5 \
--field-id 01d3df54-63d2-45e7-bd82-7ca034f1e712 \
--value 2 -t flat 
+------------+-------+----------+------+----------+------------+----------+------------+
| Mapping ID | Value | Cost     | Type | Field ID | Service ID | Group ID | Project ID |
+------------+-------+----------+------+----------+------------+----------+------------+
| 38f07b51-  | 2     | 0.500000 | flat | 01d3df54 | None       | None     | None       |
| 9a38-4af5- |       | 00000000 |      | -63d2-   |            |          |            |
| 880c-      |       | 00000000 |      | 45e7-    |            |          |            |
| 65c43b5bf3 |       | 000000   |      | bd82-    |            |          |            |
| d9         |       |          |      | 7ca034f1 |            |          |            |
|            |       |          |      | e712     |            |          |            |
+------------+-------+----------+------+----------+------------+----------+------------+
[4] [1] で CloudKitty と関連付けたプロジェクトに所属する任意の Openstack ユーザーで、インスタンスを操作して、動作確認します。
ubuntu@dlp ~(keystone)$
openstack server list

+--------------+-------------+---------+--------------+------------+----------+
| ID           | Name        | Status  | Networks     | Image      | Flavor   |
+--------------+-------------+---------+--------------+------------+----------+
| 7fbc24c1-    | Ubuntu-2404 | SHUTOFF | private=10.0 | Ubuntu2404 | m1.small |
| c0d1-43d6-   |             |         | .0.208, 192. |            |          |
| 87aa-        |             |         | 168.100.130  |            |          |
| 68df83597b57 |             |         |              |            |          |
+--------------+-------------+---------+--------------+------------+----------+

ubuntu@dlp ~(keystone)$
openstack server start Ubuntu-2404
# 一定時間経過後 レートが加算される

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

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 18ede7365bdc430 | ALL           | 0.5  | 2024-05-        | 2024-06-        |
| 093e8fd4a90f773 |               |      | 01T00:00:00     | 01T00:00:00     |
| 69              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

# インスタンス稼働中は [period] の間隔毎に 設定したレートがさらに課金される

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

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 18ede7365bdc430 | ALL           | 1.0  | 2024-05-        | 2024-06-        |
| 093e8fd4a90f773 |               |      | 01T00:00:00     | 01T00:00:00     |
| 69              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

# データフレーム表示

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

+------------------+------------------+------------------+---------------------+
| Begin            | End              | Project ID       | Resources           |
+------------------+------------------+------------------+---------------------+
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.0',  |
| 23T01:10:00      | 23T01:20:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.0',  |
| 23T01:30:00      | 23T01:40:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'f3515141-    |
|                  |                  |                  | 8e83-441d-b7e2-     |
|                  |                  |                  | 0136d8e1c0a7',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T01:50:00      | 23T02:00:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T02:00:00      | 23T02:10:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
+------------------+------------------+------------------+---------------------+
[5] Volume Size にレートを設定します。
[1] で設定したプロジェクト所属ユーザーが、Cinder ボリュームを作成した場合、1 GB 毎に、設定したレートで課金されます。
# サービス マッチング ルールを追加

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

+-------------+--------------------------------------+
| Name        | Service ID                           |
+-------------+--------------------------------------+
| volume.size | f5ef8afc-80d9-4ca4-9d9b-935359f4dab7 |
+-------------+--------------------------------------+

# マッピングを作成
# 1 GB 毎に [1.5] ドルのコストを設定
root@dlp ~(keystone)# openstack rating hashmap mapping create 1.5 \
-s f5ef8afc-80d9-4ca4-9d9b-935359f4dab7 \
-t flat 
+------------+-------+----------+------+----------+------------+----------+------------+
| Mapping ID | Value | Cost     | Type | Field ID | Service ID | Group ID | Project ID |
+------------+-------+----------+------+----------+------------+----------+------------+
| dff6593b-  | None  | 1.500000 | flat | None     | f5ef8afc-  | None     | None       |
| bdc9-42ec- |       | 00000000 |      |          | 80d9-4ca4- |          |            |
| a4f0-      |       | 00000000 |      |          | 9d9b-      |          |            |
| 864201dad2 |       | 000000   |      |          | 935359f4da |          |            |
| c8         |       |          |      |          | b7         |          |            |
+------------+-------+----------+------+----------+------------+----------+------------+

# 30 GB 以上のボリュームに対して [1.5] ドルのコスト設定から
# 10 % 引きのディスカウントを設定
root@dlp ~(keystone)# openstack rating hashmap threshold create 30 0.90 \
-s f5ef8afc-80d9-4ca4-9d9b-935359f4dab7 \
-t rate 
+--------------+----------+----------+------+----------+------------+----------+------------+
| Threshold ID | Level    | Cost     | Type | Field ID | Service ID | Group ID | Project ID |
+--------------+----------+----------+------+----------+------------+----------+------------+
| 7beb63cf-    | 30.00000 | 0.900000 | rate | None     | f5ef8afc-  | None     | None       |
| 9f66-4abe-   | 000      | 00000000 |      |          | 80d9-4ca4- |          |            |
| 9b01-        |          | 00222044 |      |          | 9d9b-      |          |            |
| 81cf81f04d17 |          | 604925   |      |          | 935359f4da |          |            |
|              |          |          |      |          | b7         |          |            |
+--------------+----------+----------+------+----------+------------+----------+------------+
[6] [1] で CloudKitty と関連付けたプロジェクトに所属する任意の Openstack ユーザーで、ボリュームを作成して、動作確認します。
ubuntu@dlp ~(keystone)$
openstack rating summary get

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 18ede7365bdc430 | ALL           | 1.5  | 2024-05-        | 2024-06-        |
| 093e8fd4a90f773 |               |      | 01T00:00:00     | 01T00:00:00     |
| 69              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

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

ubuntu@dlp ~(keystone)$
openstack volume list

+------------------------------------+--------+-----------+------+-------------+
| ID                                 | Name   | Status    | Size | Attached to |
+------------------------------------+--------+-----------+------+-------------+
| be53c7f4-7574-45cd-8020-           | disk01 | available |   10 |             |
| 1d09fcd47945                       |        |           |      |             |
+------------------------------------+--------+-----------+------+-------------+

# 一定時間経過後 レートが加算される

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

+-----------------+---------------+------+-----------------+-----------------+
| Tenant ID       | Resource Type | Rate | Begin Time      | End Time        |
+-----------------+---------------+------+-----------------+-----------------+
| 18ede7365bdc430 | ALL           | 16.5 | 2024-05-        | 2024-06-        |
| 093e8fd4a90f773 |               |      | 01T00:00:00     | 01T00:00:00     |
| 69              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

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

+------------------+------------------+------------------+---------------------+
| Begin            | End              | Project ID       | Resources           |
+------------------+------------------+------------------+---------------------+
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.0',  |
| 23T01:10:00      | 23T01:20:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.0',  |
| 23T01:30:00      | 23T01:40:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'f3515141-    |
|                  |                  |                  | 8e83-441d-b7e2-     |
|                  |                  |                  | 0136d8e1c0a7',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T01:50:00      | 23T02:00:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T02:00:00      | 23T02:10:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T02:10:00      | 23T02:20:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '15.0', |
| 23T03:20:00      | 23T03:30:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'be53c7f4-    |
|                  |                  |                  | 7574-45cd-8020-     |
|                  |                  |                  | 1d09fcd47945',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | '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 |
+------------------------------------+--------+-----------+------+-------------+
| c5a797ab-e638-4cb8-94bf-           | disk02 | available |   30 |             |
| 2fb185878626                       |        |           |      |             |
| be53c7f4-7574-45cd-8020-           | disk01 | available |   10 |             |
| 1d09fcd47945                       |        |           |      |             |
+------------------------------------+--------+-----------+------+-------------+

# 一定時間経過後 レートが加算される
# 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        |
+-----------------+---------------+------+-----------------+-----------------+
| 18ede7365bdc430 | ALL           | 57.0 | 2024-05-        | 2024-06-        |
| 093e8fd4a90f773 |               |      | 01T00:00:00     | 01T00:00:00     |
| 69              |               |      |                 |                 |
+-----------------+---------------+------+-----------------+-----------------+

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

+------------------+------------------+------------------+---------------------+
| Begin            | End              | Project ID       | Resources           |
+------------------+------------------+------------------+---------------------+
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.0',  |
| 23T01:10:00      | 23T01:20:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.0',  |
| 23T01:30:00      | 23T01:40:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'f3515141-    |
|                  |                  |                  | 8e83-441d-b7e2-     |
|                  |                  |                  | 0136d8e1c0a7',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.0000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T01:50:00      | 23T02:00:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T02:00:00      | 23T02:10:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '0.5',  |
| 23T02:10:00      | 23T02:20:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'instance', 'desc': |
|                  |                  |                  | {'flavor_name':     |
|                  |                  |                  | 'm1.small',         |
|                  |                  |                  | 'flavor_id': '2',   |
|                  |                  |                  | 'vcpus': '', 'id':  |
|                  |                  |                  | '7fbc24c1-c0d1-     |
|                  |                  |                  | 43d6-87aa-          |
|                  |                  |                  | 68df83597b57',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1',      |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '0.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '15.0', |
| 23T03:20:00      | 23T03:30:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'be53c7f4-    |
|                  |                  |                  | 7574-45cd-8020-     |
|                  |                  |                  | 1d09fcd47945',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '1E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '1.5000'}]          |
| 2024-05-         | 2024-05-         | 18ede7365bdc4300 | [{'rating': '40.5', |
| 23T03:20:00      | 23T03:30:00      | 93e8fd4a90f77369 | 'service':          |
|                  |                  |                  | 'volume.size',      |
|                  |                  |                  | 'desc':             |
|                  |                  |                  | {'volume_type':     |
|                  |                  |                  | '__DEFAULT__',      |
|                  |                  |                  | 'id': 'c5a797ab-    |
|                  |                  |                  | e638-4cb8-94bf-     |
|                  |                  |                  | 2fb185878626',      |
|                  |                  |                  | 'project_id': '18ed |
|                  |                  |                  | e7365bdc430093e8fd4 |
|                  |                  |                  | a90f77369',         |
|                  |                  |                  | 'user_id': 'b9371d0 |
|                  |                  |                  | 15e0d43dca74f291614 |
|                  |                  |                  | 48ffd2',            |
|                  |                  |                  | 'week_of_the_year': |
|                  |                  |                  | '20',               |
|                  |                  |                  | 'day_of_the_year':  |
|                  |                  |                  | '144', 'month':     |
|                  |                  |                  | '5', 'year':        |
|                  |                  |                  | '2024',             |
|                  |                  |                  | 'tenant_id': '18ede |
|                  |                  |                  | 7365bdc430093e8fd4a |
|                  |                  |                  | 90f77369'},         |
|                  |                  |                  | 'volume': '3E+1',   |
|                  |                  |                  | 'rate_value':       |
|                  |                  |                  | '1.3500'}]          |
+------------------+------------------+------------------+---------------------+
関連コンテンツ