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