Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
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
3206ebe7
authored
Jan 08, 2014
by
Dudás Ádám
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: delete mem dump on destroy
closes #32
parent
f727eb9e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
circle/vm/models/instance.py
+16
-4
No files found.
circle/vm/models/instance.py
View file @
3206ebe7
...
...
@@ -315,12 +315,13 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
@property
def
mem_dump
(
self
):
"""Return the path for the memory dump.
"""Return the path
and datastore
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
+
'/'
+
self
.
vm_name
+
'.dump'
datastore
=
self
.
disks
.
all
()[
0
]
.
datastore
path
=
datastore
.
path
+
'/'
+
self
.
vm_name
+
'.dump'
return
{
'datastore'
:
datastore
,
'path'
:
path
}
@property
def
primary_host
(
self
):
...
...
@@ -558,6 +559,16 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
for
disk
in
self
.
disks
.
all
():
disk
.
destroy
()
# Delete mem. dump if exists
queue_name
=
self
.
mem_dump
[
'datastore'
]
.
get_remote_queue_name
(
'storage'
)
try
:
from
storage.tasks.remote_tasks
import
delete
delete
.
apply_async
(
args
=
[
self
.
mem_dump
[
'path'
]],
queue
=
queue_name
)
.
get
()
except
:
pass
# Clear node and VNC port association
self
.
node
=
None
self
.
vnc_port
=
None
...
...
@@ -578,7 +589,8 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
task_uuid
=
task_uuid
,
user
=
user
):
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
vm_tasks
.
sleep
.
apply_async
(
args
=
[
self
.
vm_name
,
self
.
mem_dump
],
vm_tasks
.
sleep
.
apply_async
(
args
=
[
self
.
vm_name
,
self
.
mem_dump
[
'path'
]],
queue
=
queue_name
)
.
get
()
def
sleep_async
(
self
,
user
=
None
):
...
...
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