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

Suggestion: add hard disk monitoring in xoa #4458

Closed
akurzawa opened this issue Aug 28, 2019 · 9 comments
Closed

Suggestion: add hard disk monitoring in xoa #4458

akurzawa opened this issue Aug 28, 2019 · 9 comments

Comments

@akurzawa
Copy link

Hi

on the xcp-ng shell I can check smart of hard drive using smartctl, I can even check hard disk which is a part of array on megaraid card smartctl -a -d megaraid,1 /dev/sdx

can we add checking/monitoring of hard disks in xoa interface?

@julien-f
Copy link
Member

I don't think this is possible, because it's not exposed by the XenAPI.

/cc @olivierlambert

@olivierlambert
Copy link
Member

Exposing smartcl or megaraid isn't directly possible because there's 0 API entry currently for this (in XAPI).

This could be extended with a XAPI plugin, but we should determine first what are the most usual disk checks available, we don't know to create a plugin supporting hundreds of RAID card manufacturers.

Anyway, this would be a feature to develop in XCP-ng first.

@akurzawa
Copy link
Author

akurzawa commented Aug 29, 2019

I think real problem is indeed to send data from host (xcp-ng) to xoa vm - maybe ssh tunnel?
beside of that I think that smartctl covers almost everything we need to check smart in various raid controllers, for example:
smartctl -a -d megaraid,**X** /dev/sd**X** | sed -n '/SMART Error Log Version/{n;p;}'
and You know if drive is failing
With this "hundreds of RAID" its like with hundreds of printers - which are supported by only few different drives. I think that we could - for start just simpy ask smartctl to check if disks are OK and send this data back to xoa - maybe plugin? but also that would be nice to see hardware status in dashboard

@olivierlambert
Copy link
Member

  1. SSH tunnel: never. XO is agentless, it means we rely on XAPI only. Starting to do nasty hacks like this is the beginning of the end.
  2. Please open an issue on XCP-ng repo to ask for a XAPI plugin to monitor disks, when the plugin exist, we could get the info in XO (or any other XAPI client). Just take time to write your specs correctly: what do you need, how do you need it, and keep it simple as possible. As soon you did it, we'll discuss there, and if it's OK, I'll link the issue from here so we could develop both the plugin and the UI at the same time.

@akurzawa
Copy link
Author

akurzawa commented Aug 29, 2019

will do.
xcp-ng/xcp#263

@olivierlambert
Copy link
Member

Okay so now we have a XAPI plugin called smartctlHealth that will do this on XCP-ng 8.3:

[17:16 Chouffe ~]# xe host-call-plugin host-uuid=8b80bcc2-d31c-4f7d-85a7-e921f67c4ec5  plugin=smartctlHealth.py fn=check_smartctl
{"/dev/sdf": "PASSED", "/dev/sdg": "PASSED", "/dev/sdd": "PASSED", "/dev/sde": "PASSED", "/dev/sdb": "PASSED", "/dev/sdc": "PASSED", "/dev/sda": "PASSED"}

We should add this in the Advanced host view, with one line "Disk status" or "Disk health", and with a green pill "PASSED" if all disks are passed, but if only one is not PASSED then display a red pill and list all non-passed disks.

@akurzawa
Copy link
Author

akurzawa commented Aug 24, 2023

Well, it took a while, but I'm glad you've incorporated my another idea in xoa :D

@olivierlambert
Copy link
Member

Later, we could have more detailed info on a non-PASSED disk, with this call:

xe host-call-plugin host-uuid=8b80bcc2-d31c-4f7d-85a7-e921f67c4ec5  plugin=smartctlFull.py fn=check_smartctl

And get those details: family, name, user capacity in GiB/TiB (human format ideally):

"model_family": "Phison Driven SSDs",
 "model_name": "KINGSTON SA400S37960G",
  "user_capacity": {
    "blocks": 1875385008,
    "bytes": 960197124096
  },
"

@olivierlambert
Copy link
Member

olivierlambert commented Aug 24, 2023

Well, it toot a while, but I'm glad you've incorporated my another idea in xoa :D

It's a non-negligible amount a work:

  • we need to update smartmontool in the Dom0 to support JSON export (and test it to be sure it doesn't break anything else)
  • creating a XAPI plugin (thanks to @AtaxyaNetwork )
  • review the plugin
  • create the backend in XO
  • create the frontend

But thanks to the contributions, we can move forward :)

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