All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR
@ 2010-02-24  8:34 Sukadev Bhattiprolu
       [not found] ` <20100224083452.GB18758-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 17+ messages in thread
From: Sukadev Bhattiprolu @ 2010-02-24  8:34 UTC (permalink / raw)
  To: serue-r/Jw6+rmf7HQT0dZR+AlfA, dlezcano-NmTC/0ZBporQT0dZR+AlfA,
	Oren Laadan
  Cc: Containers, sukadev-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8


Following two sets of patches is an early attempt to integrate LXC and
USER-CR. 

Overview:

Have USER-CR export the core checkpoint and restart functionality into a
library (/lib/libcheckpoint.a and <usercr.h>) and have LXC link with this
library.

TODO: 

	1. For now, libcheckpoint.a implements only the restart functionality
	   and so only lxc_restart command is implemented. Implementing the
	   checkpoint functionality and lxc_checkpoint command can be done
	   similarly and is hopefully easier than the restart functionality.

	2. The restart() functionality in user-cr makes extensive use of global
	   variables and debug code. The API must be extended to properly
	   include these variables/debug code in the API.

	   Similarly, the 'struct restart_args' may need to be sanitized for
	   use in a formal API.

	3. lxc_restart command  restarts entire containers only (specifically
	   it simulates the --pidns --pids --mount-pty arguments to
	   /bin/restart).

	4. Link lxc_restart and lxc_checkpoint with the shared library
	   liblxc.so (currently links statically)

	5. ...


STATUS:
	I was able to checkpoint/restart a simple '/bin/sleep 1000' LXC
	container, except for a cgroup naming issue after restart (see below).

STEPS:

1. [USER-CR] Build/install /lib/libcheckpoint.a, /usr/include/usercr.h
   
   1.1 Apply the attached [user-cr] patches to the user-cr git tree
       (I tested with following commit as base)

	commit 67cfee9329670ab28eb1a52e94745252b614718f
	Author: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
	Date:   Mon Feb 22 18:00:06 2010 -0500

   1.2 Build/install user-cr binaries/libraries/includes

   	$ make all

	$ make install

	This should install /lib/libcheckpoint.a and /usr/include/usercr.h

2. [LXC] Build lxc_restart using USER-CR API (usercr.h, libcheckpoint.a)

   2.1 Apply attached [lxc] patches to Daniel Lezcano's lxc.git tree (0.6.5)

   2.2 Build lxc_restart (this uses static linking for now)

   	$ make -f Makefile2 lxc_restart

3. Create and checkpoint a simple LXC container

	$ lxc-execute --name foo --rcfile lxc-macvlan.conf -- /bin/sleep 1000

	$ lxc-freeze --name foo

	TODO: 
		lxc_checkpoint --name foo should checkpoint the container,
		For now, use "lxc-ps --name foo" to find pid of lxc-init and
		checkpoint using:

		$ /bin/checkpoint --output=/tmp/sleep.ckpt <pid-of-lxc-init>

	$ lxc-unfreeze --name foo

	$ lxc-stop --name foo

4. Restart a checkpointed LXC container

	$ ./lxc_restart --statefile /tmp/sleep.ckpt --name bar

   	# Test some common lxc commands after restart

	$ lxc-ps --name "bar/1"
	CONTAINER    PID TTY          TIME CMD
	bar/1       8511 ?        00:00:00 lxc-init
	bar/1       8512 ?        00:00:00 sleep

	$ lxc-freeze --name "bar/1"

	$ grep State /proc/8511/status 
	State:	D (disk sleep)

	$ grep State /proc/8512/status 
	State:	D (disk sleep)

	NOTE: 	For some reason, the container name after restart is "bar/1"
		instead of "bar".  Due to this, when the lxc_restart is
		exiting, I get a "-EBUSY - failed to remove "/cgroup/bar"
		error.  I need to fix this still.

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-03-03 15:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-24  8:34 [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR Sukadev Bhattiprolu
     [not found] ` <20100224083452.GB18758-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-24  8:35   ` [PATCH 1/4][user-cr] Move common definitions to restart.h Sukadev Bhattiprolu
     [not found]     ` <20100224083534.GC18758-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-03  0:04       ` [PATCH] c/r: fix regression (in "fix scheduling in atomic while restoring ipc shm") Oren Laadan
     [not found]         ` <1267574649-14269-1-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-03-03 15:38           ` Serge E. Hallyn
2010-02-24  8:36   ` [PATCH 2/4][user-cr] Rename struct args to struct restart_args Sukadev Bhattiprolu
2010-02-24  8:36   ` [PATCH 3/4][user-cr] Move main() in restart.c to restart-main.c Sukadev Bhattiprolu
2010-02-24  8:37   ` [PATCH 4/4][user-cr] Rename libeclone.a to libcheckpoint.a Sukadev Bhattiprolu
     [not found]     ` <20100224083726.GF18758-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-24 15:19       ` Serge E. Hallyn
     [not found]         ` <20100224151919.GB6425-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-24 22:26           ` Sukadev Bhattiprolu
2010-02-26 21:53       ` Oren Laadan
     [not found]         ` <4B8842C8.9080707-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-02-27  1:44           ` Sukadev Bhattiprolu
2010-02-24 15:15   ` [RFC][PATCH 0/4][user-cr]: First try at integrating LXC and USER-CR Serge E. Hallyn
2010-02-24 18:25   ` Cedric Le Goater
2010-02-26 21:52   ` Oren Laadan
     [not found]     ` <4B88429B.4000701-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-02-27  0:10       ` Sukadev Bhattiprolu
     [not found]         ` <20100227001002.GA22965-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-27  2:14           ` Oren Laadan
2010-03-01 21:22   ` Oren Laadan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.