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
15821cba
authored
Jul 05, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: migration with zero downtime
parent
9d49beaf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
circle/vm/models/instance.py
+2
-1
circle/vm/operations.py
+4
-4
No files found.
circle/vm/models/instance.py
View file @
15821cba
...
...
@@ -822,7 +822,8 @@ class Instance(AclBase, VirtualMachineDescModel, StatusModel, OperatedMixin,
def
migrate_vm
(
self
,
to_node
,
timeout
=
120
):
queue_name
=
self
.
get_remote_queue_name
(
'vm'
,
'slow'
)
return
vm_tasks
.
migrate
.
apply_async
(
args
=
[
self
.
vm_name
,
to_node
.
host
.
hostname
],
to_node
.
host
.
hostname
,
True
],
queue
=
queue_name
)
.
get
(
timeout
=
timeout
)
...
...
circle/vm/operations.py
View file @
15821cba
...
...
@@ -250,10 +250,6 @@ class MigrateOperation(InstanceOperation):
to_node
=
self
.
instance
.
select_node
()
sa
.
result
=
to_node
# Shutdown networks
with
activity
.
sub_activity
(
'shutdown_net'
):
self
.
instance
.
shutdown_net
()
try
:
with
activity
.
sub_activity
(
'migrate_vm'
):
self
.
instance
.
migrate_vm
(
to_node
=
to_node
,
timeout
=
timeout
)
...
...
@@ -262,6 +258,10 @@ class MigrateOperation(InstanceOperation):
self
.
rollback
(
activity
)
raise
# Shutdown networks
with
activity
.
sub_activity
(
'shutdown_net'
):
self
.
instance
.
shutdown_net
()
# Refresh node information
self
.
instance
.
node
=
to_node
self
.
instance
.
save
()
...
...
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