Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cc-server
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
cc-server
Commits
1432dc3d
Commit
1432dc3d
authored
13 years ago
by
Antoine Millet
Browse files
Options
Downloads
Patches
Plain Diff
Update hot migration job with latest cc-node api.
parent
f38c8483
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ccserver/jobs.py
+24
-6
24 additions, 6 deletions
ccserver/jobs.py
with
24 additions
and
6 deletions
ccserver/jobs.py
+
24
−
6
View file @
1432dc3d
...
...
@@ -459,7 +459,7 @@ class HotMigrationJob(BaseMigrationJob):
# Update the VM object:
try
:
self
.
manager
.
server
.
objects
.
update
(
ids
=
(
vm_id
,))
vm
=
self
.
manager
.
server
.
objects
.
get_by_id
(
vm_id
)
vm
=
self
.
manager
.
server
.
objects
.
get_by_id
(
vm_id
)
.
to_dict
(
None
)
except
UnknownObjectError
:
raise
JobCancelError
(
'
Source VM not found
'
)
...
...
@@ -493,7 +493,7 @@ class HotMigrationJob(BaseMigrationJob):
for
disk
in
disks
:
to_cleanup
+=
self
.
_sync_disk
(
vm
,
disk
,
source
,
dest
)
#
...
#
Libvirt tunnel setup:
tunres_src
=
source
.
proxy
.
tun_setup
()
def
rb_tun_src
():
source
.
proxy
.
tun_destroy
(
tunres_src
)
...
...
@@ -503,13 +503,28 @@ class HotMigrationJob(BaseMigrationJob):
def
rb_tun_dst
():
dest
.
proxy
.
tun_destroy
(
tunres_dst
)
self
.
checkpoint
(
rb_tun_dst
)
source
.
proxy
.
tun_connect
(
tunres_src
,
tunres_dst
,
dest
.
get_ip
())
dest
.
proxy
.
tun_connect_hv
(
tunres_dst
,
migration
=
True
)
dest
.
proxy
.
tun_connect_hv
(
tunres_dst
,
migration
=
False
)
# Migration tunnel setup:
migtunres_src
=
source
.
proxy
.
tun_setup
()
def
rb_migtun_src
():
source
.
proxy
.
tun_destroy
(
migtunres_src
)
self
.
checkpoint
(
rb_migtun_src
)
migtunres_dst
=
dest
.
proxy
.
tun_setup
(
local
=
False
)
def
rb_migtun_dst
():
dest
.
proxy
.
tun_destroy
(
migtunres_dst
)
self
.
checkpoint
(
rb_migtun_dst
)
source
.
proxy
.
tun_connect
(
migtunres_src
,
migtunres_dst
,
dest
.
get_ip
())
dest
.
proxy
.
tun_connect_hv
(
migtunres_dst
,
migration
=
True
)
# Initiate the live migration:
self
.
report
(
'
migration in progress
'
)
source
.
proxy
.
vm_migrate_tunneled
(
self
[
'
vm_name
'
],
tunres_src
)
source
.
proxy
.
vm_migrate_tunneled
(
self
[
'
vm_name
'
],
tunres_src
,
migtunres_src
)
# At this point, if operation is a success, all we need is just to
# cleanup source hypervisor from disk and vm. This operation *CAN'T*
...
...
@@ -525,6 +540,8 @@ class HotMigrationJob(BaseMigrationJob):
source
.
proxy
.
tun_destroy
(
tunres_src
)
dest
.
proxy
.
tun_destroy
(
tunres_dst
)
source
.
proxy
.
tun_destroy
(
migtunres_src
)
dest
.
proxy
.
tun_destroy
(
migtunres_dst
)
for
cb_cleanup
in
reversed
(
to_cleanup
):
cb_cleanup
()
...
...
@@ -598,7 +615,8 @@ class HotMigrationJob(BaseMigrationJob):
self
.
report
(
status_msg
%
'
sync %s%%
'
%
status
[
'
completion
'
])
time
.
sleep
(
2
)
self
.
report
(
status_msg
%
'
setting both side as primary
'
)
dest
.
proxy
.
drbd_role
(
res_dst
,
True
)
source
.
proxy
.
drbd_takeover
(
res_src
,
True
)
def
rb_takeover_src
():
source
.
proxy
.
drbd_takeover
(
res_src
,
False
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment