Install and configure needed kernel modules

CRIU needs to load the netlink_diag kernel modules
in order for live-migration to work.

In xenial the kernel module is located in
linux-image-extra-`uname -r` debian package.
However in yakkety and newer kernels its found
in the regular linux kernel package.

So install the needed debian packages and modprobe
the module.

Change-Id: Ic2863472bb65507e4f033926b92c70a22a6724da
Signed-off-by: Chuck Short <chuck.short@canonical.com>
This commit is contained in:
Chuck Short 2016-06-18 19:52:58 -04:00
parent a91d72db4a
commit b60c0183d1
1 changed files with 9 additions and 0 deletions

View File

@ -47,6 +47,8 @@ from charmhelpers.contrib.storage.linux.lvm import (
remove_lvm_physical_volume,
)
from charmhelpers.core.decorators import retry_on_exception
from charmhelpers.core.kernel import modprobe
from charmhelpers.fetch import apt_install
BASE_PACKAGES = [
'btrfs-tools',
@ -393,6 +395,13 @@ def configure_lxd_host():
cmd = ['lxc', 'config', 'set',
'core.https_address', '[::]']
check_call(cmd)
if ubuntu_release == 'xenial':
apt_install('linux-image-extra-%s' % os.uname()[2],
fatal=True)
if ubuntu_release >= 'xenial':
modprobe('netlink_diag')
elif ubuntu_release == "vivid":
log('Vivid deployment - loading overlay kernel module', level=INFO)
cmd = ['modprobe', 'overlay']