From b60c0183d1a14bf3b6a62baa365dc349c4017e77 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Sat, 18 Jun 2016 19:52:58 -0400 Subject: [PATCH] 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 --- hooks/lxd_utils.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hooks/lxd_utils.py b/hooks/lxd_utils.py index 6621c60..bb6f89d 100644 --- a/hooks/lxd_utils.py +++ b/hooks/lxd_utils.py @@ -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']