Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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):
...
@@ -315,12 +315,13 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
@property
@property
def
mem_dump
(
self
):
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
It is always on the first hard drive storage named cloud-<id>.dump
"""
"""
path
=
self
.
disks
.
all
()[
0
]
.
datastore
.
path
datastore
=
self
.
disks
.
all
()[
0
]
.
datastore
return
path
+
'/'
+
self
.
vm_name
+
'.dump'
path
=
datastore
.
path
+
'/'
+
self
.
vm_name
+
'.dump'
return
{
'datastore'
:
datastore
,
'path'
:
path
}
@property
@property
def
primary_host
(
self
):
def
primary_host
(
self
):
...
@@ -558,6 +559,16 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -558,6 +559,16 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
for
disk
in
self
.
disks
.
all
():
for
disk
in
self
.
disks
.
all
():
disk
.
destroy
()
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
# Clear node and VNC port association
self
.
node
=
None
self
.
node
=
None
self
.
vnc_port
=
None
self
.
vnc_port
=
None
...
@@ -578,7 +589,8 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
...
@@ -578,7 +589,8 @@ class Instance(AclBase, VirtualMachineDescModel, TimeStampedModel):
task_uuid
=
task_uuid
,
user
=
user
):
task_uuid
=
task_uuid
,
user
=
user
):
queue_name
=
self
.
get_remote_queue_name
(
'vm'
)
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
()
queue
=
queue_name
)
.
get
()
def
sleep_async
(
self
,
user
=
None
):
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