Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
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
33827556
authored
May 28, 2014
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: rollback shutdown_net if migrate_vm fails
fixes #156
parent
a0a784e7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
circle/vm/operations.py
+9
-0
No files found.
circle/vm/operations.py
View file @
33827556
...
@@ -202,6 +202,10 @@ class MigrateOperation(InstanceOperation):
...
@@ -202,6 +202,10 @@ class MigrateOperation(InstanceOperation):
name
=
_
(
"migrate"
)
name
=
_
(
"migrate"
)
description
=
_
(
"Live migrate running VM to another node."
)
description
=
_
(
"Live migrate running VM to another node."
)
def
rollback
(
self
,
activity
):
with
activity
.
sub_activity
(
'rollback_net'
):
self
.
instance
.
deploy_net
()
def
_operation
(
self
,
activity
,
to_node
=
None
,
timeout
=
120
):
def
_operation
(
self
,
activity
,
to_node
=
None
,
timeout
=
120
):
if
not
to_node
:
if
not
to_node
:
with
activity
.
sub_activity
(
'scheduling'
)
as
sa
:
with
activity
.
sub_activity
(
'scheduling'
)
as
sa
:
...
@@ -212,8 +216,13 @@ class MigrateOperation(InstanceOperation):
...
@@ -212,8 +216,13 @@ class MigrateOperation(InstanceOperation):
with
activity
.
sub_activity
(
'shutdown_net'
):
with
activity
.
sub_activity
(
'shutdown_net'
):
self
.
instance
.
shutdown_net
()
self
.
instance
.
shutdown_net
()
try
:
with
activity
.
sub_activity
(
'migrate_vm'
):
with
activity
.
sub_activity
(
'migrate_vm'
):
self
.
instance
.
migrate_vm
(
to_node
=
to_node
,
timeout
=
timeout
)
self
.
instance
.
migrate_vm
(
to_node
=
to_node
,
timeout
=
timeout
)
except
Exception
as
e
:
if
hasattr
(
e
,
'libvirtError'
):
self
.
rollback
(
activity
)
raise
# Refresh node information
# Refresh node information
self
.
instance
.
node
=
to_node
self
.
instance
.
node
=
to_node
...
...
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