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

HP SmartArray adapters should be treated similar to MegaRaid #8

Closed
razorsedge opened this issue Sep 25, 2013 · 4 comments
Closed

HP SmartArray adapters should be treated similar to MegaRaid #8

razorsedge opened this issue Sep 25, 2013 · 4 comments

Comments

@razorsedge
Copy link
Contributor

This is the desired config in /etc/smartd.conf:

/dev/cciss/c0d0 -d cciss,0 -a -o on -S on
/dev/cciss/c0d0 -d cciss,1 -a -o on -S on
/dev/cciss/c0d0 -d cciss,2 -a -o on -S on
/dev/cciss/c0d0 -d cciss,3 -a -o on -S on
/dev/cciss/c0d0 -d cciss,4 -a -o on -S on
/dev/cciss/c0d0 -d cciss,5 -a -o on -S on

This does not appear to work.

class { 'smartd':
  devices        => [
    '/dev/cciss/c0d0',
    '/dev/cciss/c0d0',
    '/dev/cciss/c0d0',
    '/dev/cciss/c0d0',
    '/dev/cciss/c0d0',
    '/dev/cciss/c0d0',
  ],
  device_options => {
    '/dev/cciss/c0d0' => '-d cciss,0 -a -o on -S on',
    '/dev/cciss/c0d0' => '-d cciss,1 -a -o on -S on',
    '/dev/cciss/c0d0' => '-d cciss,2 -a -o on -S on',
    '/dev/cciss/c0d0' => '-d cciss,3 -a -o on -S on',
    '/dev/cciss/c0d0' => '-d cciss,4 -a -o on -S on',
    '/dev/cciss/c0d0' => '-d cciss,5 -a -o on -S on',
  },
}

The result is this in /etc/smartd.conf:

/dev/cciss/c0d0 -d cciss,5 -a -o on -S on
@jhoblitt
Copy link
Owner

@razorsedge Sorry for the delay in responding, github email notifications continue to be MIA most of the time for me.

You've obviously encountered a case that was never considered by the API. device_options is a hash so in your example the '/dev/cciss/c0d0' key is being redefined over and over again.

I think the API needs to be changed to devices being an Array of Array or an Array of Hash with device_options being removed. Something like:

class { 'smartd':
  devices => [
    [ '/dev/cciss/c0d0', '-d cciss,0 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,1 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,2 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,3 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,4 -a -o on -S on' ],
    [ '/dev/cciss/c0d0', '-d cciss,5 -a -o on -S on' ],
  ],
}

or

class { 'smartd':
  devices  => [
    { 'dev' => '/dev/cciss/c0d0', options => '-d cciss,0 -a -o on -S on' },
    { 'dev' => '/dev/cciss/c0d0', options => '-d cciss,1 -a -o on -S on' },
    ...
  ],
}

Another possibility would be to abandon both attributes and try to use a defined type but that would require setting a unique namevar for your case.

smartd::device { 'cciss1':
  device  =>  '/dev/cciss/c0d0',
  options => '-d cciss,1 -a -o on -S on',
}

What are your thoughts?

@razorsedge
Copy link
Contributor Author

@jhoblitt I am kind of ambivalent. I know that right now I want to use Hiera data bindings to provide the settings with the possibility to merge parts of the hierarchy into the smartd.conf. This probably precludes defined types. A hash would allow for Hiera hash merging.

Long-term I would want fact discovery to automatically find all DASD block devices, figure out if they are behind hardware RAID, and apply the correct '/dev/cciss/c0d0', '-d cciss,4' '/dev/sdg', '-d megaraid,2' pairings to the smartd.conf.

@jhoblitt
Copy link
Owner

jhoblitt commented Oct 1, 2013

Could you take a look at #9 and see if it covers your needs? I added a test based on your example.

@razorsedge
Copy link
Contributor Author

#9 fixes it. Thanks.

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

2 participants