Commit 728489a3 authored by Guido Trotter's avatar Guido Trotter
Browse files

Fix burnin error when trying to grow a file volume



Abstract the growable disk types in a ganeti constants, and only run
disk grow, from burnin, on them.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 3a488770
......@@ -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)
......
......@@ -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"
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment