New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kvm: qemu-img convert -s to backup snapshot is deprecated #4094
kvm: qemu-img convert -s to backup snapshot is deprecated #4094
Conversation
This fixes the qemu-img convert command to use the support way to create qcow2 file from a snapshot name of a qcow2 volume using the `-l snapshot.name=<name>` as the `-s <snapshot name` is no longer supported in newer qemu-img. Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
@blueorangutan package |
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
@@ -153,7 +153,7 @@ destroy_snapshot() { | |||
lvm lvremove -f "${vg}/${snapshotname}-cow" | |||
elif [ -f $disk ]; then | |||
#delete all the existing snapshots | |||
$qemu_img snapshot -l $disk |tail -n +3|awk '{print $1}'|xargs -I {} $qemu_img snapshot -d {} $disk >&2 | |||
$qemu_img snapshot -l $disk |tail -n +3|awk '{print $2}'|xargs -I {} $qemu_img snapshot -d {} $disk >&2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shwstppr @davidjumani can any of you advise if qemu-img snapshot -l
second column is the name of the snapshot or ID? qemu-img snapshot -d in Ubuntu 20.04 and possibly CentOS8 only accepts snapshot name and not the ID.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhtyd from the qemu wiki :
$ qemu-img snapshot -l xxtest.qcow2
Snapshot list:
ID TAG VM SIZE DATE VM CLOCK
1 1.5M 2010-07-26 16:51:52 00:00:08.599
2 1.5M 2010-07-26 16:51:53 00:00:09.719
3 1.5M 2010-07-26 17:26:49 00:00:13.245
4 1.5M 2010-07-26 19:01:00 00:00:46.763
no name to be found.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaanHoogland I think we'll have to check the command for our snapshots, when we create them we generally pass like a uuid-looking name. @shwstppr @davidjumani can you test and confirm (with centos7 vs centos8) with this PR?
Packaging result: ✔centos7 ✔debian. JID-1237 |
@blueorangutan test |
1 similar comment
@blueorangutan test |
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Trillian test result (tid-1555)
|
@blueorangutan test |
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Trillian test result (tid-1556)
|
@blueorangutan package |
@rhtyd a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
Packaging result: ✔centos7 ✔debian. JID-1243 |
@blueorangutan test |
@rhtyd a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
Trillian test result (tid-1566)
|
Looks like this change breaks snapshot for older/centos7 distro :( |
ping @shwstppr @davidjumani - let me know if this issue has been handled in the other PR (centos8 or ubuntu 20.04)? I'll close this PR. |
@rhtyd Checked with CentOS8. This PR branch over #4068. No regression in snapshot behavior.
|
Keep in mind that the code for volume snapshot while VM is running (kvm.snapshot.enabled=true) vs when VM is stopped is completely different code path - i.e. should be tested. |
@andrijapanicsb will check and report after changing that setting cc @rhtyd |
After setting to true,
|
I'll close this, please refer this PR and port changes to #4068 instead @shwstppr @davidjumani Thanks. |
This fixes the qemu-img convert command to use the support way to create
qcow2 file from a snapshot name of a qcow2 volume using the
-l snapshot.name=<name>
as the-s <snapshot name
is no longer supportedin newer qemu-img.
Tested on Ubuntu 20.04, needs testing on CentOS8 cc @davidjumani @shwstppr and regression testing on CentOS7 and Ubuntu 16.04/18.04 cc @wido @GabrielBrascher
Types of changes