KVM SR: export: use new slapos.toolbox qemu qmp wrapper.

parent 45830d38
......@@ -6,6 +6,8 @@
import socket
import time
# XXX: to be factored with slapos.toolbox qemu qmp wrapper.
socket_path = '%(socket-path)s'
vnc_password = '%(vnc-passwd)s'
......
......@@ -133,7 +133,7 @@ mode = 0644
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/kvm-export.sh.in
filename = kvm-export.sh.in
md5sum = 3e878b3343c76f0d6950986fffcb6a8c
md5sum = bf03a90f6960b37cba812ee936a13342
download-only = true
mode = 0755
......
......@@ -4,13 +4,17 @@ QEMU_IMG=${kvm-instance:qemu-img-path}
SNAPSHOT_NAME=$(date +%s)
DISK_PATH=${kvm-instance:disk-path}
BACKUP_PATH=${:backup-disk-path}
QMP_CLIENT=${buildout:directory}/software_release/bin/qemu-qmp-client
if [ ! -f $DISK_PATH ]; then
echo "Nothing to backup, disk image doesn't exist yet."
exit 0;
fi
$QMP_CLIENT ${kvm-instance:socket-path} suspend && \
$QEMU_IMG snapshot -c $SNAPSHOT_NAME $DISK_PATH
$QMP_CLIENT ${kvm-instance:socket-path} resume
if [ -f $BACKUP_PATH ]; then
rm $BACKUP_PATH
fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment