- local targets
- local devs
- local nid
- local oss
-
- for oss in $(osts_nodes); do
- devs=$(get_devs $oss)
- nid=$(host_nids_address $oss $NETTYPE)
- for d in $devs; do
- # if oss is local -- obdfilter-survey needs dev wo/ host
- target=$d
- [[ $oss = `hostname` && "$1" == "netdisk" ]] || target=$nid:$target
- targets="$targets $target"
- done
- done
-
+ local targets
+ local target
+ local dev
+ local nid
+ local osc
+
+ for osc in $($LCTL get_param -N osc.${FSNAME}-*osc-*); do
+ nid=$($LCTL get_param $osc.import |
+ awk '/current_connection:/ {sub(/@.*/,""); print $2}')
+ dev=$(echo $osc | sed -e 's/^osc\.//' -e 's/-osc.*//')
+ target=$dev
+
+ # For local disk obdfilter-survey requires target devs w/o nid.
+ # obdfilter-survey :
+ # case 1 (local disk):
+ # $ nobjhi=2 thrhi=2 size=1024
+ # targets="lustre-OST0000 lustre-OST0001 ..."
+ # sh obdfilter-survey
+ local_node && [ "$1" == "disk" ] || target=$nid:$target
+ targets="$targets $target"
+ done