Allow file storage to be grown
authorGuido Trotter <ultrotter@google.com>
Tue, 23 Mar 2010 09:29:51 +0000 (09:29 +0000)
committerGuido Trotter <ultrotter@google.com>
Tue, 23 Mar 2010 11:04:51 +0000 (11:04 +0000)
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/cmdlib.py
lib/constants.py
lib/objects.py

index 175c1fc..64d1176 100644 (file)
@@ -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.
index 0691a20..4addd97 100644 (file)
@@ -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"
index 91174a0..b2d8672 100644 (file)
@@ -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: