[CRIU] Restore CRIU image across a host

Tycho Andersen tycho.andersen at canonical.com
Wed Aug 5 06:39:29 PDT 2015


Hi Hui,

On Tue, Aug 04, 2015 at 11:15:25PM -0400, Hui Kang wrote:
> Hi, Tycho
> I created a patch
> (http://lists.openvz.org/pipermail/criu/2015-August/021576.html) and
> pass cgrou_manage as CG_MODE_FULL to the criu service. From the
> restore.log, I can see that criu will smartly create all the cgroup
> directories. However, the restore still fails at this cpu of wrting to
> 
> (cgroup.c:901): cg: Can't move into cpuset//[PID]/tasks (-1/0): No
> space left on device
> (00.082249) Error (cr-restore.c:1919): Restoring FAILED.
> 
> As Tycho pointed that:
> 
> >> >        ENOSPC Attempted to write(2) the process ID (PID) of  a  process
> >> > to  a  cpuset
> >> >               tasks file when the cpuset had an empty cpuset.cpus or empty
> >> > cpuset.mems
> >> >               setting.
> >> >
> >> >        ENOSPC Attempted to write(2) an empty cpuset.cpus or cpuset.mems
> >> > setting  to  a
> >> >               cpuset that has tasks attached.

There are a few different things going on here,

> I verify that cpuset.cpus (created by CRIU full cg manage) in the
> destination host is empty, while cpuset.cpus in the source host is
> "0-3".
> 
> Further, when I attemped to write "0-3" to the cpuset.cpus in the
> destination host before restoring, it gave permission error.
> 
> echo "0-3" > /sys/fs/cgroup/cpuset/[PID]/cpuset.cpus
> -bash: echo: write error: Permission denied

You're probably not root here, so you need to do something like:

$ echo "0-3" | sudo tee /sys/fs/cgroup/cpuset/foo/cpuset.cpus
0-3

otherwise you'll get EPERM.

> Should CRIU write some default value to the cpuset.cpus file when
> creating the director? This could help restoring processes with cgroup
> across host. If so, I would be more than happy to work on a patch.
> Thanks.

It should already try to do this in restore_special_cpuset_props(),
although it seems that bit isn't working for you. If you want to
debug, that's probably a good place to start.

Tycho


More information about the CRIU mailing list