Commit 1f1d54e7 authored by Apollon Oikonomopoulos's avatar Apollon Oikonomopoulos Committed by Iustin Pop

IAllocator changes to work with shared storage

Make cmdlib.IAllocator shared-storage-aware. IAllocator requires secondary
nodes only on DTS_NET_MIRROR disk templates and requires no secondaries for
DTS_EXT_MIRROR templates.
Signed-off-by: default avatarApollon Oikonomopoulos <apollon@noc.grnet.gr>
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b6135bbc
......@@ -11262,11 +11262,12 @@ class IAllocator(object):
raise errors.ProgrammerError("Unknown instance '%s' passed to"
" IAllocator" % self.name)
if instance.disk_template not in constants.DTS_NET_MIRROR:
if instance.disk_template not in constants.DTS_MIRRORED:
raise errors.OpPrereqError("Can't relocate non-mirrored instances",
errors.ECODE_INVAL)
if len(instance.secondary_nodes) != 1:
if instance.disk_template in constants.DTS_NET_MIRROR and \
len(instance.secondary_nodes) != 1:
raise errors.OpPrereqError("Instance has not exactly one secondary node",
errors.ECODE_STATE)
......
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