[libvirt-users] Pivot without copy

Eric Blake eblake at redhat.com
Tue May 19 21:17:09 UTC 2015


On 05/19/2015 02:41 PM, Mathew Moon wrote:
> Hi Eric,

[please don't top-post on technical lists]

> 
> Thanks for the info. I see the value in this, but it isn't quite what I was
> looking for. Basically what I want to do is to switch between snapshots
> quickly. For instance, I am currently working on designing a HA SQL
> implementation with failover. So right now I have 5 VM's running postgresql
> as a replication group. I am trying a lot of different things and often
> have to take a snapshot of all 5 VM's, do some work, and then to revert to
> the previous snapshot I have to:
> 
> 1. kill the VM
> 2. edit the VM's config
> 3. start the VM
> 
> What I would like is to be able to "pivot" the "current" image to be the
> previous snapshot (in most cases). I understand that if this were possible
> then there would be applications crash because something on disk doesn't
> jive with what is in memory, but I am ok with that, I just want to get my
> databases back to "square one" quickly after something in the procedure I
> am working on foo bar's my db and it is replicated to 4 other nodes.

That sounds more like snapshot-revert, except that we haven't wired up
snapshot revert to work with external snapshots yet.  You can experiment
with internal snapshots, but those have more guest downtime than
external snapshots.  Would you like to help write the patches for
reverting to external snapshots?

> 
> Any insights on how this could be accomplished using libvirt without
> rebooting?

Snapshot revert will roll back both the disk state and the memory state
to an earlier point in guest time.  But if you don't care about guest
memory, you could possibly hot-unplug the disk that has the state you no
longer want, then hot-plug the updated disk that does have what you
want.  If your guest can handle storage going away and then being
plugged in, then that is just as effective as anything that snapshots
would do at rolling back to a known disk state.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20150519/97a4d316/attachment.sig>


More information about the libvirt-users mailing list