> > I've been having a look at this too. Would you like to look into sharing
> > the work? I'd got as far as plumbing some control plane stuff through
> > xm, Xend, etc to talk to a stub driver in drivers/xen/fssnap/fssnap.c.
> > I've also identified where I think we'd need to hook in to get the kernel
> > to freeze its filesystem. I've not tied it all together yet though.
>
> Well, sure I'd like to share, I didn't have much time to play with it yet,
> I've mostly studied a bit on how the DM stuff works, and I think the
> simplest, yet working solution could be:
>
> $ xm freeze_dev xvda1 myDom
> - this will tell the domU kernel to call freeze_bdev(...) (see
> fs/buffer.c) for the given device to put it into consistent state, and
> stop using it for a while
>
> then from dom0 You can safely create a snapshot of lv on top of domU's
> device is sitting:
> $ lvcreate -s blabla
>
> $ xm unfreeze_dev xvda1 myDom
> - this will tell the domU kernel to call thaw_bdev(..), which
> will allow domU to continue using device
>
> What do You think about it?
Yes, I think that's a sensible first step to take. Later on, we could perhaps
look into putting some more smarts in, e.g. doing the snapshot creation
automatically in the case that an LVM volume or QCow virtual disk is already
being used.
I hadn't come across freeze/thaw_bdev before - I'd found a lock / unlock call
for filesystem locking somewhere that looked promising but not implemented it
yet. I imagine it might boil down to a similar thing in the end.
Either way, being able to freeze specific block devices could be useful for
backup purposes. There's no point freezing filesystems that are not used to
store backed-up data, for instance!
>
> Yup, agree :)
> Cheers!
OK, I'll try and get some code online at some point and let you know when it's
available.
Cheers,
Mark
> nik
>
> > Cheers,
> > Mark
> >
> >> cheers
> >> n.
> >>
> >> On Sat, 15 Dec 2007, tgh wrote:
> >>> hi
> >>> if we use the ParallaxFS to do the filesystem snapshot, does it have
> >>> the similar problem ,or not? could you clear me?
> >>>
> >>> Thanks in advance
> >>>
> >>> Mark Williamson ??:
> >>>>> I'd like to ask a question regarding LVM snapshots:
> >>>>> normally if You make a snapshot of mounted LVM partition, DM
> >>>>> infrastructure handles putting fs into consistent state using VFS
> >>>>> infrastructure. BUT, does it work even if I make snapshot of LV used
> >>>>> by XEN?
> >>>>
> >>>> If your LVM is running in dom0 and you snapshot the storage used by a
> >>>> domU then, no, it won't snapshot the domU's filesystem automatically.
> >>>>
> >>>>> If not, I guess it should not be that hard to fix, I guess we just
> >>>>> need to notify domU kernel to call needed VFS function to put fs into
> >>>>> consistent state prior to creating snapshot.
> >>>>
> >>>> Yep.
> >>>>
> >>>>> Can somebody comment on it, eventually correct me if I'm wrong?
> >>>>
> >>>> You're quite right. I've just had a look at it and it looks quite
> >>>> feasible to do this. The obvious simple way to implement it would be
> >>>> to add an xm command that causes a domain to freeze its filesystems
> >>>> into a consistent state and then return when that is done.
> >>>>
> >>>> e.g.
> >>>>
> >>>> xm create mydomain
> >>>> xm fs_freeze mydomain
> >>>> <do backup>
> >>>> xm fs_unfreeze mydomain
> >>>>
> >>>> Ideally the backup operation would just take a snapshot e.g. using LVM
> >>>> or qcow. With a bit more tools / storage integration we could have an
> >>>> "xm safesnapshot" command that would create a coherent snapshot of the
> >>>> disk.
> >>>>
> >>>> It would be awesome.
> >>>>
> >>>> Cheers,
> >>>> Mark
> >
> > --
> > Dave: Just a question. What use is a unicyle with no seat? And no
> > pedals! Mark: To answer a question with a question: What use is a
> > skateboard? Dave: Skateboards have wheels.
> > Mark: My wheel has a wheel!
> >
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-devel
--
Dave: Just a question. What use is a unicyle with no seat? And no pedals!
Mark: To answer a question with a question: What use is a skateboard?
Dave: Skateboards have wheels.
Mark: My wheel has a wheel!
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|