summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.opendev.org>2023-02-17 20:08:03 +0000
committerGerrit Code Review <review@openstack.org>2023-02-17 20:08:03 +0000
commit66b940b66181b2695b0475eb5c768436abaa7e1c (patch)
treef853773864c0f98936b9b2239c90e517c8f9a1cd
parent8c4d7bf01f48660005cf397d40e34ce13d9bdc06 (diff)
parentaa920e2fd4b6d34feef758620507c1bb728b70a2 (diff)
downloadcinder-66b940b66181b2695b0475eb5c768436abaa7e1c.tar.gz
Merge "Bugfix: Account for consumed space better" into stable/yoga
-rw-r--r--cinder/volume/manager.py4
-rw-r--r--releasenotes/notes/bug-1910767-00f20702f5fc96db.yaml7
2 files changed, 9 insertions, 2 deletions
diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py
index 194018a75..97e4b25f7 100644
--- a/cinder/volume/manager.py
+++ b/cinder/volume/manager.py
@@ -585,8 +585,8 @@ class VolumeManager(manager.CleanableManager,
try:
for volume in volumes:
- # available volume should also be counted into allocated
- if volume['status'] in ['in-use', 'available']:
+ # Account for volumes that have been provisioned already.
+ if volume['host']:
# calculate allocated capacity for driver
self._count_allocated_capacity(ctxt, volume)
diff --git a/releasenotes/notes/bug-1910767-00f20702f5fc96db.yaml b/releasenotes/notes/bug-1910767-00f20702f5fc96db.yaml
new file mode 100644
index 000000000..2743e74db
--- /dev/null
+++ b/releasenotes/notes/bug-1910767-00f20702f5fc96db.yaml
@@ -0,0 +1,7 @@
+---
+fixes:
+ - |
+ `Bug #1910767 <https://bugs.launchpad.net/cinder/+bug/1910767>`_: Fixed
+ the calculation of the allocated capacity for the volume manager.
+ The fix takes into account all volumes that have a host setting, not just
+ volumes with a status of 'in-use' or 'available'.