On 30.12.2015 12:31, Huan Zhang wrote: > Hi, > We are finding a way to do rollback for qcow2 in production environment, > But we can't ensure the below way will work well, and user data are safe. > > for example, > snap0.qcow2 -> snap1.qcow2 ->snap2.qcow2 -> active.qcow2 > > rollback to snap1 using convert && rebase -u: > 1. qemu-img convert -O qcow2 snap1.qcow2 rollback.qcow2 > 2. qemu-img rebase -u -b snap2.qcow2 rollback.qcow2
What do you mean by "rollback"? Just getting back to the state presented in snap1, discarding all the changes done in snap2 and active? Then why don't you just throw snap2.qcow2 and active.qcow2 away and continue to work on snap1.qcow2? If you want to keep snap1 in its current state, just create a new image on top of it: $ qemu-img create -f qcow2 -b snap1.qcow2 active.qcow2 Anyway, the qemu-img rebase line looks fishy to me. What you are doing is using snap2.qcow2 as a backing file of snap1.qcow2, basically, and this is just the wrong way around than it was before. Max
signature.asc
Description: OpenPGP digital signature
