troubleshoot icon indicating copy to clipboard operation
troubleshoot copied to clipboard

Block Device Analyzer excludes RAID block devices

Open diamonwiggins opened this issue 2 years ago • 2 comments

Bug Description

The blockDevices analyzer will only pass if the device type is disk or part. This excludes devices of type raid* as well as others that a user may intend to use.

Per our documentation, block devices with any of the following characteristics are not counted:

  • Devices with a filesystem
  • Partitioned devices
  • Read-only devices
  • Loopback devices
  • Removable devices
# This device does not meet criteria solely because it is type raid1
  {
    "name": "md5",
    "kernel_name": "md5",
    "parent_kernel_name": "nvme1n1p5",
    "type": "raid1",
    "major": 9,
    "minor": 5,
    "size": 404967391232,
    "filesystem_type": "",
    "mountpoint": "",
    "serial": "",
    "read_only": false,
    "removable": false
  }

At the very least our documentation isn't clear which device types are allowed and which aren't.

The use case for this analyzer has traditionally been to ensure that there is a raw unformatted block device available before a persistent storage provider requiring one is installed. For example providers like Rook+Ceph and OpenEBS consume a raw block device for their storage implementations. With these storage providers, using a RAID devices is usually unsupported or not recommended due to replication and other storage features being handled by the provider itself.

However, this precise use case is not clear to would be users of this analyzer. We should either update our documentation and perhaps even the name of the analyzer to make this clear, or perhaps leave flexibility in the configuration of the blockDevices analyzer for device types. eg:

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: block-devices
spec:
  hostCollectors:
    - blockDevices: {}
  hostAnalyzers:
    - blockDevices:
        includeUnmountedPartitions: true
        minimumAcceptableSize: 10737418240 # 1024 ^ 3 * 10, 10GiB
        acceptedDeviceTypes: # this property does not exist today, but something like it could be added.
            - disk
            - part
            - raid
        outcomes:
        - pass:
            when: ".* == 1"
            message: One available block device
        - pass:
            when: ".* > 1"
            message: Multiple available block devices
        - fail:
            message: No available block devices

Expected Behavior

Docs should be updated to reflect more clearly the use case of the blockDevices analyzer, or it should allow you to have more flexibility over device type.

Steps To Reproduce Use the blockDevices analyzer with a raw unformatted block device of type raid*

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: block-devices
spec:
  hostCollectors:
    - blockDevices: {}
  hostAnalyzers:
    - blockDevices:
        includeUnmountedPartitions: true
        minimumAcceptableSize: 10737418240 # 1024 ^ 3 * 10, 10GiB
        outcomes:
        - pass:
            when: "raid* == 1"
            message: One available block device
        - fail:
            message: No available block devices

Additional Context Impacts all versions of Troubleshoot since the blockDevices analyzer was added

diamonwiggins avatar Jan 13 '23 17:01 diamonwiggins