IAllocators should not put instances on nodes in nodegroups which are
not connected to the network the instance should be connected to.
Therefore, export the networks a node group is connected to to the
IAllocator, so it can account for this restriction.

Signed-off-by: Thomas Thrainer <[email protected]>
---
 lib/masterd/iallocator.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/masterd/iallocator.py b/lib/masterd/iallocator.py
index 7179b0e..e6c9df6 100644
--- a/lib/masterd/iallocator.py
+++ b/lib/masterd/iallocator.py
@@ -465,6 +465,7 @@ class IAllocator(object):
     ng = dict((guuid, {
       "name": gdata.name,
       "alloc_policy": gdata.alloc_policy,
+      "networks": [net_uuid for net_uuid, _ in gdata.networks.items()],
       "ipolicy": gmi.CalculateGroupIPolicy(cluster, gdata),
       "tags": list(gdata.GetTags()),
       })
-- 
1.8.2.1

Reply via email to