Title: [cloud_usage] vm_instance_id is null for volume usage (usage_type = 6) · Issue #10985 · apache/cloudstack · GitHub
Open Graph Title: [cloud_usage] vm_instance_id is null for volume usage (usage_type = 6) · Issue #10985 · apache/cloudstack
X Title: [cloud_usage] vm_instance_id is null for volume usage (usage_type = 6) · Issue #10985 · apache/cloudstack
Description: 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 w...
Open Graph Description: 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 inaccuracie...
X Description: 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 inaccuracie...
Opengraph URL: https://github.com/apache/cloudstack/issues/10985
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[cloud_usage] vm_instance_id is null for volume usage (usage_type = 6)","articleBody":"### problem\n\nWhen 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.\n\nExpected Behavior: ACS should record the correct `vm_instance_id` associated with a volume when usage occurs and store it in the `cloud_usage` table.\n\n### versions\n\nThe ACS version is 4.19.1.1\n\n### The steps to reproduce the bug\n\nCase 1:\n\n1. Create and attach a volume to VM.\n2. Use the VM for some time (allow usage data to be generated).\n3. Observe that cloud_usage.vm_instance_id is still NULL for this VM.\n\nCase 2:\n\n1. Create and attach a volume to VM A.\n2. Use the VM for some time (allow usage data to be generated).\n3. Detach the volume and attach it to VM B.\n4. Trigger a reprocessing of usage data for the original time period.\n5. Observe that cloud_usage.vm_instance_id is still NULL.\n\n### What to do about it?\n\nConsider enhancing the ACS `UsageManagerImpl` or submitting a patch upstream to ensure `vm_instance_id` is consistently captured and stored when usage is recorded.\n\nMy 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.","author":{"url":"https://github.com/Yuliia7-1","@type":"Person","name":"Yuliia7-1"},"datePublished":"2025-06-06T19:01:56.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/10985/cloudstack/issues/10985"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:bdba902b-5f49-2627-afb5-77bc7f0b9eb8 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8236:1485C9:C3B7E2:10DBF13:6A4DCBE6 |
| html-safe-nonce | b7d9099b000222a80fb5762087f60a21447c2f77869ae895abb62bb68dae3a4f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjM2OjE0ODVDOTpDM0I3RTI6MTBEQkYxMzo2QTREQ0JFNiIsInZpc2l0b3JfaWQiOiI1ODM5MzAyMDc4NDUxNTM0ODIzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | f66a94601c17d5238969a33c91f650536241152c80672aff9ade5d4f14f4366c |
| hovercard-subject-tag | issue:3125627478 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/10985/issue_layout |
| twitter:image | https://opengraph.githubassets.com/986906a42c9ea121ce7dc7e3c298a9d8c7299f7002a56d12e36fccfdc44e5bf8/apache/cloudstack/issues/10985 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/986906a42c9ea121ce7dc7e3c298a9d8c7299f7002a56d12e36fccfdc44e5bf8/apache/cloudstack/issues/10985 |
| og:image:alt | 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 inaccuracie... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Yuliia7-1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/apache/cloudstack git https://github.com/apache/cloudstack.git |
| octolytics-dimension-user_id | 47359 |
| octolytics-dimension-user_login | apache |
| octolytics-dimension-repository_id | 9759448 |
| octolytics-dimension-repository_nwo | apache/cloudstack |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 9759448 |
| octolytics-dimension-repository_network_root_nwo | apache/cloudstack |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width