Revision be9150ea lib/storage/bdev.py
b/lib/storage/bdev.py | ||
---|---|---|
753 | 753 |
|
754 | 754 |
_CheckResult(utils.RunCmd(["lvchange", "--addtag", text, self.dev_path])) |
755 | 755 |
|
756 |
def Grow(self, amount, dryrun, backingstore): |
|
756 |
def Grow(self, amount, dryrun, backingstore, excl_stor):
|
|
757 | 757 |
"""Grow the logical volume. |
758 | 758 |
|
759 | 759 |
""" |
... | ... | |
771 | 771 |
cmd = ["lvextend", "-L", "+%dk" % amount] |
772 | 772 |
if dryrun: |
773 | 773 |
cmd.append("--test") |
774 |
if excl_stor: |
|
775 |
# Disk growth doesn't grow the number of spindles, so we must stay within |
|
776 |
# our assigned volumes |
|
777 |
pvlist = list(self.pv_names) |
|
778 |
else: |
|
779 |
pvlist = [] |
|
774 | 780 |
# we try multiple algorithms since the 'best' ones might not have |
775 | 781 |
# space available in the right place, but later ones might (since |
776 | 782 |
# they have less constraints); also note that only recent LVM |
777 | 783 |
# supports 'cling' |
778 | 784 |
for alloc_policy in "contiguous", "cling", "normal": |
779 |
result = utils.RunCmd(cmd + ["--alloc", alloc_policy, self.dev_path]) |
|
785 |
result = utils.RunCmd(cmd + ["--alloc", alloc_policy, self.dev_path] + |
|
786 |
pvlist) |
|
780 | 787 |
if not result.failed: |
781 | 788 |
return |
782 | 789 |
base.ThrowError("Can't grow LV %s: %s", self.dev_path, result.output) |
... | ... | |
867 | 874 |
# TODO: implement rename for file-based storage |
868 | 875 |
base.ThrowError("Rename is not supported for file-based storage") |
869 | 876 |
|
870 |
def Grow(self, amount, dryrun, backingstore): |
|
877 |
def Grow(self, amount, dryrun, backingstore, excl_stor):
|
|
871 | 878 |
"""Grow the file |
872 | 879 |
|
873 | 880 |
@param amount: the amount (in mebibytes) to grow with |
... | ... | |
1055 | 1062 |
""" |
1056 | 1063 |
pass |
1057 | 1064 |
|
1058 |
def Grow(self, amount, dryrun, backingstore): |
|
1065 |
def Grow(self, amount, dryrun, backingstore, excl_stor):
|
|
1059 | 1066 |
"""Grow the logical volume. |
1060 | 1067 |
|
1061 | 1068 |
""" |
... | ... | |
1382 | 1389 |
""" |
1383 | 1390 |
pass |
1384 | 1391 |
|
1385 |
def Grow(self, amount, dryrun, backingstore): |
|
1392 |
def Grow(self, amount, dryrun, backingstore, excl_stor):
|
|
1386 | 1393 |
"""Grow the Volume. |
1387 | 1394 |
|
1388 | 1395 |
@type amount: integer |
... | ... | |
1545 | 1552 |
""" |
1546 | 1553 |
pass |
1547 | 1554 |
|
1548 |
def Grow(self, amount, dryrun, backingstore): |
|
1555 |
def Grow(self, amount, dryrun, backingstore, excl_stor):
|
|
1549 | 1556 |
"""Grow the Volume. |
1550 | 1557 |
|
1551 | 1558 |
@type amount: integer |
Also available in: Unified diff