[SOLVED] CT is assigned swap space but appears to have none.

rcd

Well-Known Member
Jul 12, 2019
246
25
58
63
Proxmox 6.4 host with ZFS. Created LXC container with 1 GB RAM and 1 GB swap. From Proxmox everything seems fine, but in the container there is just the RAM, no sign of swap.

I think there is something about ZFS not using swap, but then why does the GUI allow me to assign it?
What is the proper way to assign swap to this container?
 
hi,

is swapping enabled on the host? check with swapon -s on your PVE server.

also please post the container configuration (pct config CTID)
 
swapon -s on the host reports nothing.

Code:
# pct config <redacted>
arch: amd64
cores: 2
description: <redacted>
features: fuse=1,nesting=1
hostname: host1
memory: 2048
net0: name=eth0,bridge=vmbr0,firewall=1,gw=<redacted>,hwaddr=<redacted>,ip=<redacted>/32,type=veth
onboot: 1
ostype: debian
rootfs: vmdata:subvol-3706-disk-0,size=80G
swap: 2048
unprivileged: 1
 
Last edited:
swapon -s on the host reports nothing.
okay, without swap on your host you won't be able to have swap in the container.

to have swap with a ZFS root, you'll need to create a new partition and enable swap on that. afterwards add that partition inside /etc/fstab to make it come up on boot.