projects
/
invirt/scripts/prod-migration.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cancel the migration if there's an error in the middle
[invirt/scripts/prod-migration.git]
/
xvm-migrate-machine
diff --git
a/xvm-migrate-machine
b/xvm-migrate-machine
index
9b08eec
..
efc3416
100755
(executable)
--- a/
xvm-migrate-machine
+++ b/
xvm-migrate-machine
@@
-83,6
+83,7
@@
def migrate_vm(machine_name):
if 0 != subprocess.call(['lvcreate', '-L%sM' % str(disk.size), '-n', lvname, 'xenvg']):
success = False
if 0 != subprocess.call(['lvcreate', '-L%sM' % str(disk.size), '-n', lvname, 'xenvg']):
success = False
+ break
ssh = subprocess.Popen(['ssh', '-o', 'GSSAPIDelegateCredentials=no',
'torchwood-institute.mit.edu',
ssh = subprocess.Popen(['ssh', '-o', 'GSSAPIDelegateCredentials=no',
'torchwood-institute.mit.edu',
@@
-92,8
+93,10
@@
def migrate_vm(machine_name):
stdin=ssh.stdout)
if 0 != dd.wait():
success = False
stdin=ssh.stdout)
if 0 != dd.wait():
success = False
+ break
if 0 != ssh.wait():
success = False
if 0 != ssh.wait():
success = False
+ break
if not success:
restore_data(machine, dev_sess)
if not success:
restore_data(machine, dev_sess)