I've just upgraded a server to PVE 6.3 (pve-manager/6.3-3/eee5f901 (running kernel: 5.4.78-2-pve)) and see a sudden change in how LXC swap amount is presented. For a long time in older versions in LXC (maybe starting with 4.x) the swap size was shown and calculated as RAM+swap, but thankfully the 6.x series went back to the correct, old interpretation that shows and counts swap and RAM separately (likely because of cgroup changes). However the latest PVE 6.3 version again shows swap in LXC as RAM+swap.
Examples below.
Correct swap size (config is RAM: 8GB, swap: 2GB):
Incorrect swap size (config is RAM: 512MB, swap: 256MB):
How can I change it back to the correct calculation method above? Is that possible at all? Is it a regression (a bug) in PVE 6.x? Any hints are greatly appreciated. It currently causes issues with monitoring and some of our automation tools.
EDIT: just checked another PVE host with the same latest (6.3-3/eee5f901) version as above and it shows the correct interpretation of RAM and swap. Weird.
EDIT2: the change in swap interpretation happened between lxcfs versions 4.0.3-pve3 and 4.0.6-pve1. Just checked that a PVE 6.3 + lxcfs 4.0.3-pve3 shows the correct swap interpretation (consistent with LXC CT settings, nothing gets added to RAM size).
Examples below.
Correct swap size (config is RAM: 8GB, swap: 2GB):
Code:
# pveversion
pve-manager/6.2-15/48bd51b6 (running kernel: 5.4.73-1-pve)
# pct enter 733
# free -h
total used free shared buffers cached
Mem: 8.0G 5.2G 2.8G 22M 0B 2.2G
-/+ buffers/cache: 3.0G 5.0G
Swap: 2.0G 20M 2.0G
Incorrect swap size (config is RAM: 512MB, swap: 256MB):
Code:
# pveversion
pve-manager/6.3-3/eee5f901 (running kernel: 5.4.78-2-pve)
# pct enter 741
# free -h
total used free shared buff/cache available
Mem: 512Mi 44Mi 434Mi 8.0Mi 32Mi 467Mi
Swap: 768Mi 0B 768Mi
How can I change it back to the correct calculation method above? Is that possible at all? Is it a regression (a bug) in PVE 6.x? Any hints are greatly appreciated. It currently causes issues with monitoring and some of our automation tools.
EDIT: just checked another PVE host with the same latest (6.3-3/eee5f901) version as above and it shows the correct interpretation of RAM and swap. Weird.
EDIT2: the change in swap interpretation happened between lxcfs versions 4.0.3-pve3 and 4.0.6-pve1. Just checked that a PVE 6.3 + lxcfs 4.0.3-pve3 shows the correct swap interpretation (consistent with LXC CT settings, nothing gets added to RAM size).
Last edited: