ohai icon indicating copy to clipboard operation
ohai copied to clipboard

zpool plugin should include topology/vdev details

Open cburroughs opened this issue 9 years ago • 2 comments

Currently the plugin only includes information on device ids and the numbers that zpool status kindly provides. This are several reasonable questions that this is not sufficient to answer:

  • Are there spares left?
  • Is a cache or seperate log device available for performance?
  • Is there redundant storage? How many disks can fail before data is lost?

I think sucking in the topology information from zpool status would be sufficient to answer all of these questions. I suspect the most straightforward thing to do would be to map the pretty printed tree into Hashes but I admit that parsing the amount of whitespace sounds unfun.

Example output:

# zpool status
  pool: tank
 state: ONLINE
  scan: none requested
config:

    NAME                                STATE     READ WRITE CKSUM
    tank                                ONLINE       0     0     0
      mirror-0                          ONLINE       0     0     0
        ata-foo_bar-part4  ONLINE       0     0     0
        ata-foo_bar-part4  ONLINE       0     0     0
      mirror-1                          ONLINE       0     0     0
        ata-foo_bar        ONLINE       0     0     0
        ata-foo_bar        ONLINE       0     0     0
    cache
      ata-foo_bar    ONLINE       0     0     0

cburroughs avatar Apr 28 '15 02:04 cburroughs

If that information comes from a file in /proc we should probably get it out of there first.

lamont-granquist avatar Feb 17 '16 18:02 lamont-granquist

I'm looking at parsing a bit more information out of the zpool status, but the output is pretty awful and only Linux contains flags to distinguish between drives and pools. It's kind of a bummer, but we can probably rely on the spacing to determine what type of data we're looking at

tas50 avatar Jun 11 '17 04:06 tas50