[Devel] Re: trying to build simple checkpoint/restart recipes

Serge E. Hallyn serge.hallyn at canonical.com
Wed Dec 8 06:52:45 PST 2010


Quoting Matt Helsley (matthltc at us.ibm.com):
> > So far, so good.  Note that I couldn't use upstart for my init bc upstart
> > uses inotify, which we don't yet checkpoint.  The kernel is compiled without
> 
> Interesting, I didn't know that. What does upstart use inotify for?

Dunno :)  I was quite put out though.

> > There are two issues:
> > 
> > 1. how to re-create the mounts.  Kernel doesn't do it yet.  There
> >    isn't (that I know of) a clean way to hook lxc-restart to do it.
> >    Comments?
> 
> It's incomplete but I think you can save the most important portions of
> a mount namespace with a simple 1-line command:
> 
> lxc-attach -n cr1 cat /proc/self/mountinfo > cr1.mountinfo
> 
> It's incomplete because:
> 
> 	1. It does not adequately address cross-mount-ns bind mounts (IIRC).
> 
> 	2. It won't work for nested containers (though I don't know if
> 		lxc supports this already it's not *too* far fetched
> 		to expect folks will ask for it in the future). We can
> 		extend the hack to deal with this by making a small
> 		change in sys_checkpoint but I can't see how to fix #1
> 		without doing it all in-kernel anyway.

Heck, for these examples I don't mind just having a sort of dummy
fstab file which both the dummy init and restart use.

> The restoration of the mounts is not scriptable however. It involves
> parsing the mountinfo file and coordinating the mounts with those done by
> lxc itself during lxc-restart. I honestly haven't looked at that closely

I'd be fine with requiring some bit of hand-parsing.  But right, even
once we get a list of the mounts to be restored, I don't know of any
good way to get those mounts re-created at the right time.

I suppose I could hack lxc-restart to do it.  But I'm sort of hoping we
can get something less hacked and more true to the 'real' upstream
code.

> enough yet to say how pretty/ugly that'd be but it entails
> modifications to lxc-restart itself. And since #1 above would still
> be an issue I'm not sure it's worth doing it that way.

So do you know of anyone who's been working on re-creation of mounts
in the kernel?  If not, what have you been doing, hand-scripting
all container creation, checkpoint, and restart?

thanks,
-serge
_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list