Skip to content

Commit

Permalink
Add HPECRAY-23 log settings for PAXs
Browse files Browse the repository at this point in the history
Signed-off-by: Anthony Floeder <[email protected]>
  • Loading branch information
ajfloeder committed Dec 3, 2024
1 parent afc4d0c commit 14ec4a1
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 53 deletions.
119 changes: 68 additions & 51 deletions tools/create-write-delete-namespaces.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,61 +17,78 @@
# See the License for the specific language governing permissions and
# limitations under the License.

DURATION=${1:-"30s"}
OP=${2:-"randread"}

usage() {
cat <<EOF
Create a namespace on every drive, create a logical volume from those namespaces, write the logical volume, then delete everything
Usage: $0 [NAMESPACE-SIZE-IN-BYTES]
Create a namespace on every drive, create a logical volume from those namespaces, operate over that logical volume, then delete everything
NAMESPACE-SIZE-IN-BYTES: 0 -> (Allocate entire drive)
Usage: $0 [duration: default 30s] [operation: randread|randwrite: default randread]
Examples:
$0 60s randread # random read test for 60 seconds
$0 60m randread # random read test for 60 minutes
$0 300s randwrite # random write test for 300 seconds
EOF
}

SIZE=${1:-0}
while getopts "h" OPTION
do
case "${OPTION}" in
'h')
usage
exit 0
;;
*)
;;
esac
done
shift $((OPTIND - 1))

SIZE=0
DELAY_FOR_DEVICES=2
DELAY_TO_COOL_CPU=0

case "$SIZE" in
''|*[!0-9]*)
usage
exit 1
;;
*)
# Create and attach a namespace on each drive to the RABBIT's processor
./nvme.sh create "$SIZE"
./nvme.sh attach

printf "Sleeping %d seconds to allow all devices to be available for logical volume\n" "$DELAY_FOR_DEVICES"
sleep "$DELAY_FOR_DEVICES"

# Create a logical volume spanning all the namespaces
./lvm.sh create

# Write a little something to the logical volume to give the drives some work to do on delete-ns operation
fio --direct=1 --rw=randwrite --bs=32M --ioengine=libaio --iodepth=128 --numjobs=4 --runtime=5m --time_based --group_reporting --name=rabbit --eta-newline=1 --filename=/dev/rabbit/rabbit

if [ $DELAY_TO_COOL_CPU != 0 ]
then
printf "Sleeping %d seconds to cool the CPU\n" "$DELAY_TO_COOL_CPU"
sleep "$DELAY_TO_COOL_CPU"
fi
# Delete the logical volume to tidy up
./lvm.sh delete

# Format the namespace to speed up deletion
./nvme.sh cmd format --force --namspace-id=1

# Wait for the format to finish
areWeDone=$(nvme list | grep KIO | awk '{if ($6 > 0) { print "wait" } else { print "done" }}')
while [ "$areWeDone" != "done" ]; do
sleep 1
printf "Formatting, space left %f\n" "$(nvme list | grep KIO | awk '{print $6}')"
areWeDone=$(nvme list | grep KIO | awk '{if ($6 > 0) { print "wait" } else { print "done" }}')
done

# Show the nvme namespaces for the record
nvme list | grep KIO

# Finally, delete the namespaces
./nvme.sh -t delete
;;
esac

printf "duration %s\n" $DURATION
printf "operation %s\n" $OP

# Ensure lvm.conf doesn't get in the way
sed -i 's/use_lvmlockd = 1/use_lvmlockd = 0/g' /etc/lvm/lvm.conf

# Ensure the /dev/rabbit directory doesn't already exist
rm -rf /dev/rabbit

# Run nnf-ec just to be sure
./nnf-ec

# Create and attach a namespace on each drive to the RABBIT's processor
./nvme.sh create "$SIZE"
./nvme.sh attach

printf "Sleeping %d seconds to allow all devices to be available for logical volume\n" "$DELAY_FOR_DEVICES"
sleep "$DELAY_FOR_DEVICES"

# Create a logical volume spanning all the namespaces
./lvm.sh create

