summaryrefslogtreecommitdiffstats
path: root/lvm.py
diff options
context:
space:
mode:
Diffstat (limited to 'lvm.py')
-rw-r--r--lvm.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lvm.py b/lvm.py
index b831c31aa..3d6f7d36e 100644
--- a/lvm.py
+++ b/lvm.py
@@ -129,3 +129,19 @@ def clampLVSizeRequest(size, pe):
return size
else:
return ((long((size*1024L)/pe)+1L)*pe)/1024
+
+def clampPVSize(pvsize, pesize):
+ """Given a PV size and a PE, returns the usable space of the PV.
+
+ pvsize - size (in MB) of PV request
+ pesize - PE size (in KB)
+ """
+
+ return (long(pvsize*1024/pesize)*pesize)/1024
+
+def getMaxLVSize(pe):
+ """Given a PE size in KB, returns maximum size (in MB) of a logical volume.
+
+ pe - PE size in KB
+ """
+ return pe*64