summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
87146ae)
As external storage is not associated with a node, we have to make an
exception for that before raising an error.
Signed-off-by: Lisa Velden <velden@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>
errors.ECODE_INVAL)
instance_nodes = self.cfg.GetInstanceNodes(self.instance.uuid)
errors.ECODE_INVAL)
instance_nodes = self.cfg.GetInstanceNodes(self.instance.uuid)
- if not set(instance_nodes).issubset(set(disk.nodes)):
+ # Make sure we do not attach disks to instances on wrong nodes. If the
+ # instance is diskless, that instance is associated only to the primary
+ # node, whereas the disk can be associated to two nodes in the case of DRBD,
+ # hence, we have a subset check here.
+ if disk.nodes and not set(instance_nodes).issubset(set(disk.nodes)):
raise errors.OpPrereqError("Disk nodes are %s while the instance's nodes"
" are %s" %
(disk.nodes, instance_nodes),
raise errors.OpPrereqError("Disk nodes are %s while the instance's nodes"
" are %s" %
(disk.nodes, instance_nodes),