[CRIU] Restarting Process in an LXC Container
Pavel Emelyanov
xemul at parallels.com
Thu Jan 22 08:47:47 PST 2015
On 01/22/2015 07:41 PM, Thouraya TH wrote:
> *Dumping Process* with - s option:
>
> root at g-9:/home# lxc-checkpoint *-s *-D /home/ImGLXC1Worker -n worker
> root at g-9:/home# lxc-ls -f
> NAME STATE IPV4 IPV6 GROUPS AUTOSTART
> -----------------------------------------------
> worker *STOPPED* - - - NO
>
> *I have done this test:*
> You have said: "/Check the file contents *after dump* but *before restore*. Does this file exists
> at all? Does it contain proper data?/"
>
> 1) dumping Process with -s option
> 2) root at g-9:/home/ImGLXC1Worker1# lxc-start -n worker
> root at g-9:/home/ImGLXC1Worker1# lxc-ls -f
> NAME STATE IPV4 IPV6 GROUPS AUTOSTART
> -----------------------------------------------------
> worker RUNNING 10.0.3.109 - - NO
> worker1 STOPPED - - - NO
> root at g-9:/home/ImGLXC1Worker1# ssh ubuntu@$(sudo lxc-info -n worker -H -i)
> ..............
> ubuntu at worker:/home$ vim results.txt
>
> *the file exists and contains the proper data.*
>
> 3) i stopped the container to test the restart:
> root at g-9:/home/ImGLXC1Worker1# lxc-stop -n worker
> root at g-9:/home/ImGLXC1Worker1# lxc-ls -f
> NAME STATE IPV4 IPV6 GROUPS AUTOSTART
> -----------------------------------------------
> worker STOPPED - - - NO
> worker1 STOPPED - - - NO
> root at g-9:/home/ImGLXC1Worker1# *lxc-checkpoint -r* -D /home/ImGLXC1Worker1 -n worker
> root at g-9:/home/ImGLXC1Worker1# ssh ubuntu@$(sudo lxc-info -n worker -H -i)
> ^C
> root at g-9:/home/ImGLXC1Worker1#
> root at g-9:/home/ImGLXC1Worker1# lxc-ls -f
>
> ^CTraceback (most recent call last):
> File "/usr/bin/lxc-ls", line 432, in <module>
> containers = get_containers(root=True)
> File "/usr/bin/lxc-ls", line 261, in get_containers
> if container.controllable:
> KeyboardInterrupt
>
> *it's blocked!! *
This should be forwarded to LXC guys.
> *I proceeded as follows and the test process in the container restarts correctly:
>
> Restart* (after dumping process without starting and stopping the container)
>
> root at g-9:/home# lxc-checkpoint -r -D /home/ImGLXC1Worker -n worker
> root at g-9:/home# lxc-ls -f
> NAME STATE IPV4 IPV6 GROUPS AUTOSTART
> -----------------------------------------------------
> worker RUNNING 10.0.3.109 - - NO
> worker1 STOPPED - - - NO
> root at g-9:/home# ssh ubuntu@$(sudo lxc-info -n worker -H -i)
> ..............
> ubuntu at worker:/home$ vim results.txt
>
> i find the old and the new results in the file :)
So everything is fine, isn't it?
Thanks,
Pavel
More information about the CRIU
mailing list