From e89cad554c5db3a04306e4eca7d7ec7ae3a2da79 Mon Sep 17 00:00:00 2001 From: James Page Date: Wed, 23 Sep 2015 08:56:09 +0100 Subject: [PATCH] Enable and start lvm2-lvmetad for lvm configuration --- hooks/lxd_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hooks/lxd_utils.py b/hooks/lxd_utils.py index bd51c49..766dad3 100644 --- a/hooks/lxd_utils.py +++ b/hooks/lxd_utils.py @@ -170,6 +170,12 @@ def configure_lxd_block(): list_lvm_volume_group(dev) == 'lxd_vg'): log('Device already configured for LVM/LXD, skipping') return + # Enable and startup lvm2-lvmetad to avoid extra output + # in lvm2 commands, which confused lxd. + cmd = ['systemctl', 'enable', 'lvm2-lvmetad'] + check_call(cmd) + cmd = ['systemctl', 'start', 'lvm2-lvmetad'] + check_call(cmd) create_lvm_physical_volume(dev) create_lvm_volume_group('lxd_vg', dev) cmd = ['lxc', 'config', 'set', 'storage.lvm_vg_name', 'lxd_vg']