mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-16 22:50:10 +03:00
Merge pull request #316 from vholer/bug-5145
B #5145: Drop domain snapshots before live-migrate
This commit is contained in:
commit
cfc84db378
@ -22,5 +22,16 @@ source $(dirname $0)/../../scripts_common.sh
|
||||
deploy_id=$1
|
||||
dest_host=$2
|
||||
|
||||
# migration can't be done with domain snapshots, drop them first
|
||||
snaps=$(monitor_and_log \
|
||||
"virsh --connect $LIBVIRT_URI snapshot-list $deploy_id --name 2>/dev/null" \
|
||||
"Failed to get snapshots for $deploy_id")
|
||||
|
||||
for snap in $snaps; do
|
||||
exec_and_log \
|
||||
"virsh --connect $LIBVIRT_URI snapshot-delete $deploy_id --snapshotname $snap --metadata" \
|
||||
"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"
|
||||
|
@ -17,11 +17,23 @@
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
source $(dirname $0)/kvmrc
|
||||
source $(dirname $0)/../../scripts_common.sh
|
||||
|
||||
deploy_id=$1
|
||||
dest_host=$2
|
||||
src_host=$3
|
||||
|
||||
# migration can't be done with domain snapshots, drop them first
|
||||
snaps=$(monitor_and_log \
|
||||
"virsh --connect $QEMU_PROTOCOL://$src_host/system snapshot-list $deploy_id --name 2>/dev/null" \
|
||||
"Failed to get snapshots for $deploy_id")
|
||||
|
||||
for snap in $snaps; do
|
||||
exec_and_log \
|
||||
"virsh --connect $QEMU_PROTOCOL://$src_host/system snapshot-delete $deploy_id --snapshotname $snap --metadata" \
|
||||
"Failed to delete snapshot $snap from $deploy_id"
|
||||
done
|
||||
|
||||
virsh --connect $QEMU_PROTOCOL://$src_host/system \
|
||||
migrate --live $deploy_id $MIGRATE_OPTIONS $QEMU_PROTOCOL://$dest_host/system
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user