Skip to content

Linstor primary storage: capacity is the sum of all nodes' storage pools, ignoring the resource group's replica count #14959

Backlog

Description

@brhellman

Problem

For Linstor primary storage, CloudStack reports as capacity the sum of the total capacity of every LINSTOR storage pool in the resource group's pool list, on every node. Each volume, however, is stored on place_count nodes of the resource group, so the real capacity is about the sum divided by the replica count (and a single volume can be no larger than one node's pool). CloudStack therefore shows several times the storage that exists, and its allocation checks (pool.storage.capacity.disablethreshold, over-provisioning) work against the inflated number.

LinstorUtil.getCapacityBytes() and LinstorUtil.getStorageStats() (4.22 branch, same in 4.23.0.0):

List<StoragePool> storagePools = getRscGroupStoragePools(linstorApi, rscGroupName);
return storagePools.stream()
    .filter(sp -> sp.getProviderKind() != ProviderKind.DISKLESS)
    .mapToLong(sp -> sp.getTotalCapacity() != null ? sp.getTotalCapacity() : 0L)
    .sum() * 1024;

getRscGroupStoragePools() returns that pool on every node, so the sum grows with the node count while the replica count is ignored.

Steps to reproduce

  1. 3 KVM hosts, each with a LINSTOR LVM thin pool of 39 GiB (pool0); resource group cloudstack with place_count 2; Linstor primary storage using that resource group.
  2. Infrastructure → Primary Storage: 116 G total (3 × 39 GiB), although at most ~58 GiB of data fits (2 copies of everything) and no volume can exceed 39 GiB.
  3. With 27 GiB free on the nodes, createVolume of 35 GiB is accepted; attached and written from an instance, the thin pools of the two nodes holding it fill up after about two minutes, DRBD detaches both replicas, and everything else on those pools (other volumes, in our case also the CloudStack management database on the same pool) gets I/O errors.

Versions

CloudStack 4.23.0.0 (KVM, AlmaLinux 10.3), LINSTOR 1.35.3, DRBD 9.3.5.

Suggested fix

Divide by the resource group's replica count (getSelectFilter().getPlaceCount()), or ask LINSTOR: linstor resource-group query-size-info <rg> (also in the REST API) returns the maximum volume size the resource group can place, taking replicas and node placement into account.

Activity

  1. boring-cyborg commented on Dec 2, 2026

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions