mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
parent
4c77119fce
commit
203094ddd0
@ -33,8 +33,19 @@ for snap in $snaps; do
|
||||
"Failed to delete snapshot $snap from $deploy_id"
|
||||
done
|
||||
|
||||
exec_and_log "virsh --connect $LIBVIRT_URI migrate --live $MIGRATE_OPTIONS $deploy_id $QEMU_PROTOCOL://$dest_host/system" \
|
||||
"Could not migrate $deploy_id to $dest_host"
|
||||
# do live migration, but cleanup target host in case of error
|
||||
virsh --connect $LIBVIRT_URI migrate --live $MIGRATE_OPTIONS $deploy_id $QEMU_PROTOCOL://$dest_host/system
|
||||
|
||||
RC=$?
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
for CLEAN_OP in destroy undefine; do
|
||||
virsh --connect $QEMU_PROTOCOL://$dest_host/system "${CLEAN_OP}" $deploy_id >/dev/null 2>&1
|
||||
done
|
||||
|
||||
error_message "Could not migrate $deploy_id to $dest_host"
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
if [ "$SYNC_TIME" = "yes" ]; then
|
||||
(
|
||||
|
@ -34,9 +34,21 @@ for snap in $snaps; do
|
||||
"Failed to delete snapshot $snap from $deploy_id"
|
||||
done
|
||||
|
||||
# do live migration, but cleanup target host in case of error
|
||||
virsh --connect $QEMU_PROTOCOL://$src_host/system \
|
||||
migrate --live $deploy_id $MIGRATE_OPTIONS $QEMU_PROTOCOL://$dest_host/system
|
||||
|
||||
RC=$?
|
||||
|
||||
if [ $RC -ne 0 ]; then
|
||||
for CLEAN_OP in destroy undefine; do
|
||||
virsh --connect $QEMU_PROTOCOL://$dest_host/system "${CLEAN_OP}" $deploy_id >/dev/null 2>&1
|
||||
done
|
||||
|
||||
error_message "Could not migrate $deploy_id to $dest_host"
|
||||
exit $RC
|
||||
fi
|
||||
|
||||
if [ "$SYNC_TIME" = "yes" ]; then
|
||||
(
|
||||
for i in $(seq 3); do
|
||||
|
Loading…
x
Reference in New Issue
Block a user