Bug 1523232 - localdisk cannot access the ovirt-local VG if a strict LVM filter is configured
Summary: localdisk cannot access the ovirt-local VG if a strict LVM filter is configured
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: vdsm
Classification: oVirt
Component: Core
Version: 4.20.15
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.9
: ---
Assignee: Nir Soffer
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-07 13:14 UTC by Nir Soffer
Modified: 2018-01-24 10:39 UTC (History)
3 users (show)

Fixed In Version: vdsm v4.19.44
Clone Of:
Environment:
Last Closed: 2018-01-24 10:39:55 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: ovirt-4.2+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 85178 0 master MERGED localdisk: Support host LVM filter 2017-12-07 14:50:58 UTC
oVirt gerrit 85237 0 ovirt-4.1 MERGED localdisk: Support host LVM filter 2017-12-17 07:52:23 UTC

Description Nir Soffer 2017-12-07 13:14:38 UTC
Description of problem:

If a user has configured LVM using ``vdsm-tool config-lvm-filter``, the localdisk
hook cannot access the ovirt-local VG.

User visible symptoms are failing to start a VM using the localdisk hook.

If the user did not configure LVM filter, or if the LVM filter includes the 
ovirt-local VG devices, the localdisk hook is not effected.

Version-Release number of selected component (if applicable):
4.20.9

How reproducible:
Always

Steps to Reproduce:

1. Configure lvm filter on a host:

   $ echo yes | vdsm-tool config-lvm-filter

2. Create ovirt-local vg on a host
   (assuming /dev/sdb1 is an unused device to be used by the ovirt-local vg)

   $ pvcreate /dev/sdb1
   $ vgcreate ovirt-local /dev/sdb1
   $ lvcreate --type thin-pool -L100g -n pool0 ovirt-local

3. Configure a vm with the localdisk custom property
   (both "lvm" and "lvmthin" should be tested)

4. Start the vm on the host configured in step 2

Actual results:
VM fail to start

Expected results:
VM started successfuly

Workaround:
Add the ovirt-local pvs to the lvm filter:

    filter = [ "a|^/dev/sda2$|", "a|^/dev/sdb1|", "r|.*|" ]

With this filter, vdsm-tool config-lvm-filter will refuse to configure the 
filter automatically.

Comment 1 Nir Soffer 2017-12-07 13:28:51 UTC
Here is a session showing how to test that the localdisk-helper is working properly.

The localdisk-helper is internal command used by the localdisk hook to manage logical
volumes.

1. This host has a strict filter, hiding the ovirt-local vg:

# lvmconfig devices/filter
filter=["a|^/dev/vda2$|","r|.*|"]

2. Only the host system lvs are visible by default

# lvs
  LV      VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lv_home vg0 -wi-ao---- 924.00m                                                    
  lv_root vg0 -wi-ao----  14.60g                                                    
  lv_swap vg0 -wi-ao----   4.00g     
                                               
3. The admin can access the ovirt-local vg using a permissive filter

# lvs --config 'devices {filter=["a|.*|"]}' ovirt-local
  LV    VG          Attr       LSize  Pool  Origin Data%  Meta%  Move Log Cpy%Sync Convert
  pool0 ovirt-local twi---tz-- 40.00g              0.00   0.49                            
  test  ovirt-local Vwi-a-tz-- 10.00g pool0        0.00                                   
 
4. The localdisk-helper can access the vg

# /usr/libexec/vdsm/localdisk-helper -h
usage: localdisk-helper [-h] {list,create,remove,change} ...
oVirt local disk hook helper
optional arguments:
  -h, --help            show this help message and exit
commands:
  {list,create,remove,change}
    list                return a json with the the lv attributes, tags, and
                        size
    create              Create a LV. return nothing
    remove              Remove a LV. return nothing
    change              Update a LV. return nothing
                 
# /usr/libexec/vdsm/localdisk-helper list test
  {
      "report": [
          {
              "lv": [
                  {"lv_name":"test", "lv_attr":"Vwi---tz--", "lv_tags":"updating", "lv_size":"10737418240"}
              ]
          }
      ]
  }
# /usr/libexec/vdsm/localdisk-helper create --addtag updating --size 1g test2

# /usr/libexec/vdsm/localdisk-helper list test2
  {
      "report": [
          {
              "lv": [
                  {
                      "lv_name":"test2",
                      "lv_attr":"-wi-a-----",
                      "lv_tags":"updating",
                      "lv_size":"1073741824"
                  }
              ]
          }
      ]
  }
# /usr/libexec/vdsm/localdisk-helper change --deltag updating test2

# /usr/libexec/vdsm/localdisk-helper change --deltag updating test

# /usr/libexec/vdsm/localdisk-helper list test2
  {
      "report": [
          {
              "lv": [
                  {
                      "lv_name":"test2",
                      "lv_attr":"-wi-a-----",
                      "lv_tags":"",
                      "lv_size":"1073741824"
                  }
              ]
          }
      ]
  }

# /usr/libexec/vdsm/localdisk-helper list test
  {
      "report": [
          {
              "lv": [
                  {
                      "lv_name":"test",
                      "lv_attr":"Vwi---tz--",
                      "lv_tags":"", 
                      "lv_size":"10737418240"
                  }
              ]
          }
      ]
  }

# /usr/libexec/vdsm/localdisk-helper remove test

# /usr/libexec/vdsm/localdisk-helper remove test2

# /usr/libexec/vdsm/localdisk-helper list test
  {
      "report": [
          {
              "lv": [
              ]
          }
      ]
  }

# /usr/libexec/vdsm/localdisk-helper list test2
  {
      "report": [
          {
              "lv": [
              ]
          }
      ]
  }

Comment 2 Kevin Alon Goldblatt 2018-01-22 16:42:27 UTC
Verified with the following code:
-------------------------------------------
vdsm-4.19.45-1.el7ev.x86_64
ovirt-engine-4.1.9.1-0.1.el7.noarch

Verified with the following scenario:
-------------------------------------------

Steps to Reproduce:

1. Configure lvm filter on a host:

   $ echo yes | vdsm-tool config-lvm-filter

2. Create ovirt-local vg on a host
   (assuming /dev/sdb1 is an unused device to be used by the ovirt-local vg)

   $ pvcreate /dev/sdb1
   $ vgcreate ovirt-local /dev/sdb1
   $ lvcreate --type thin-pool -L100g -n pool0 ovirt-local

3. Configure a vm with the localdisk custom property
   (both "lvm" and "lvmthin" should be tested)

4. Start the vm on the host configured in step 2

Actual results:
VM started

Moving to VERIFIED!

Comment 3 Sandro Bonazzola 2018-01-24 10:39:55 UTC
This bugzilla is included in oVirt 4.1.9 release, published on Jan 24th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.1.9 release, published on Jan 24th 2018, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.