Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
1ea1f78b
authored
Oct 15, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: adding mem_dump property
parent
5cd533d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
circle/vm/models.py
+11
-3
No files found.
circle/vm/models.py
View file @
1ea1f78b
...
...
@@ -386,6 +386,15 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
return
'cloud-'
+
str
(
self
.
id
)
@property
def
mem_dump
(
self
):
"""Return the path for the memory dump.
It is always on the first hard drive storage named cloud-<id>.dump
"""
path
=
self
.
disks
.
all
()[
0
]
.
datastore
.
path
return
path
+
'/'
+
'cloud-'
+
str
(
self
.
id
)
+
'.dump'
@property
def
primary_host
(
self
):
interfaces
=
self
.
interface_set
.
select_related
(
'host'
)
hosts
=
[
i
.
host
for
i
in
interfaces
if
i
.
host
]
...
...
@@ -622,7 +631,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
save
()
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
vm_tasks
.
sleep
.
apply_async
(
args
=
[
self
.
vm_name
],
vm_tasks
.
sleep
.
apply_async
(
args
=
[
self
.
vm_name
,
self
.
mem_dump
],
queue
=
queue_name
)
.
get
()
act
.
finish
(
result
=
'SUCCESS'
)
...
...
@@ -641,7 +650,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
act
.
save
()
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
vm_tasks
.
resume
.
apply_async
(
args
=
[
self
.
vm_name
],
vm_tasks
.
resume
.
apply_async
(
args
=
[
self
.
vm_name
,
self
.
dump_mem
],
queue
=
queue_name
)
.
get
()
act
.
finish
(
result
=
'SUCCESS'
)
...
...
@@ -719,7 +728,6 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
queue
=
"localhost.man"
)
class
InstanceActivity
(
TimeStampedModel
):
activity_code
=
CharField
(
verbose_name
=
_
(
'activity_code'
),
max_length
=
100
)
task_uuid
=
CharField
(
verbose_name
=
_
(
'task_uuid'
),
blank
=
True
,
...
...
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