Comment 28 for bug 1373513

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/148747
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=eb7bb3e08c1b8e1008ba447b842b635821e2097e
Submitter: Jenkins
Branch: master

commit eb7bb3e08c1b8e1008ba447b842b635821e2097e
Author: John Griffith <email address hidden>
Date: Tue Jan 20 16:31:57 2015 -0700

    Enable use of an /etc/cinder/lvm.conf file

    During tempest and Rally runs we've noticed occasional
    LVM command hangs (lvs, vgs and pvs), we've also gathered
    enough data to show that we see very slow response times from
    these commands almost all of the time.

    It turns out that this seems to be an issue with us scanning
    all devices during LVM operations, including devices that may
    be Cinder Volumes that are attaching and detaching from the system.

    Inspecting a run instrumented with strace shows a number of LVM
    commands timing out due to the device being scanned being removed
    during scan, and the LVM command in turn waiting until it times out
    on the scan that's in process.

    This patch just adds the ability to setup a lvm.conf file in
    /etc/cinder. The Cinder LVM code will now specifically set
    the LVM_SYSTEM_DIR environment variable to that directory for
    each of the LVM scan commands in brick/local_dev/lvm.py.
    If the system doesn't have the file, we use the empty string
    which tells LVM to use it's defaults. This only affects LVM
    commands in Cinder, the idea is to ensure we don't impact any
    other LVM operations on the node outside of Cinder and that we
    behave as we always have in the case of no lvm.conf file being
    setup in /etc/cinder. The presence of the file is auto-detected
    on brick/localdev/lvm init.

    We'll update the OpenStack Devstack deployment scripts to put this
    together and fix things up there first. Until that's done and until
    we auto-generate the conf (or document it well), this will be a
    *partial* bugfix.

    I considered adding a default lvm.conf file to cinder/etc/<sample>
    that would be copied in on install, but decided against this to
    avoid any possible issues with compatability issues between
    platforms or versions.

    To use, just copy the /etc/lvm/lvm.conf file to /etc/cinder and
    modify the filter as appropriate, for example:
      To use loopback device only:
        filter = [ "a/loop/", "r/.*/" ]
      If you have a physical drive like /dev/sdb1
        filter = [ "a/dev/sdb1/", "r/.*/" ]

    Finally, this patch also goes through and cleans up our cmd
    variables in brick/localdev/lvm. We had a mix of using a
    cmd array, and strings; this causes inconsistencies and makes
    it difficult to extend or modify commands. Switch everything to
    using an array and use extend to provide the correct prefix.

    Need to update docs to include a recommendation to create an
    /etc/cinder/lvm.conf file and set device filters appropriately.
    Doc-Impact
    Partial-Bug: #1373513

    Change-Id: Ia2289197a6d7fcfc910ee3de48e0a2173881a1e6