CORD-2724 Enable binding VMs to nodes via node_label
Change-Id: Idae6f3769fa98d962b095350c8d8ffbad6cb8e14
diff --git a/xos/synchronizer/model_policies/model_policy_vspgwutenant.py b/xos/synchronizer/model_policies/model_policy_vspgwutenant.py
index 393491c..205ac37 100644
--- a/xos/synchronizer/model_policies/model_policy_vspgwutenant.py
+++ b/xos/synchronizer/model_policies/model_policy_vspgwutenant.py
@@ -69,10 +69,13 @@
desired_image = self.get_image(service_instance)
desired_flavor = self.get_flavor(service_instance)
+ node_label = service_instance.node_label
+ constrain_by_service_instance = self.constrain_by_service_instance
slice = service_instance.owner.slices.first()
- (node, parent) = LeastLoadedNodeScheduler(slice, label=None).pick()
+ scheduler = LeastLoadedNodeScheduler(slice, label=node_label, constrain_by_service_instance=constrain_by_service_instance)
+ (node, parent) = scheduler.pick()
assert (slice is not None)
assert (node is not None)