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

Added disks extended attributes #202

Merged
merged 1 commit into from
Mar 7, 2022

Conversation

geektophe
Copy link
Collaborator

This patch brings some of the physical and virtual drive attributes as custom_fields to the disks inventory.

The goal is to have this information present to ease disks maintenance when a drive becomes unavailable and its attributes can't be read anymore from the RAID controller.

It also helps to standardize the extended disk attributes across the different manufacturers.

As the disk physical identifers were not available under the correct format (hexadecimal format using the xml output as opposed as X:Y:Z format using the default list format), the command line parser has been refactored to read the list format, rather than xml one in the omreport raid controller parser.

As the custom fields have to be created prior being able to register the disks extended attributes, this feature is only activated using the --process-virtual-drives command line parameter, or by setting process_virtual_drives to true in the configuration file.

The custom fields to create as DCIM > inventory item Text are described below.

NAME            LABEL                      DESCRIPTION
mount_point     Mount point                Device mount point(s)
pd_identifier   Physical disk identifier   Physical disk identifier in the RAID controller
vd_array        Virtual drive array        Virtual drive array the disk is member of
vd_consistency  Virtual drive consistency  Virtual disk array consistency
vd_device       Virtual drive device       Virtual drive system device
vd_raid_type    Virtual drive RAID         Virtual drive array RAID type
vd_size         Virtual drive size         Virtual drive array size

In the current implementation, the disks attributes ore not updated: if a disk with the correct serial number is found, it's sufficient to consider it as up to date.

To force the reprocessing of the disks extended attributes, the --force-disk-refresh command line option can be used: it removes all existing disks to before populating them with the correct parsing. Unless this option is specified, the extended attributes won't be modified unless a disk is replaced.

It is possible to dump the physical/virtual disks map on the filesystem under the JSON notation to ease or automate disks management. The file path has to be provided using the --dump-disks-map command line parameter.

This patch brings some of the physical and virtual drive attributes as
`custom_fields` to the disks inventory.

The goal is to have this information present to ease disks maintenance
when a drive becomes unavailable and its attributes can't be read anymore
from the RAID controller.

It also helps to standardize the extended disk attributes across the
different manufacturers.

As the disk physical identifers were not available under the correct
format (hexadecimal format using the `xml` output as opposed as `X:Y:Z` format
using the default `list` format), the command line parser has been
refactored to read the `list` format, rather than `xml` one in the
`omreport` raid controller parser.

As the custom fields have to be created prior being able to register
the disks extended attributes, this feature is only activated using the
`--process-virtual-drives` command line parameter, or by setting
`process_virtual_drives` to `true` in the configuration file.

The custom fields to create as `DCIM > inventory item` `Text` are described
below.

    NAME            LABEL                      DESCRIPTION
    mount_point     Mount point                Device mount point(s)
    pd_identifier   Physical disk identifier   Physical disk identifier in the RAID controller
    vd_array        Virtual drive array        Virtual drive array the disk is member of
    vd_consistency  Virtual drive consistency  Virtual disk array consistency
    vd_device       Virtual drive device       Virtual drive system device
    vd_raid_type    Virtual drive RAID         Virtual drive array RAID type
    vd_size         Virtual drive size         Virtual drive array size

In the current implementation, the disks attributes ore not updated: if
a disk with the correct serial number is found, it's sufficient to
consider it as up to date.

To force the reprocessing of the disks extended attributes, the
`--force-disk-refresh` command line option can be used: it removes all
existing disks to before populating them with the correct parsing.
Unless this option is specified, the extended attributes won't be
modified unless a disk is replaced.

It is possible to dump the physical/virtual disks map on the filesystem under
the JSON notation to ease or automate disks management. The file path has to
be provided using the `--dump-disks-map` command line parameter.
@geektophe geektophe merged commit 0f210e1 into 176-netbox-2.9 Mar 7, 2022
@cyrinux cyrinux deleted the feature/chriss/disk_extended_information branch March 10, 2022 16:19
devopstales pushed a commit to devopstales/netbox-agent2 that referenced this pull request Jun 24, 2022
…d_information

Added disks extended attributes
@sylr sylr mentioned this pull request Aug 8, 2022
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.

1 participant