From 1e2e15ee877d3499faf1c38f83dff230d65e9420 Mon Sep 17 00:00:00 2001 From: git-harry Date: Tue, 2 Jun 2015 15:17:33 +0100 Subject: [PATCH] Enable udev for lvm in cinder-volume container The current configuration of LVM for cinder-volume has udev_sync=0. This means that udev is not creating the devices that appear in /dev. The device files created reference specific device numbers, and these persist between reboots. When the host is rebooted there is no guarantee that device numbers allocated to the logical volumes will match those defined in the device files. This can be observed by comparing the output of 'dmsetup info' and 'ls -l /dev/mapper'. LVM's use of udev was disabled in an attempt to protect the host from the potential that uevents generated would be processed by all containers on the host. In practise this should not be an issue because there are not other containers running on a cinder host. This commit adjusts the lvm.conf file created so that udev is used. It also adds a mount entry to create a devtmpfs on /dev. Finally 'udevadm trigger' is run to add the devices under /dev/mapper. Closes-Bug: #1436999 Change-Id: I9ab35cf4438a369563f8c08870c1acfd0cc394b0 --- templates/lvm.conf.j2 | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/templates/lvm.conf.j2 b/templates/lvm.conf.j2 index 5da4b68b..921e661c 100644 --- a/templates/lvm.conf.j2 +++ b/templates/lvm.conf.j2 @@ -19,16 +19,10 @@ {% if used_lvm_devices.append('"r/.*/"') %}{% endif %} {% endif %} -{% if is_metal == false or is_metal == "False" %} - {% set use_udev = 0 %} -{% else %} - {% set use_udev = 1 %} -{% endif %} - devices { dir = "/dev" scan = [ "/dev" ] - obtain_device_list_from_udev = {{ use_udev }} + obtain_device_list_from_udev = 1 preferred_names = [ ] filter = [ {{ used_lvm_devices|join(', ') }} ] cache_dir = "/run/lvm" @@ -96,8 +90,8 @@ global { } activation { checks = 0 - udev_sync = {{ use_udev }} - udev_rules = {{ use_udev }} + udev_sync = 1 + udev_rules = 1 verify_udev_operations = 0 retry_deactivation = 1 missing_stripe_filler = "error"