diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 9f604eed937b0a8c6515fe2c89f05a1ecfc42b17..175c1fc7702a347957c15d8bbcdcef7e33696c80 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -7700,7 +7700,7 @@ class LUGrowDisk(LogicalUnit): self.instance = instance - if instance.disk_template not in (constants.DT_PLAIN, constants.DT_DRBD8): + if instance.disk_template not in constants.DTS_GROWABLE: raise errors.OpPrereqError("Instance's disk layout does not support" " growing.", errors.ECODE_INVAL) diff --git a/lib/constants.py b/lib/constants.py index 49fca781c15eaf984dfa6370b7924b7025fb0ffe..f841471102253247fcd8d8d08fdae0b3acd829c2 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -265,6 +265,9 @@ DTS_NET_MIRROR = frozenset([DT_DRBD8]) # the set of non-lvm-based disk templates DTS_NOT_LVM = frozenset([DT_DISKLESS, DT_FILE]) +# the set of disk templates which can be grown +DTS_GROWABLE = frozenset([DT_PLAIN, DT_DRBD8]) + # logical disk types LD_LV = "lvm" LD_DRBD8 = "drbd8" diff --git a/tools/burnin b/tools/burnin index 91aae6b5c06d5bbefb2a0b2f57c2470a4423ea5b..a7ca79a8cfbd624528263b0e3465158486dfedbc 100755 --- a/tools/burnin +++ b/tools/burnin @@ -961,7 +961,7 @@ class Burner(object): opts.disk_template in constants.DTS_NET_MIRROR) : self.BurnReplaceDisks2() - if (opts.disk_template != constants.DT_DISKLESS and + if (opts.disk_template in constants.DTS_GROWABLE and utils.any(self.disk_growth, lambda n: n > 0)): self.BurnGrowDisks()