[ https://issues.apache.org/jira/browse/CLOUDSTACK-3857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13724478#comment-13724478 ]
Min Chen commented on CLOUDSTACK-3857: -------------------------------------- Fixed by restoring 4.1 behavior, create VOLUME_CREATE event at CreateVolumeCmd, not in AttachVolumeCmd. > [Object_Store_Refactor][Usage] Two VOLUME_CREATE usage events are generated > for one data disk after creating and attaching to VM > -------------------------------------------------------------------------------------------------------------------------------- > > Key: CLOUDSTACK-3857 > URL: https://issues.apache.org/jira/browse/CLOUDSTACK-3857 > Project: CloudStack > Issue Type: Bug > Security Level: Public(Anyone can view this level - this is the > default.) > Components: Usage > Affects Versions: 4.2.0 > Environment: Latest build from ACS 4.2 branch > Reporter: Sanjeev N > Assignee: Min Chen > Priority: Critical > Fix For: 4.2.0 > > > Two VOLUME_CREATE usage events are generated for one data disk after creating > and attaching to VM. > After creating data disk one VOLUME_CREATE event was created and after > attaching to guest vm another VOLUME_CREATE event was created for the same > resource. > Steps to Reproduce: > =============== > 1.Bring up CS with at-least one cluster > 2.Bring up guest vm using default cent of template with root disk > 3.Create a data disk > 4.Attach it to guest vm > Observations: > =========== > Observed two usage events created for the same volume, hence user will be > charged twice for the single volume. > DB entries for the volume and usage event are as follows: > mysql> select * from volumes where id=18\G; > *************************** 1. row *************************** > id: 18 > account_id: 2 > domain_id: 1 > pool_id: 1 > last_pool_id: NULL > instance_id: 6 > device_id: 1 > name: custom-xen > uuid: 0a21f006-28c9-4488-94e2-90e4fbee4fd6 > size: 5368709120 > folder: NULL > path: ae7cd16b-6116-4b60-b198-ba52fee00b2b > pod_id: NULL > data_center_id: 1 > iscsi_name: NULL > host_ip: NULL > volume_type: DATADISK > pool_type: NULL > disk_offering_id: 3 > template_id: NULL > first_snapshot_backup_uuid: NULL > recreatable: 0 > created: 2013-07-26 13:08:59 > attached: 2013-07-26 13:09:58 > updated: 2013-07-26 13:09:58 > removed: NULL > state: Ready > chain_info: NULL > update_count: 2 > disk_type: NULL > display_volume: 1 > format: VHD > min_iops: NULL > max_iops: NULL > 1 row in set (0.00 sec) > ERROR: > No query specified > mysql> select * from usage_event where id in (43,44)\G; > *************************** 1. row *************************** > id: 43 > type: VOLUME.CREATE > account_id: 2 > created: 2013-07-26 13:08:59 > zone_id: 1 > resource_id: 18 > resource_name: custom-xen > offering_id: 3 > template_id: NULL > size: 5368709120 > resource_type: NULL > processed: 0 > virtual_size: NULL > *************************** 2. row *************************** > id: 44 > type: VOLUME.CREATE > account_id: 2 > created: 2013-07-26 13:09:57 > zone_id: 1 > resource_id: 18 > resource_name: custom-xen > offering_id: 3 > template_id: NULL > size: 5368709120 > resource_type: NULL > processed: 0 > virtual_size: NULL > 2 rows in set (0.00 sec) > ERROR: > No query specified > Filing it as a critical bug based on the assumption that user will be charged > twice, if that is not the case priority can be lowered. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira