[lxc-users] No swap space inside containers

Luis Felipe Marzagao lfbm.andamentos at gmail.com
Sat Aug 8 15:20:17 UTC 2020


Swap is ok on the host:

manager at andromeda:~$ sudo swapon --show
NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition   2G 256K    5
/dev/zram1 partition   2G 256K    5
/dev/zram2 partition   2G 256K    5
/dev/zram3 partition   2G   0B    5
/swapfile  file        2G   0B   -2

manager at andromeda:~$ free -h
               total        used        free      shared buff/cache   
available
Mem:            15G         11G        809M         53M 3.0G        3.5G
Swap:          9.8G        768K        9.8G

But there is no swap inside containers:

manager at andromeda:~$ lxc exec pbx -- free -h
               total        used        free      shared buff/cache   
available
Mem:            15G        546M         14G         50M 187M         14G
Swap:            0B          0B          0B

manager at andromeda:~$ lxc exec sombrero -- free -h
               total        used        free      shared buff/cache   
available
Mem:            15G        630M         14G        164K 102M         14G
Swap:            0B          0B          0B

I didn´t change any settings regarding swap or memory. This is a pretty 
standard ubuntu + lxd installation.

manager at andromeda:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.4 LTS"

manager at andromeda:~$ snap list
Name    Version    Rev    Tracking       Publisher   Notes
core    16-2.45.2  9665   latest/stable  canonical✓  core
core18  20200724   1885   latest/stable  canonical✓  base
lxd     4.4        16530  latest/stable  canonical✓  -

Any pointers?

Thanks  a lot.




More information about the lxc-users mailing list