CORD-2724 Enable binding VMs to nodes via node_label
Change-Id: Iac5f0e26f57aba4cfea93ab3a3588d40c4c8e2c8
diff --git a/xos/synchronizer/model_policies/model_policy_vhsstenant.py b/xos/synchronizer/model_policies/model_policy_vhsstenant.py
index 5520f58..dd6ace8 100644
--- a/xos/synchronizer/model_policies/model_policy_vhsstenant.py
+++ b/xos/synchronizer/model_policies/model_policy_vhsstenant.py
@@ -19,6 +19,7 @@
class VHSSTenantPolicy(TenantWithContainerPolicy):
model_name = "VHSSTenant"
+ constrain_by_service_instance = True
# Already defined in Super class
#def handle_create(self, service_instance):
@@ -69,10 +70,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)