Commit 4d5d7287 by Őry Máté

Merge branch 'feature-node-info' into 'master'

Add feature: Node Info

Requires vmdriver@93d05776
parents 67324baa dffcf322
......@@ -3,9 +3,9 @@
<dl class="dl-horizontal">
<dt>{% trans "Node name" %}:</dt><dd>{{ node.name }}</dd>
<dt>{% trans "CPU cores" %}:</dt><dd>{{ node.num_cores }}</dd>
<dt>{% trans "RAM size" %}:</dt> <dd>{% widthratio node.ram_size 1048576 1 %} MB</dd>
<dt>{% trans "Architecture" %}:</dt><dd>{{ node.arch }}</dd>
<dt>{% trans "CPU cores" %}:</dt><dd>{{ node.info.core_num }}</dd>
<dt>{% trans "RAM size" %}:</dt> <dd>{% widthratio node.info.ram_size 1048576 1 %} MB</dd>
<dt>{% trans "Architecture" %}:</dt><dd>{{ node.info.architecture }}</dd>
<dt>{% trans "Host IP" %}:</dt><dd>{{ node.host.ipv4 }}</dd>
<dt>{% trans "Enabled" %}:</dt><dd>{{ node.enabled }}</dd>
<dt>{% trans "Host online" %}:</dt><dd> {{ node.online }}</dd>
......
......@@ -85,13 +85,13 @@ class Node(TimeStampedModel):
@node_available
@method_cache(300)
def get_num_cores(self):
"""Number of CPU threads available to the virtual machines.
"""
return self.remote_query(vm_tasks.get_core_num, default=0)
def get_info(self):
return self.remote_query(vm_tasks.get_info,
default={'cpu': '',
'ram': '0',
'arch': ''})
num_cores = property(get_num_cores)
info = property(get_info)
STATES = {False: {False: ('OFFLINE', _('offline')),
True: ('DISABLED', _('disabled'))},
......@@ -144,15 +144,6 @@ class Node(TimeStampedModel):
self.get_num_cores(invalidate_cache=True)
self.get_ram_size(invalidate_cache=True)
@node_available
@method_cache(300)
def get_ram_size(self):
"""Bytes of total memory in the node.
"""
return self.remote_query(vm_tasks.get_ram_size, default=0)
ram_size = property(get_ram_size)
@property
@node_available
def ram_size_with_overcommit(self):
......
......@@ -119,11 +119,21 @@ def get_core_num(params):
pass
@celery.task(name='vmdriver.get_architecture')
def get_architecture():
pass
@celery.task(name='vmdriver.get_ram_size')
def get_ram_size(params):
pass
@celery.task(name='vmdriver.get_info')
def get_info(params):
pass
@celery.task(name='vmdriver.get_node_metrics')
def get_node_metrics(params):
pass
......
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