System is reporting wrong free space for multipath disks with nova-local partitions

Bug #2007309 reported by Felipe Sanches Zanoni
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
Felipe Sanches Zanoni

Bug Description

Brief Description
-----------------
The command system host-disk-list is not reporting correctly the free space when creating a new partition and adding it to nova-local logical volume group.

This only happens on with multipath enabled.

Severity
--------
Minor

Steps to Reproduce
------------------
 - Fresh install AIO-SX with multipath enabled;
 - With controller locked, create a new partition on any disk with any size that does not use the entire disk;
 - Add this partition to nova-local lvm;
 - Unlock controller;
 - Check if the disk shows free space when running system host-disk-list controller-0 command.

Expected Behavior
------------------
The free space column will show the correct information about free space on the disk with nova-local partition.

Actual Behavior
----------------
The free space column is showing 0 (zero) despite there is free space on the disk with nova-local partition.

Reproducibility
---------------
100%

System Configuration
--------------------
System using multipath disks

Branch/Pull Time/Commit
-----------------------
STX 7.0 with multipath enabled

Last Pass
---------
N/A

Timestamp/Logs
--------------
N/A

Test Activity
-------------
Developer Testing

Workaround
----------
No workaround

Changed in starlingx:
assignee: nobody → Felipe Sanches Zanoni (fsanches)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to config (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/starlingx/config/+/874087

Changed in starlingx:
status: New → In Progress
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Low
tags: added: stx.storage
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to config (master)

Reviewed: https://review.opendev.org/c/starlingx/config/+/874087
Committed: https://opendev.org/starlingx/config/commit/b0eb83f6acab94335648b48e496278eb85fbaac7
Submitter: "Zuul (22348)"
Branch: master

commit b0eb83f6acab94335648b48e496278eb85fbaac7
Author: Felipe Sanches Zanoni <email address hidden>
Date: Tue Feb 14 11:39:14 2023 -0500

    Adjust function to report correctly free space for multipath disks

    The command host-disk-list was reporting free space wrongly for
    multipath disks that have partitions added to nova-local
    logical volume.

    This happens when the device node path has a dash in it like in
    '/dev/mapper/mpathc-part1'. A 'grep -w' command was used to verify
    if the device node is a physical volume. The command 'grep -w'
    searchs for whole word, but the dash is considered a word separator,
    causing the device node '/dev/mapper/mpathc' to be matched with
    '/dev/mapper/mpathc-part1', once 'grep -w' detects the word
    '/dev/mapper/mpathc'.

    To fix this, the command is changed to detect the device node as
    a string with an extra space at the end, for instance,
    '/dev/mapper/mpathc '.

    As an example consider device_node='/dev/mapper/mpathc' and
    the output of 'pvs' command below:
      PV VG Fmt Attr PSize PFree
      /dev/mapper/mpatha-part5 cgts-vg lvm2 a-- <488.41g 251.59g
      /dev/mapper/mpathb cgts-vg lvm2 a-- <20.00g <20.00g
      /dev/mapper/mpathc-part1 cgts-vg lvm2 a-- <15.00g <15.00g

    The 'pvs | grep -w /dev/mapper/mpathc' will match the string
    '/dev/mapper/mpathc-part1', but it should not.

    The 'pvs | grep "/dev/mapper/mpathc "' will not match any
    string in that output.

    Test Plan:
        PASS: Install AIO-SX with multipath disks, add a new partition
              to a spare multipath disk using half of its capacity.
              Add this partition to nova-local logical volume group and
              run 'system host-disk-list controller-0'. The available_gib
              column should report the expected free space correctly.
        PASS: Install AIO-SX without multipath disks, add a new partition
              to a spare disk using half of its capacity.
              Add this partition to nova-local logical volume group and
              run 'system host-disk-list controller-0'. The available_gib
              column should report the expected free space correctly.

    Closes-bug: 2007309
    Signed-off-by: Felipe Sanches Zanoni <email address hidden>
    Change-Id: If7636f39c0ff3d0858623d7ada8a391fd783ca32

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.9.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.