Commit eedc99de authored by Manuel Franceschini's avatar Manuel Franceschini
Browse files

Add lvm-storage check when creating instances

This adds a check to fail instance creation if lvm-storage is disabled
(cluster-wide). If lvm-storage is disabled (by initializing the cluster
with --no-lvm-storage) only instances with disk template in frozenset
DTS_NOT_LVM are allowed to create.

Reviewed-by: iustinp
parent d63e148a
......@@ -2853,6 +2853,11 @@ class LUCreateInstance(LogicalUnit):
raise errors.OpPrereqError("Invalid instance creation mode '%s'" %
if (not self.cfg.GetVGName() and
self.op.disk_template not in constants.DTS_NOT_LVM):
raise errors.OpPrereqError("Cluster does not support lvm-based"
" instances")
if self.op.mode == constants.INSTANCE_IMPORT:
src_node = getattr(self.op, "src_node", None)
src_path = getattr(self.op, "src_path", None)
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