New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--disks option not properly-handling mutlipath output on rhel6.3? #48

Closed
ryran opened this Issue Jan 17, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@ryran
Owner

ryran commented Jan 17, 2013

Turns out that xsos doesn't handle multipath command output from rhel6. Whoops. Hadn't noticed. Thanks so much to Mr. Markovic for pointing it out!!

After he brought it to my attention, this is what I noticed..

xsos could parse multipath from rhel5 just fine, at least when there were friendly names, e.g. this:

mpath9 (00000000000000000blahblahblah00000000) dm-11 IBM,2145
[size=50G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=50][active]
 \_ 3:0:6:1 sdy 65:128 [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 3:0:4:1 sdq 65:0   [active][ready]
 \_ 3:0:5:1 sdu 65:64  [active][ready]

And there were a few allowances in there for the differences with rhel4 as well.

However, rhel6 output like this was not taken into account:

123456787012812blahblahblah dm-2 NETAPP,LUN
size=250G features='1 queue_if_no_path' hwhandler='0' wp=rw
|-+- policy='round-robin 0' prio=4 status=active
| |- 4:0:0:2 sdc 8:32  active ready running
| |- 4:0:2:2 sdg 8:96  active ready running
| |- 5:0:0:2 sdk 8:160 active ready running
| `- 5:0:3:2 sdq 65:0  active ready running
`-+- policy='round-robin 0' prio=1 status=enabled
  |- 4:0:3:2 sdi 8:128 active ready running
  |- 4:0:1:2 sde 8:64  active ready running
  |- 5:0:1:2 sdm 8:192 active ready running
  `- 5:0:2:2 sdo 8:224 active ready running

@ghost ghost assigned ryran Jan 17, 2013

@ryran

This comment has been minimized.

Show comment
Hide comment
@ryran

ryran Jan 20, 2013

Owner

So the disk code was written pretty early on and apparently I didn't test it on enough different sosreports -- turns out the multipath -v4 -ll output is quite a bit more variable than I originally thought.

In v0.1.5, I rewrote quite a bit of the disk code and added quite a lot of comments. While I didn't take the time to comb through dozens of sosreports and test it on the multipath output from tons of systems, it's much better now.

In the mean-time, I also wrote a little bash function to parse output from multipath -ll -v4 ... I might add that to xsos later as a new-style option.

Here it is, as a function to be dropped into a bash config file:

mll() {
  local inputfile search_cmd
  # If directory, assume sosreport and look for multipath output
  if [[ -d $1 ]]; then
    inputfile=$1/sos_commands/devicemapper/multipath_-v4_-ll
    [[ -r $inputfile ]] || { echo -e "'$inputfile' unreadable\nRun with no args to see usage"; return 2; }
  elif [[ -f $1 && -r $1 ]]; then
    inputfile=$1
  else
    echo "Arg 1: must be file containing 'multipath -ll' output or dir-root of sosreport"
    echo "Arg 2 (optional): should be a wwid, friendly name, or LUN identifier to search for"
    return 1
  fi
  # If 1 arg only, use cat to process output
  # Otherwise, search for second arg in output
  [[ $# == 1 ]] && search_cmd=cat || search_cmd="awk -vRS=\n\n /$2/"
  awk '
    /^[[:graph:]]+ \([[:alnum:]]+\) *dm-/
    /^[[:graph:]]+ *dm-/
    /^\[?size=/
    /(\\_|\|-|`-)/
  ' "$inputfile" | sed '1!s,^[[:alnum:]].*dm-,\n&,' | $search_cmd                                              
}

And here's me using it against a particular extracted sosreport, along with a search string:

[rsaw:zarch]$ mll 
Arg 1: must be file containing 'multipath -ll' output or dir-root of sosreport
Arg 2 (optional): should be a wwid, friendly name, or LUN identifier to search for

[rsaw:zarch]$ mll ram-multipathfun/ mpath9
mpath9 (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxblahblahbxxxx) dm-11 IBM,2145
[size=50G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=50][active]
 \_ 3:0:6:1 sdy 65:128 [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 3:0:4:1 sdq 65:0   [active][ready]
 \_ 3:0:5:1 sdu 65:64  [active][ready]
Owner

ryran commented Jan 20, 2013

So the disk code was written pretty early on and apparently I didn't test it on enough different sosreports -- turns out the multipath -v4 -ll output is quite a bit more variable than I originally thought.

In v0.1.5, I rewrote quite a bit of the disk code and added quite a lot of comments. While I didn't take the time to comb through dozens of sosreports and test it on the multipath output from tons of systems, it's much better now.

In the mean-time, I also wrote a little bash function to parse output from multipath -ll -v4 ... I might add that to xsos later as a new-style option.

Here it is, as a function to be dropped into a bash config file:

mll() {
  local inputfile search_cmd
  # If directory, assume sosreport and look for multipath output
  if [[ -d $1 ]]; then
    inputfile=$1/sos_commands/devicemapper/multipath_-v4_-ll
    [[ -r $inputfile ]] || { echo -e "'$inputfile' unreadable\nRun with no args to see usage"; return 2; }
  elif [[ -f $1 && -r $1 ]]; then
    inputfile=$1
  else
    echo "Arg 1: must be file containing 'multipath -ll' output or dir-root of sosreport"
    echo "Arg 2 (optional): should be a wwid, friendly name, or LUN identifier to search for"
    return 1
  fi
  # If 1 arg only, use cat to process output
  # Otherwise, search for second arg in output
  [[ $# == 1 ]] && search_cmd=cat || search_cmd="awk -vRS=\n\n /$2/"
  awk '
    /^[[:graph:]]+ \([[:alnum:]]+\) *dm-/
    /^[[:graph:]]+ *dm-/
    /^\[?size=/
    /(\\_|\|-|`-)/
  ' "$inputfile" | sed '1!s,^[[:alnum:]].*dm-,\n&,' | $search_cmd                                              
}

And here's me using it against a particular extracted sosreport, along with a search string:

[rsaw:zarch]$ mll 
Arg 1: must be file containing 'multipath -ll' output or dir-root of sosreport
Arg 2 (optional): should be a wwid, friendly name, or LUN identifier to search for

[rsaw:zarch]$ mll ram-multipathfun/ mpath9
mpath9 (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxblahblahbxxxx) dm-11 IBM,2145
[size=50G][features=1 queue_if_no_path][hwhandler=0][rw]
\_ round-robin 0 [prio=50][active]
 \_ 3:0:6:1 sdy 65:128 [active][ready]
\_ round-robin 0 [prio=20][enabled]
 \_ 3:0:4:1 sdq 65:0   [active][ready]
 \_ 3:0:5:1 sdu 65:64  [active][ready]

@ryran ryran closed this Jan 20, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment