[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] A simple backup

> >> This is not really ideal, since it's not always desirable to have to
> >> save a domain's memory state.  It would be nicer if you could somehow
> >> guarantee a consistent filesystem state on your disk snapshot.  I've
> >> been looking into how to do this and I believe it's quite possible to
> >> modify the code to support this properly.
> >
> > Mark, thanks for the reply.
> > My thought is this. If I xm save it saves the memory state and pauses
> > the VM. While the vm is paused I can then snapshot the block device from
> > dom0 of the guest vm. Since the domain is paused there is no disk
> > activity during the snapshot, and anything that was possibly
> > half-written is in the memory state. So I should be able to reliably dd
> > the snapshot since when I try to restore I could try restoring the block
> >  device state, and use xm restore on the checkpoint to restore the
> > memory at the same time. Is this not essentially what xm migrate does?
> > Can we not be assured that since we have memory state and block state at
> > that point in time that the data will be consistent?
> >
> > .... When I say assured I mean just as assured as any other backup.
> > There is always the possibility of flipped bits, I am just thinking that
> > having memory state and block state when attempting a restore would be
> > very very close if not the same as having turned the domain off and
> > copied the block device then turn it back on.
> >
> > hope that makes sense and there wasnt too much rambling.
> Does that sound right? I guess I am really interested how lvm snapshots
> are thought of as not safe when a domain is paused and you have the
> memory state.

You're correct; it's safe to take a snapshot of the guest's filesystem whilst 
the guest is suspended and take a snapshot of the suspend image at the same 
time.  That gives you all the data that you need to restore the guest by 
reverting the filesystem to the backup and restoring the save image; I meant 
to express this in my original e-mail.

My intention was just to remind people that merely snapshotting the guest's 
storage but not taking the memory save image does not guarantee you the 
ability to restore, although usually it will probably work OK through 
filesystem recovery mechanisms.

LVM snapshotting a domU is a different case to LVM snapshotting a filesystem 
in dom0; many filesystems will automatically put themselves into a consistent 
state if they *know* they're being snapshotted.  This means that OS local LVM 
snapshots should be mountable.  The difference with Xen is that a filesystem 
within a domU doesn't *know* that it's being snapshotted by dom0 so it can't 
put itself into a consistent, mountable state.  This is the thing that I've 
been looking into fixing.  Saving a memory image to create a "warm" backup 
should work fine  in the meantime.


Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.