Discussion:
[systemd-devel] Running containers under freezer
Bhasker C V
2021-04-02 19:22:01 UTC
Permalink
Hi,
Please could someone help ?

I want my containers to run inside a freezer cgroup so that I can freeze
and thaw the container as and when needed.

I use the command

systemd-nspawn [...] --slice=bhasker.slice
and systemd creates
bhasker.slice and puts everything under it. The slice however is for memory
only.
I dont seem to be able to specify successfully how to use freezer in the
slice

If I do specify --slice=memory,freezer:bhasker I end up getting something
like this

Control group /:
-.slice
├─memory\x2cfreezer:bhasker.slice
...

(the coma is taken literally as \x2c)
How do I get systemd-nspawn to also run the slice under freezer controller
of my choice ?
Thanks in advance
Lennart Poettering
2021-04-06 16:24:12 UTC
Permalink
Post by Bhasker C V
Hi,
Please could someone help ?
I want my containers to run inside a freezer cgroup so that I can freeze
and thaw the container as and when needed.
I this on cgroupsv1?

We simply don't support the freezer on cgroupsv1, it's just too messy
of an interface.

It's supported fine on cgroupsv2 with a recent systemd version, where
you'll have "systemctl freeze", and things should just work.

Lennart

--
Lennart Poettering, Berlin
Bhasker C V
2021-05-09 18:50:57 UTC
Permalink
Perfect ! that exactly is what i was looking for. ! fantastic !
Post by Lennart Poettering
Post by Bhasker C V
Hi,
Please could someone help ?
I want my containers to run inside a freezer cgroup so that I can freeze
and thaw the container as and when needed.
I this on cgroupsv1?
We simply don't support the freezer on cgroupsv1, it's just too messy
of an interface.
It's supported fine on cgroupsv2 with a recent systemd version, where
you'll have "systemctl freeze", and things should just work.
Lennart
--
Lennart Poettering, Berlin
Loading...