Kernel Centos 7 on LXD


(Dwi Agriyanto) #1

Hi, i’m new here . and i want to ask something . I’ve install LXD on my ubuntu 18.04 and create a container Centos 7 .
After installing and check the kernel its not like kernel for centos but like for ubuntu .

[root@LB ~]# uname -a
Linux LB 4.15.0-39-generic #42-Ubuntu SMP Tue Oct 23 15:48:01 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@LB ~]# uname -r
4.15.0-39-generic
[root@LB ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

cuz i want to install ipvsadm and keepalived or docker-ce and start a service always got error…

[root@LB ~]# systemctl status ipvsadm
● ipvsadm.service - Initialise the Linux Virtual Server
Loaded: loaded (/usr/lib/systemd/system/ipvsadm.service; disabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue 2018-11-27 02:19:23 UTC; 4s ago
Process: 372 ExecStart=/bin/bash -c exec /sbin/ipvsadm-restore < /etc/sysconfig/ipvsadm (code=exited, status=2)
Main PID: 372 (code=exited, status=2)

Nov 27 02:19:23 LB systemd[1]: Starting Initialise the Linux Virtual Server…
Nov 27 02:19:23 LB bash[372]: Can’t initialize ipvs: Protocol not available
Nov 27 02:19:23 LB bash[372]: Are you sure that IP Virtual Server is built in the kernel or as module?
Nov 27 02:19:23 LB bash[372]: Can’t initialize ipvs: Protocol not available
Nov 27 02:19:23 LB bash[372]: Are you sure that IP Virtual Server is built in the kernel or as module?
Nov 27 02:19:23 LB systemd[1]: ipvsadm.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Nov 27 02:19:23 LB systemd[1]: Failed to start Initialise the Linux Virtual Server.
Nov 27 02:19:23 LB systemd[1]: Unit ipvsadm.service entered failed state.
Nov 27 02:19:23 LB systemd[1]: ipvsadm.service failed.

my LXD version is 3.0.2

any suggestion of this ?
thanks!


(Stéphane Graber) #2

Containers are different from VMs specifically because they use the same kernel as the host.

More than not running the right kernel, the errors you’re getting are most likely because some kernel modules must be pre-loaded for that container to be happy. You should figure out which ones those are (likely ip_vs in the first case) and then put those in linux.kernel_modules in your container config, so that they get pre-loaded when the container starts.


(Dwi Agriyanto) #3

oh oke, thats make sense,

so i must config ‘lxc config edit LB’ and insert linux.kernel_modules into it ?? or something else?

can you tell me detail ? sorry, i didn’t what to do :smiley: