From: Vratislav Podzimek <vpodzime(a)redhat.com>
LVM cache takes space from the VG, but it is not included in the cached LV's
size.
---
blivet/partitioning.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index 69e79e5..ea13004 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -1396,6 +1396,10 @@ def addRequest(self, req):
if max_raid_disks > 1:
self.pool -= 5 * max_raid_disks
+ if req.device.cached:
+ # cached LV -> reserve space for the cache
+ self.pool -= int(self.vg.align(req.device.cache.size, roundup=True) /
self.vg.peSize)
+
super(VGChunk, self).addRequest(req)
def lengthToSize(self, length):
--
To view this commit on github, visit
https://github.com/rhinstaller/blivet/commit/a3c309b42b3fbbea3f4d1921ed94...