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

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 <>
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarIustin Pop <>
parent b6135bbc
......@@ -11262,11 +11262,12 @@ class IAllocator(object):
raise errors.ProgrammerError("Unknown instance '%s' passed to"
" IAllocator" %
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",
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",
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