Commit 85f074a6 by Dudás Ádám

vm: beautification

parent 0a40f809
......@@ -40,6 +40,7 @@ post_state_changed = Signal(providing_args=["new_state"])
class InstanceActiveManager(Manager):
def get_query_set(self):
return super(InstanceActiveManager,
......@@ -133,6 +134,9 @@ class Node(TimeStampedModel):
class Meta:
permissions = ()
def __unicode__(self):
@method_cache(10, 5)
def online(self):
......@@ -143,15 +147,15 @@ class Node(TimeStampedModel):
def num_cores(self):
"""Number of CPU threads available to the virtual machines."""
"""Number of CPU threads available to the virtual machines.
return self.remote_query(vm_tasks.get_core_num)
def ram_size(self):
"""Bytes of total memory in the node."""
"""Bytes of total memory in the node.
return self.remote_query(vm_tasks.get_ram_size)
......@@ -208,9 +212,6 @@ class Node(TimeStampedModel):'Node %s update: domain %s in libvirt but not in db.',
self, i)
def __unicode__(self):
class NodeActivity(ActivityModel):
node = ForeignKey(Node, related_name='activity_log',
......@@ -679,6 +680,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
# Schedule
if self.node is None:
self.node = scheduler.get_node(self, Node.objects.all())
# Deploy virtual images
......@@ -687,6 +689,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
queue_name = self.get_remote_queue_name('vm')
# Deploy VM on remote machine
with act.sub_activity('deploying_vm'):
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