From 2c42c5df6f79652f645f5c0446e50d40f9230e78 Mon Sep 17 00:00:00 2001 From: Guido Trotter <ultrotter@google.com> Date: Tue, 23 Mar 2010 09:29:51 +0000 Subject: [PATCH] Allow file storage to be grown Signed-off-by: Guido Trotter <ultrotter@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/cmdlib.py | 5 ++++- lib/constants.py | 2 +- lib/objects.py | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 175c1fc77..64d117629 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -7706,7 +7706,10 @@ class LUGrowDisk(LogicalUnit): self.disk = instance.FindDisk(self.op.disk) - _CheckNodesFreeDisk(self, nodenames, self.op.amount) + if instance.disk_template != constants.DT_FILE: + # TODO: check the free disk space for file, when that feature will be + # supported + _CheckNodesFreeDisk(self, nodenames, self.op.amount) def Exec(self, feedback_fn): """Execute disk grow. diff --git a/lib/constants.py b/lib/constants.py index 0691a2011..4addd97ae 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -266,7 +266,7 @@ DTS_NET_MIRROR = frozenset([DT_DRBD8]) DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE]) # the set of disk templates which can be grown -DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8]) +DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8, DT_FILE]) # logical disk types LD_LV = "lvm" diff --git a/lib/objects.py b/lib/objects.py index 91174a06d..b2d86727f 100644 --- a/lib/objects.py +++ b/lib/objects.py @@ -497,7 +497,7 @@ class Disk(ConfigObject): actual algorithms from bdev. """ - if self.dev_type == constants.LD_LV: + if self.dev_type == constants.LD_LV or self.dev_type == constants.LD_FILE: self.size += amount elif self.dev_type == constants.LD_DRBD8: if self.children: -- GitLab