Migrating a Node from cgroup v1 to cgroup v2

CAUTION
Moving your operating system from cgroup v1 to cgroup v2 is outside the scope of HPE. It is not HPE's responsibility. Please check your operating system vendor's documentation for the right steps. The steps below are what we followed in our test lab. Use them only as a reference, and test them in a non-production environment first.

For Red Hat 8.10

  1. Check current state:
    #stat -fc %T /sys/fs/cgroup/
    tmpfs
    • tmpfs → v1 (legacy/hybrid), needs flipping

    • cgroup2fs → already v2, done
  2. Switch kernel to cgroup v2:
    sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=1 systemd.legacy_systemd_cgroup_controller=0"
    sudo grubby --info=ALL | grep args
  3. Reboot:
    sudo reboot
  4. Check current state:
    stat -fc %T /sys/fs/cgroup/
    cgroup2fs

For suse SP7 and SP5

  1. Check current state:
    #stat -fc %T /sys/fs/cgroup/
    tmpfs
    • tmpfs → v1 (legacy/hybrid), needs flipping

    • cgroup2fs → already v2, done

  2. Inspect current GRUB cmdline:
    grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub
  3. Set the two kernel flags correctly:
    • Enable unified hierarchy (cgroup v2):
      sudo sed -i 's/systemd.unified_cgroup_hierarchy=0/systemd.unified_cgroup_hierarchy=1/' /etc/default/grub
    • Disable legacy controller (set to 0):
      sudo sed -i 's/systemd.legacy_systemd_cgroup_controller=1/systemd.legacy_systemd_cgroup_controller=0/' /etc/default/grub
      NOTE
      If either flag doesn't exist yet in the file, you need to append it to GRUB_CMDLINE_LINUX_DEFAULT manually, instead of sed replacing.
  4. Check the result. It should show systemd.unified_cgroup_hierarchy=1 systemd.legacy_systemd_cgroup_controller=0 :
    grep GRUB_CMDLINE_LINUX_DEFAULT /etc/default/grub
  5. Regenerate GRUB config:
    sudo grub2-mkconfig -o /boot/grub2/grub.cfg
    sudo grub2-mkconfig -o /boot/efi/EFI/sles/grub.cfg
  6. Reboot:
    sudo reboot
  7. After the reboot, check again. It should print cgroup2fs :
    stat -fc %T /sys/fs/cgroup/
    cgroup2fs