projects
/
ganeti-local
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'stable-2.7' into stable-2.8
[ganeti-local]
/
lib
/
bdev.py
diff --git
a/lib/bdev.py
b/lib/bdev.py
index
3c453d0
..
0f9339e
100644
(file)
--- a/
lib/bdev.py
+++ b/
lib/bdev.py
@@
-642,7
+642,7
@@
class LogicalVolume(BlockDev):
@staticmethod
def _GetVolumeInfo(lvm_cmd, fields):
@staticmethod
def _GetVolumeInfo(lvm_cmd, fields):
- """Returns LVM Volumen infos using lvm_cmd
+ """Returns LVM Volume infos using lvm_cmd
@param lvm_cmd: Should be one of "pvs", "vgs" or "lvs"
@param fields: Fields to return
@param lvm_cmd: Should be one of "pvs", "vgs" or "lvs"
@param fields: Fields to return
@@
-836,7
+836,7
@@
class LogicalVolume(BlockDev):
"""
self.attached = False
result = utils.RunCmd(["lvs", "--noheadings", "--separator=,",
"""
self.attached = False
result = utils.RunCmd(["lvs", "--noheadings", "--separator=,",
- "--units=m", "--nosuffix",
+ "--units=k", "--nosuffix",
"-olv_attr,lv_kernel_major,lv_kernel_minor,"
"vg_extent_size,stripes", self.dev_path])
if result.failed:
"-olv_attr,lv_kernel_major,lv_kernel_minor,"
"vg_extent_size,stripes", self.dev_path])
if result.failed:
@@
-1029,10
+1029,12
@@
class LogicalVolume(BlockDev):
if not self.Attach():
_ThrowError("Can't attach to LV during Grow()")
full_stripe_size = self.pe_size * self.stripe_count
if not self.Attach():
_ThrowError("Can't attach to LV during Grow()")
full_stripe_size = self.pe_size * self.stripe_count
+ # pe_size is in KB
+ amount *= 1024
rest = amount % full_stripe_size
if rest != 0:
amount += full_stripe_size - rest
rest = amount % full_stripe_size
if rest != 0:
amount += full_stripe_size - rest
- cmd = ["lvextend", "-L", "+%dm" % amount]
+ cmd = ["lvextend", "-L", "+%dk" % amount]
if dryrun:
cmd.append("--test")
# we try multiple algorithms since the 'best' ones might not have
if dryrun:
cmd.append("--test")
# we try multiple algorithms since the 'best' ones might not have