Browse Source

Add 'Container' field for MD parser

The logic of filtering of fake RAID MD heavily relies on the
presence of of 'Container' field inside of parsed data.
If this field is missing, it will never figure out the name of any
fake RAID devices and its component.

This patch adds this field to a parser.

In addition to that, it also logs all found fake RAIDs and
their components for the sake of easy debugging.

Change-Id: I2066c5a0e995e542271cd308c9d83e2373787be4
Closes-Bug: #1617071
tags/10.0.0rc1^0
Alexander Gordeev 2 years ago
parent
commit
6017353766
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      agent

+ 5
- 1
agent View File

@@ -913,7 +913,8 @@ class NodeAgent
913 913
     begin
914 914
       description, _, components = data.split(/Number\s+Major\s+Minor\s+RaidDevice\s+(State\s+)?/m)
915 915
       line_patterns = ['Version', 'Raid Level', 'Raid Devices', 'Active Devices',
916
-                       'Spare Devices', 'Failed Devices', 'State', 'UUID']
916
+                       'Spare Devices', 'Failed Devices', 'State', 'UUID',
917
+                       'Container']
917 918
       for line in (description.split("\n")[1..-1] rescue [])
918 919
         line.strip!
919 920
         next if line == ""
@@ -961,6 +962,9 @@ class NodeAgent
961 962
 
962 963
     mds, devices = _find_fake_raid_mds()
963 964
 
965
+    @logger.debug("Found fake RAIDs: #{mds}")
966
+    @logger.debug("Found components of fake RAIDs: #{devices}")
967
+
964 968
     Dir["/sys/block/*"].each do |block_device_dir|
965 969
       basename_dir = File.basename(block_device_dir)
966 970
       # Entries in /sys/block for cciss look like cciss!c0d1 while

Loading…
Cancel
Save