[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-6669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14020334#comment-14020334
 ] 

Olivier Lemasle commented on CLOUDSTACK-6669:
---------------------------------------------

The previous patch enables the support of volume resize in 
cloud_usage.usage_volume (resize events are correctly handled).

But VolumeUsageParser has not been updated, and usages are wrongly consolidated 
in table cloud_usage.

Example with a data volume created as a "Custom Disk" with 1 GB, resized twice 
(to 3 GB and 8 GB), and then assigned to an other disk offering with 20 GB.

All these steps are correctly recorded in usage_volume:
{noformat}
mysql> select * from usage_volume where id = 6;
+----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
| id | zone_id | account_id | domain_id | disk_offering_id | template_id | size 
       | created             | deleted             |
+----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
|  6 |       1 |          2 |         1 |                6 |        NULL |  
1073741824 | 2014-06-06 19:57:55 | 2014-06-06 20:04:36 |
|  6 |       1 |          2 |         1 |                6 |        NULL |  
3221225472 | 2014-06-06 20:04:36 | 2014-06-06 20:08:10 |
|  6 |       1 |          2 |         1 |                6 |        NULL |  
8589934592 | 2014-06-06 20:08:10 | 2014-06-06 20:20:42 |
|  6 |       1 |          2 |         1 |                4 |        NULL | 
21474836480 | 2014-06-06 20:20:42 | NULL                |
+----+---------+------------+-----------+------------------+-------------+-------------+---------------------+---------------------+
{noformat}

but consolidation shows the last state only for each period:

{noformat}
mysql> select description, raw_usage, offering_id, size, start_date, end_date 
from cloud_usage where usage_id=6 and usage_type = 6;
+-------------------------------------------+-------------------+-------------+-------------+---------------------+---------------------+
| description                               | raw_usage         | offering_id | 
size        | start_date          | end_date            |
+-------------------------------------------+-------------------+-------------+-------------+---------------------+---------------------+
| Volume Id: 6 usage time (DiskOffering: 6) |  0.13330389559269 |           6 | 
 3221225472 | 2014-06-06 19:55:54 | 2014-06-06 20:05:54 |
| Volume Id: 6 usage time (DiskOffering: 6) | 0.166662782430649 |           6 | 
 8589934592 | 2014-06-06 20:05:54 | 2014-06-06 20:15:54 |
| Volume Id: 6 usage time (DiskOffering: 4) | 0.166667491197586 |           4 | 
21474836480 | 2014-06-06 20:15:54 | 2014-06-06 20:25:54 |
+-------------------------------------------+-------------------+-------------+-------------+---------------------+---------------------+
{noformat}

> Support volume resize in usage server
> -------------------------------------
>
>                 Key: CLOUDSTACK-6669
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-6669
>             Project: CloudStack
>          Issue Type: Bug
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>            Reporter: Kishan Kavala
>            Assignee: Rajani Karuturi
>            Priority: Critical
>             Fix For: 4.4.0
>
>
> volume resize events are generated in usgae_events tables.
> Support to process them and update the usage records has to be added to usage 
> server



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to