[systemd-devel] systemd and process migration

Dimitri John Ledkov dimitri.j.ledkov at intel.com
Mon Apr 20 11:52:17 PDT 2015


Heya,

On 20 April 2015 at 06:59, Adrian Reber <adrian at lisas.de> wrote:
> Using CRIU I have been migrating processes from one system to another
> for the last few months (even years). I am now interested in migrating
> processes under systemd's control. Before starting to look how to make
> it work I wanted to know if there has been any discussion if and how
> systemd and CRIU can work together?
>
> Dumping a process under systemd's control should be no problem.
> After criu has dumped the process (and killed it) systemd should know
> that it does not need to restart the process, but even if the process is
> restarted by systemd it does not hurt the process migration.
>
> The interesting part happens on the system where the process wants to be
> migrated to. After the process has been dumped and transfered from the
> source system to the destination system it needs to be restarted. So far
> this works with different tested processes (postgresql is my current
> test process). If I want to restore the process as a systemd child
> process I have the problem that the process would have to be re-parented
> to systemd after restarting which is not possible in Linux. Therefore I
> need the help of systemd.
>
> My plan now would be to transfer the process to the destination
> system and tell systemd I want to restore a process which should be
> under systemd's control after the restore has completed. Therefore
> systemd needs to run criu with the option to restore the new process as
> a criu sibling. Thus systemd would be the correct parent process.
>
> Is this something which would be useful to integrate into systemd?
> I have some ideas how this could be implemented and how the user
> interfaces could look like. Before going in too much detail I want to
> find out if this is a direction which makes sense.

So systemd has re-exec support. I would go down the route of trying to
serialise the systemd state of the process as well on the orginal
host, and then deserialise it on the target. I haven't done anything
with re-exec serialisation on systemd yet, so no idea how sufficient
that would be to "side-load" a process like that. It will be fragile.

Going down the route of machinectl api / containers sounds more
interesting. As there is more support for importing those. E.g.
instead of importing a tarball and execing, it, one unfreezes it.

-- 
Regards,

Dimitri.
Pura Vida!

https://clearlinux.org
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.


More information about the systemd-devel mailing list