Commit fc31fadd authored by Iustin Pop's avatar Iustin Pop

Restrict blacklisted OSes in instance installation

Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 546b1111
......@@ -6636,6 +6636,10 @@ class LUCreateInstance(LogicalUnit):
if self.op.os_type is None:
raise errors.OpPrereqError("No guest OS specified",
errors.ECODE_INVAL)
if self.op.os_type in self.cfg.GetClusterInfo().blacklisted_oss:
raise errors.OpPrereqError("Guest OS '%s' is not allowed for"
" installation" % self.op.os_type,
errors.ECODE_STATE)
if self.op.disk_template is None:
raise errors.OpPrereqError("No disk template specified",
errors.ECODE_INVAL)
......
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