Skip to content

Storage capacity check does not consider the VM snapshot of DATADISK #8054

@weizhouapache

Description

@weizhouapache

as title

steps to reproduce the issue

  1. create vm with root and data disk
  2. check storage pool usage
  3. create vm snapshot
  4. check storage pool usage again

expected: both root and data disk size are considered
actual: only root disk size is considered

it seems to be caused by the line sc.setParameters("vType", Volume.Type.ROOT.toString()); in code

@Override
    public long getVMSnapshotSizeByPool(long poolId) {
        SearchCriteria<SumCount> sc = TotalVMSnapshotSizeByPoolSearch.create();
        sc.setParameters("poolId", poolId);
        sc.setParameters("state", State.Destroy);
        sc.setParameters("vType", Volume.Type.ROOT.toString());
        List<SumCount> results = customSearch(sc, null);
        if (results != null) {
            return results.get(0).sum;
        } else {
            return 0;
        }
    }

sc.setParameters("vType", Volume.Type.ROOT.toString());

ISSUE TYPE
  • Bug Report
COMPONENT NAME

CLOUDSTACK VERSION

CONFIGURATION
OS / ENVIRONMENT
SUMMARY
STEPS TO REPRODUCE

EXPECTED RESULTS

ACTUAL RESULTS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions