Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kwabena Antwi-Boasiako
slapos
Commits
dbce6762
Commit
dbce6762
authored
Oct 14, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KVM SR: new way of exporting disk image.
Using new built-in feature of qemu 1.6.
parent
6b05014f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
15 deletions
+2
-15
software/kvm/common.cfg
software/kvm/common.cfg
+1
-1
software/kvm/template/kvm-export.sh.in
software/kvm/template/kvm-export.sh.in
+1
-14
No files found.
software/kvm/common.cfg
View file @
dbce6762
...
...
@@ -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 =
844ffe5e01dedbf0a261edf52e067cbe
md5sum =
95fde96f35cbf90d677c44d18b60fafb
download-only = true
mode = 0755
...
...
software/kvm/template/kvm-export.sh.in
View file @
dbce6762
#!/bin/bash
# Create a backup of the disk image of the virtual machine
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
...
...
@@ -11,15 +8,5 @@ if [ ! -f $DISK_PATH ]; then
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
$QMP_CLIENT
--socket
${
kvm
-instance
:socket-path
}
--drive-backup
$BACKUP_PATH
if
[
-f
$BACKUP_PATH
]
;
then
rm
$BACKUP_PATH
fi
$QEMU_IMG
convert
-f
qcow2
-O
qcow2
-s
$SNAPSHOT_NAME
$DISK_PATH
$BACKUP_PATH
$QMP_CLIENT
${
kvm
-instance
:socket-path
}
suspend
&&
\
$QEMU_IMG
snapshot
-d
$SNAPSHOT_NAME
$DISK_PATH
$QMP_CLIENT
${
kvm
-instance
:socket-path
}
resume
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