[master 6/6] Reserve space for the 'pmspare' LV in a VG
vpodzime
installerbot-noreply at redhat.com
Tue Aug 18 12:25:20 UTC 2015
From: Vratislav Podzimek <vpodzime at redhat.com>
The 'pmspare' LV is created by LVM behind our back and it serves as a temporary
space for some metadata reorganizations/cleanup/... so its size is equal to the
size of the biggest metadata LV in the VG. If we ignore it, we lack free space
in the VG later when creating LVs.
---
blivet/devices/lvm.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index ada2db8..d090eb7 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -347,6 +347,9 @@ def reservedSpace(self):
elif self.reserved_space > Size(0):
reserved = self.reserved_space
+ # reserve space for the pmspare LV LVM creates behind our back
+ reserved += self.pmSpareSize
+
return self.align(reserved, roundup=True)
@property
@@ -422,6 +425,16 @@ def cachedLVs(self):
return [l for l in self._lvs if l.cached]
@property
+ def pmSpareSize(self):
+ """Size of the pmspare LV LVM creates in every VG that contains some metadata
+ (even internal) LV. The size of such LV is equal to the size of the
+ biggest metadata LV in the VG.
+
+ """
+ # TODO: report correctly/better for existing VGs
+ return max([lv.metaDataSize for lv in self.lvs] + [Size(0)])
+
+ @property
def complete(self):
"""Check if the vg has all its pvs in the system
Return True if complete.
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/40fa2db53e8ed8cfb36b6d0832a1ceb193e9dd0a
More information about the anaconda-patches
mailing list