Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4d5d7287
authored
Mar 20, 2014
by
Őry Máté
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-node-info' into 'master'
Add feature: Node Info Requires
vmdriver@93d05776
parents
67324baa
dffcf322
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
18 deletions
+19
-18
circle/dashboard/templates/dashboard/node-detail/resources.html
+3
-3
circle/vm/models/node.py
+6
-15
circle/vm/tasks/vm_tasks.py
+10
-0
No files found.
circle/dashboard/templates/dashboard/node-detail/resources.html
View file @
4d5d7287
...
...
@@ -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>
...
...
circle/vm/models/node.py
View file @
4d5d7287
...
...
@@ -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
):
...
...
circle/vm/tasks/vm_tasks.py
View file @
4d5d7287
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment