Skip to content

Instantly share code, notes, and snippets.

@smklein
Last active July 2, 2024 18:25
Show Gist options
  • Save smklein/f6fc925144a141a8116bbcfcdd622cb1 to your computer and use it in GitHub Desktop.
Save smklein/f6fc925144a141a8116bbcfcdd622cb1 to your computer and use it in GitHub Desktop.
One-liner to check for disk ledgers
# Try running this from the switch zone. I used it on Jeeves for the dogfood rack, and it worked.
# To test: I also tried removing the ledgers on a sled, and saw that the sled with
# manual modifications failed as expected.
#
# I recommend running 'omdb' and 'pilot' first, just to check that they exist.
# omdb: Grab the in-service sleds,
# grep: remove the header line,
# awk: remove whitespace
# cut: grab the serial number of the sled
# pilot: run a command on each sled
# find: locate the ledger on M.2s
# grep: if the count is "2", we have it on both internal disks (success), otherwise something is wrong (fail)
omdb db sleds -F in-service 2> /dev/null \
| grep -v SERIAL \
| awk '{$1=$1};1' \
| cut -d' ' -f1 \
| xargs -I{} pilot host exec -c \
"find /pool/int/*/config/omicron-physical-disks.json -type f | wc -l | grep -q -w 2 && echo 'OK' || echo 'FAIL'" {}
# What should I expect to see?
#
# On success: a bunch of "OK". Each of these indicates that the sled is managing U.2 storage explicitly.
# On fail: any number of "FAIL"s. This means taht the sled is NOT managing U.2 storage explicitly.
#
# If we see any failures, we'll need to re-run the reconfigurator to instruct the sled to explicitly manage storage.
# This should already be a part of Nexus, as of https://github.com/oxidecomputer/omicron/pull/5506
#
# This should be possible with a combination of "omdb nexus blueprints regenerate" and "omdb nexus blueprint target".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment