[CRIU] Restarting Process in an LXC Container

Thouraya TH thouraya87 at gmail.com
Thu Jan 22 10:02:12 PST 2015


Yes.
@Tycho: i have asked this question on the list:



*On what depends the size of a checkpoint of a container? the size of data
that are in the container ? if i increase the size of data in a container,
the snapshot's size increase ?*

and you have said:


*The size of the RAM, lxc-checkpoint is a frontend for CRIU, and CRIUdumps
only memory state (well, and "ghost" file state). *

i have asked this question because, when i increase the size of my program
at runtime, then dumping process, the size of a snapshot is still the same
for different sizes.

I have tested now. instead of lxc-attach, i have used ssh and the size of a
snapshot changes increases :)


Bests.



2015-01-22 18:54 GMT+01:00 Tycho Andersen <tycho.andersen at canonical.com>:

> On Thu, Jan 22, 2015 at 05:49:50PM +0100, Thouraya TH wrote:
> > Yes, it is fine with *ssh* and without *lxc-attach* :)
>
> Right, I guess this is the same problem as in the other thread (i.e.
> the dump fails because the attached process is in a different group)?
>
> Tycho
>
> > Thanks a lot :)
> > Bests.
> >
> > 2015-01-22 17:47 GMT+01:00 Pavel Emelyanov <xemul at parallels.com>:
> >
> > > 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
> > >
> > >
>
> > _______________________________________________
> > CRIU mailing list
> > CRIU at openvz.org
> > https://lists.openvz.org/mailman/listinfo/criu
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openvz.org/pipermail/criu/attachments/20150122/0ae54014/attachment.html>


More information about the CRIU mailing list