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

Smart plugin working with Dell hardware RAID #45

Open
olivierlambert opened this issue Aug 21, 2024 · 7 comments
Open

Smart plugin working with Dell hardware RAID #45

olivierlambert opened this issue Aug 21, 2024 · 7 comments

Comments

@olivierlambert
Copy link
Member

Currently, the smartctl plugin doesn't work with a Dell hardware RAID controller. In that case, the smartctl command will return:

smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.19.0+1] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

Smartctl open device: /dev/sda failed: DELL or MegaRaid controller, please try adding '-d megaraid,N'

So we should catch this very specific case to try using smartctl differently. Here is how to make it work. First, we need to smartctl --scan in order to find all the devices. This will return (for example):

/dev/sda -d scsi # /dev/sda, SCSI device
/dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device

Now, we need to interate on all devices "megaraid" that exists, in our example 0 and 1:

smartctl -a /dev/bus/0 -d megaraid,0

and:

smartctl -a /dev/bus/0 -d megaraid,1

I suppose we could also try first to check if there's /dev/bus/ devices and treat them if we detect them. In any case, we need to catch that error.

@1234Erwan
Copy link

Here is an attempt to patch the problem : #46

@gthvn1
Copy link
Contributor

gthvn1 commented Oct 25, 2024

it looks like that in fact it is our smartctl binary that doesn't support megaraid. I just tried to run it on 8.3 and I had the following error:

[10:22 r620-x1]# smartctl --scan -d megaraid
# scan_smart_devices: Invalid type 'megaraid', valid arguments are: by-id, ata, scsi, sat, nvme

And I tried that because the command that check health smartctl -j -H -d megaraid,0 /dev/bus/0 returned an exit status of 4. So it looks like the issue is in fact that our binary is not compiled with support for megaraid or something like that? Because version seems ok smartctl 7.0

@gthvn1
Copy link
Contributor

gthvn1 commented Oct 25, 2024

And it is really weird because the --scan is showing some megaraid device...

[10:29 r620-x1]# smartctl --scan
/dev/sda -d scsi # /dev/sda, SCSI device
/dev/bus/0 -d megaraid,0 # /dev/bus/0 [megaraid_disk_00], SCSI device
/dev/bus/0 -d megaraid,1 # /dev/bus/0 [megaraid_disk_01], SCSI device
/dev/nvme0 -d nvme # /dev/nvme0, NVMe device
/dev/nvme1 -d nvme # /dev/nvme1, NVMe device

@gthvn1
Copy link
Contributor

gthvn1 commented Oct 25, 2024

Ok my bad. We need to use -d iscsi. It is the output of the --scan command that tricked me with its -d megaraid,0...

@chrispro-21
Copy link

I am also have this issue with the latest XCP-ng (8.3.0) and XO from the sources (commit 9af58).

I am currently using a pair of Dell Poweredge R640s with a PERC h730 for the raid controller.

Is there anything I can implement to fix this or has there been any update on a patch for this?

@stormi
Copy link
Member

stormi commented Jan 23, 2025

You can follow the progress at #46

@chrispro-21
Copy link

Thank you!

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

No branches or pull requests

5 participants