# Write a little something to the logical volume to give the drives some work to do on delete-ns operation
fio --direct=1 --rw="$OP" --bs=32M --ioengine=libaio --iodepth=128 --numjobs=4 --runtime="$DURATION" --time_based --group_reporting --name=rabbit --eta-newline=1 --filename=/dev/rabbit/rabbit

# Delete the logical volume to tidy up
./lvm.sh delete

# Format the namespace to speed up deletion
./nvme.sh cmd format --force --namespace-id=1

# Wait for the format to finish
gbToFormat=$(nvme list | grep KIO | awk '{print $6}' | tr ' ' '\n' | paste -sd+ - | bc | awk '{print ($1 == int($1)) ? int($1) : int($1) + 1}')
while (("$gbToFormat" > 0)); do
sleep 1
printf "Formatting, space left %d\n" "$(nvme list | grep KIO | awk '{print $6}' | tr ' ' '\n' | paste -sd+ - | bc | awk '{print ($1 == int($1)) ? $1 : int($1) + 1}')"
gbToFormat=$(nvme list | grep KIO | awk '{print $6}' | tr ' ' '\n' | paste -sd+ - | bc | awk '{print ($1 == int($1)) ? int($1) : int($1) + 1}')
done

# Show the nvme namespaces for the record
nvme list | grep KIO

# Finally, delete the namespaces
./nvme.sh -t delete
15 changes: 15 additions & 0 deletions tools/rabbit-s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,21 @@ EOF

$SSHPASS ssh root@$SYSTEM <<-EOF
screen -S $SESSION -X stuff "fabdbg -s pax\nfabdbg -s fio\nfabdbg -s gfms\nlog -m 0x81 -s 5\nlog -m 0x81 -s 5 -p on\nlog -m 0x82 -s 5\nlog -m 0x82 -s 5 -p on\nlog -m 0x84 -s 5\nlog -m 0x84 -s 5 -p on\nlog -m 0x54 -s 5\nlog -m 0x54 -s 5 -p on\n"
EOF
done
;;
hpecray-23)
for SESSION in "${SESSIONS[@]}"
do

# For this run, we want to enable some logging settings that we have been leaving off for a while.
# FABIOV - 0x82
# log -m 0x82 -s 3
# log -m 0x82 -s 3 -p on
# fabdbg -s fio
# fabdbg -s gfms
$SSHPASS ssh root@$SYSTEM <<-EOF
screen -S $SESSION -X stuff "log -m 0x82 -s 3\nlog -m 0x82 -s 3 -p on\nlog -m 0x84 -s 3\nlog -m 0x84 -s 3 -p on\nfabdbg -s gfms\nfabdbg -c rule"
EOF
done
;;
Expand Down
12 changes: 10 additions & 2 deletions tools/switch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Commands:
info display switch hardware information
ep-tunnel-status display endpoint tunnel status for each drive
ep-tunnel-enable enable the endpoint tunnel for each drive
ep-tunnel-disable disable the endpoint tunnel for each drive
fabric [COMMAND] [ARG [ARG]...] execute the fabric COMMAND (default is gfms-dump)
cmd [COMMAND] [ARG [ARG]...] execute COMMAND on each switchtec device in the system.
Expand Down Expand Up @@ -97,9 +98,9 @@ getChassis() {

COMMAND=xhost-query.py
if command -v $COMMAND &> /dev/null; then
CHASSIS=$("$COMMAND" $(hostname) | cut -c -7)
CHASSIS=$("$COMMAND" "$(hostname)" | cut -c -7)
else
CHASSIS="x****c*"
CHASSIS=$(hostname | cut -c -8)
fi
}

Expand Down Expand Up @@ -411,6 +412,13 @@ case $1 in
}
execute ep-tunnel-enable
;;
ep-tunnel-disable)
function ep-tunnel-disable() {
local SWITCH=$1
ep-tunnel-command "$SWITCH" "disable"
}
execute ep-tunnel-disable
;;
fabric)
function fabric() {
local SWITCH=$1 FABRIC_CMD=$2 ARGS=( "${@:3}" )
Expand Down

0 comments on commit 14ec4a1

Please sign in to comment.