Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
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@93d05776f
parents
67324baa
dffcf322
Show 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 @@
...
@@ -3,9 +3,9 @@
<dl
class=
"dl-horizontal"
>
<dl
class=
"dl-horizontal"
>
<dt>
{% trans "Node name" %}:
</dt><dd>
{{ node.name }}
</dd>
<dt>
{% trans "Node name" %}:
</dt><dd>
{{ node.name }}
</dd>
<dt>
{% trans "CPU cores" %}:
</dt><dd>
{{ node.
num_cores
}}
</dd>
<dt>
{% trans "CPU cores" %}:
</dt><dd>
{{ node.
info.core_num
}}
</dd>
<dt>
{% trans "RAM size" %}:
</dt>
<dd>
{% widthratio node.ram_size 1048576 1 %} MB
</dd>
<dt>
{% trans "RAM size" %}:
</dt>
<dd>
{% widthratio node.
info.
ram_size 1048576 1 %} MB
</dd>
<dt>
{% trans "Architecture" %}:
</dt><dd>
{{ node.
arch
}}
</dd>
<dt>
{% trans "Architecture" %}:
</dt><dd>
{{ node.
info.architecture
}}
</dd>
<dt>
{% trans "Host IP" %}:
</dt><dd>
{{ node.host.ipv4 }}
</dd>
<dt>
{% trans "Host IP" %}:
</dt><dd>
{{ node.host.ipv4 }}
</dd>
<dt>
{% trans "Enabled" %}:
</dt><dd>
{{ node.enabled }}
</dd>
<dt>
{% trans "Enabled" %}:
</dt><dd>
{{ node.enabled }}
</dd>
<dt>
{% trans "Host online" %}:
</dt><dd>
{{ node.online }}
</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):
...
@@ -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
)
@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
@property
@node_available
@node_available
def
ram_size_with_overcommit
(
self
):
def
ram_size_with_overcommit
(
self
):
...
...
circle/vm/tasks/vm_tasks.py
View file @
4d5d7287
...
@@ -119,11 +119,21 @@ def get_core_num(params):
...
@@ -119,11 +119,21 @@ def get_core_num(params):
pass
pass
@celery.task
(
name
=
'vmdriver.get_architecture'
)
def
get_architecture
():
pass
@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
@celery.task
(
name
=
'vmdriver.get_info'
)
def
get_info
(
params
):
pass
@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
...
...
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