Commit 9db57446 by Őry Máté

vm: make scheduler's result public

parent f6687581
...@@ -583,10 +583,13 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -583,10 +583,13 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
self.pw)) self.pw))
self.save() self.save()
def __schedule_vm(self, act): def select_node(self):
"""Schedule the virtual machine. """Returns the node the VM should be deployed or migrated to.
"""
return scheduler.select_node(self, Node.objects.all())
:param self: The virtual machine. def __schedule_vm(self, act):
"""Schedule the virtual machine as part of a higher level activity.
:param act: Parent activity. :param act: Parent activity.
""" """
...@@ -596,7 +599,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel): ...@@ -596,7 +599,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Schedule # Schedule
if self.node is None: if self.node is None:
self.node = scheduler.select_node(self, Node.objects.all()) self.node = self.select_node()
self.save() self.save()
......
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 sign in to comment