| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Linstor rounds the storage of a volume up (e.g. to the LVM extent size) and DRBD makes all of it usable, so the device a VM sees is usually a few MiB larger than the size CloudStack requested and records: a 512 MiB volume has a 540909568 byte device. Filesystems the guest creates on the whole disk, or grows to its end (cloud-init growpart), use that space, but the copies CloudStack makes are cut at the recorded size: snapshot backups to secondary storage are shrunk to it, and a copy opened at its own size then holds a filesystem larger than the disk. The driver now records the size of the device after creating a volume (new, cloned from a template or from a snapshot) and after a resize, and notifies the hypervisor of that size. Existing volumes are corrected before a snapshot and before a copy to secondary storage. The recorded size only grows, and the difference is counted against the account's primary storage, except on resize, which counts the recorded size itself. The device size is the smallest usable size of the top layer on the diskful resources; diskless resources only report the size of the volume definition. With DrbdOptions/ExactSize the device has the size of the volume definition.
Codecov Report❌ Patch coverage is 68.96552% with 18 lines in your changes missing coverage. Please review. @@ Coverage Diff @@
## 4.22 #14658 +/- ##
=========================================
Coverage 18.32% 18.32%
- Complexity 16644 16657 +13
=========================================
Files 5939 5939
Lines 537768 537843 +75
Branches 65929 65943 +14
=========================================
+ Hits 98551 98569 +18
- Misses 428008 428063 +55
- Partials 11209 11211 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
This PR makes the LINSTOR plugin record the size of a volume's DRBD device as the volume size in CloudStack.
LINSTOR rounds the storage of a volume up (e.g. to the LVM extent size, plus DRBD metadata) and DRBD makes all of
it usable, so the block device a VM sees is usually a few MiB larger than the size CloudStack requested and
records. Examples from a 3-node LVM-thin setup:
Filesystems the guest creates on the whole disk, or grows to its end (e.g. cloud-init growpart), use that space,
but the copies CloudStack makes of the volume are cut at the recorded size: snapshot backups to secondary storage
are shrunk to it, so the last few MiB of the disk are missing in the backup, and a volume or template created from
such a copy then holds a filesystem that is larger than its disk.
The driver now:
resize, and passes the device size to the hypervisor in the resize notification,
snapshot backups and volume copies cover the whole device,
orchestrator already counts the (now recorded) size.
The device size is the smallest usable size of the top layer (DRBD, LUKS or storage) over the diskful resources;
diskless resources only report the size of the volume definition. With DrbdOptions/ExactSize set on the resource
definition the device has the size of the volume definition, which is used as is.
Volumes created on the agent side (e.g. migrated into LINSTOR) are corrected at their next snapshot or copy.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Unit tests (LinstorUtilTest, LinstorPrimaryDataStoreDriverImplTest) for the device size (smallest diskful
DRBD device, no DRBD layer, DrbdOptions/ExactSize, fallback to the volume definition, missing resource
definition) and for recording it (larger device, no resource count adjustment on resize, never shrinking, LINSTOR
API failure).
3-node KVM cluster with CloudStack 4.23 and this patch applied to the LINSTOR plugin, LINSTOR primary storage
(LVM-thin, DRBD 9.3, LINSTOR 1.35):
1077665792, the account's primary storage count rose by exactly the difference, and the backed up qcow2 on
secondary storage has a virtual size of 1077665792 bytes
resource count matches
How did you try to break this feature and the system with this change?
Covered by the unit tests:
definitions with DrbdOptions/ExactSize.