Yuliia7-1 opened a new issue, #10985: URL: https://github.com/apache/cloudstack/issues/10985
### problem When tracking volume usage in the `cloud_usage` table` (usage_type = 6)`, the `vm_instance_id` field is `NULL`, even if the volume is currently attached to a VM. This leads to potential inaccuracies in historical usage data, especially when volumes are detached and reattached to different VMs. Expected Behavior: ACS should record the correct `vm_instance_id` associated with a volume when usage occurs and store it in the `cloud_usage` table. ### versions The ACS version is 4.19.1.1 ### The steps to reproduce the bug Case 1: 1. Create and attach a volume to VM. 2. Use the VM for some time (allow usage data to be generated). 3. Observe that cloud_usage.vm_instance_id is still NULL for this VM. Case 2: 1. Create and attach a volume to VM A. 2. Use the VM for some time (allow usage data to be generated). 3. Detach the volume and attach it to VM B. 4. Trigger a reprocessing of usage data for the original time period. 5. Observe that cloud_usage.vm_instance_id is still NULL. ### What to do about it? Consider enhancing the ACS `UsageManagerImpl` or submitting a patch upstream to ensure `vm_instance_id` is consistently captured and stored when usage is recorded. My goal is to accurately track historical usage of volumes in relation to the VMs they were attached to. To achieve this and mitigate the issue of missing `vm_instance_id` values for` usage_type =` 6 in the `cloud_usage` table. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
