Skip to content

[cloud_usage] vm_instance_id is null for volume usage (usage_type = 6) #10985

@Yuliia7-1

Description

@Yuliia7-1

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions