Skip to content

Commit b0c0b5f

Browse files
committed
docs: how to create the parent cgroup + delegate controllers
mkdir under the cgroup-v2 hierarchy, enable cpu/memory in subtree_control (root-level fallback), and persist via systemd-tmpfiles since cgroupfs is memory-backed. The :missing_parent_cgroup boot failure points here.
1 parent 23a5883 commit b0c0b5f

1 file changed

Lines changed: 25 additions & 1 deletion

File tree

docs/cookbook/intro.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,31 @@ printf 'dm_snapshot\ndm_thin_pool\nloop\n' | sudo tee /etc/modules-load.d/hyper.
143143
/usr/local/bin/hyper-suidhelper
144144
```
145145
- A **parent cgroup** named by `cgroup_parent` (default `hyper`) must exist
146-
under `/sys/fs/cgroup`; Hyper creates each VM's cgroup beneath it.
146+
under the cgroup-v2 hierarchy; Hyper creates each VM's cgroup beneath it and
147+
fails to boot with `:missing_parent_cgroup` if it is absent. Create it and
148+
delegate the `cpu` and `memory` controllers so the per-VM cgroups can set
149+
`cpu.max` / `memory.max`:
150+
151+
```sh
152+
sudo mkdir -p /sys/fs/cgroup/hyper
153+
echo '+cpu +memory' | sudo tee /sys/fs/cgroup/hyper/cgroup.subtree_control
154+
```
155+
156+
If that last write errors, the root hierarchy is not delegating those
157+
controllers down yet - enable them there first, then retry the line above:
158+
159+
```sh
160+
echo '+cpu +memory' | sudo tee /sys/fs/cgroup/cgroup.subtree_control
161+
```
162+
163+
The cgroup hierarchy is memory-backed, so `/sys/fs/cgroup/hyper` does **not**
164+
survive a reboot. Re-create it each boot, or persist it with
165+
`systemd-tmpfiles`:
166+
167+
```sh
168+
echo 'd /sys/fs/cgroup/hyper 0755 root root -' \
169+
| sudo tee /etc/tmpfiles.d/hyper-cgroup.conf
170+
```
147171
- The host UID/GID range given by `uid_gid_range` must be free for Hyper to
148172
allocate per-VM users from.
149173

0 commit comments

Comments
 (0)