Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
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
85f074a6
authored
Nov 25, 2013
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: beautification
parent
0a40f809
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
circle/vm/models.py
+10
-7
No files found.
circle/vm/models.py
View file @
85f074a6
...
...
@@ -40,6 +40,7 @@ post_state_changed = Signal(providing_args=["new_state"])
class
InstanceActiveManager
(
Manager
):
def
get_query_set
(
self
):
return
super
(
InstanceActiveManager
,
self
)
.
get_query_set
()
.
filter
(
destroyed
=
None
)
...
...
@@ -133,6 +134,9 @@ class Node(TimeStampedModel):
class
Meta
:
permissions
=
()
def
__unicode__
(
self
):
return
self
.
name
@property
@method_cache
(
10
,
5
)
def
online
(
self
):
...
...
@@ -143,15 +147,15 @@ class Node(TimeStampedModel):
@property
@method_cache
(
300
)
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
)
@property
@method_cache
(
300
)
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
)
@property
...
...
@@ -208,9 +212,6 @@ class Node(TimeStampedModel):
logger
.
info
(
'Node
%
s update: domain
%
s in libvirt but not in db.'
,
self
,
i
)
def
__unicode__
(
self
):
return
self
.
name
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
())
self
.
save
()
# Deploy virtual images
...
...
@@ -687,6 +689,7 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
disk
.
deploy
()
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
# Deploy VM on remote machine
with
act
.
sub_activity
(
'deploying_vm'
):
vm_tasks
.
deploy
.
apply_async
(
args
=
[
self
.
get_vm_desc
()],
...
...
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