Skip to content
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

Collect more disk information #64

Merged
merged 5 commits into from
Oct 2, 2018
Merged

Collect more disk information #64

merged 5 commits into from
Oct 2, 2018

Conversation

jpo-joyent
Copy link
Contributor

This PR adds code to also collect:

  • which NUMA node a disk is local to (useful when trying to balance IO)
  • the disk's bus path (useful when trying to know where to unplug the thing from)
  • the disk's model (useful in conjunction with the serial number)

Also fixes a bug where serial numbers would be listed as #unknown instead of being omitted

One downside is we re-read and re-parse the udev db (a small flat file) for each property lookup. I could cache it, but it would make the code uglier. Let me know if you'd like me to.

If you need me to break these out into separate PRs, just let me know.

@jpo-joyent
Copy link
Contributor Author

This PR is on top of #63

@jaypipes
Copy link
Owner

jaypipes commented Oct 2, 2018

@jpo-joyent Hi! I've already merged #63 so would you mind rebasing to master and re-pushing to this PR? That would remove the udevInfo() code that is contained in here.

Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpo-joyent love most of these changes, thank you! :) I've left a couple suggestions for you to change if that's OK with you? Lemme know if you need assistance with the git rebase thing..

-jay

block_linux.go Show resolved Hide resolved
block_linux.go Show resolved Hide resolved
block.go Outdated Show resolved Hide resolved
block.go Outdated Show resolved Hide resolved
lsblk uses the same logic for determining WWN, namely:
- try to get ID_WWN_WITH_EXTENSION from udev
- if that fails, try to get ID_WWN

See:
- util-linux/util-linux#321
- util-linux/util-linux@4d7ef26
`WorldWideName` => `WWN`
`NumaNodeId` => `NUMANodeID`
@jpo-joyent
Copy link
Contributor Author

jpo-joyent commented Oct 2, 2018

Suggestions applied. Thanks!

@jaypipes
Copy link
Owner

jaypipes commented Oct 2, 2018

Awesome, thanks so much @jpo-joyent! :)

@jaypipes jaypipes merged commit 927a169 into jaypipes:master Oct 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants