Skip to content

deployment/baremetal: fix clean_disks skipping virtio-blk on KVM/Fyre#14915

Merged
dahorak merged 1 commit intored-hat-storage:masterfrom
yitzhak12:fix-clean-disks-virtio-major-252
Apr 17, 2026
Merged

deployment/baremetal: fix clean_disks skipping virtio-blk on KVM/Fyre#14915
dahorak merged 1 commit intored-hat-storage:masterfrom
yitzhak12:fix-clean-disks-virtio-major-252

Conversation

@yitzhak12
Copy link
Copy Markdown
Contributor

The previous clean_disks used lsblk -e252 to exclude device-mapper devices, but on KVM/Fyre platforms major 252 is assigned to virtio-blk, so OSD disks (vdb, vdc) were silently skipped during cleanup.

Fix: drop the global lsblk scan with the major-number exclusion. Instead, rely on disks_available_to_cleanup (which already filters by boot-disk detection and nbd/loop exclusion) to get the eligible disk list, then query each disk's size individually via a targeted lsblk /dev/<disk> call.

Also pass namespace through to disks_available_to_cleanup so both functions are consistent, and add a libtest
(test_disks_available_to_cleanup) that verifies the per-disk size lookup works correctly on a live cluster without wiping any disks.

The previous clean_disks used `lsblk -e252` to exclude device-mapper
devices, but on KVM/Fyre platforms major 252 is assigned to virtio-blk,
so OSD disks (vdb, vdc) were silently skipped during cleanup.

Fix: drop the global lsblk scan with the major-number exclusion.
Instead, rely on disks_available_to_cleanup (which already filters by
boot-disk detection and nbd/loop exclusion) to get the eligible disk
list, then query each disk's size individually via a targeted
`lsblk /dev/<disk>` call.

Also pass namespace through to disks_available_to_cleanup so both
functions are consistent, and add a libtest
(test_disks_available_to_cleanup) that verifies the per-disk size
lookup works correctly on a live cluster without wiping any disks.

Signed-off-by: Itzhak Kave <ikave@ibm.com>
@yitzhak12 yitzhak12 added the team/ecosystem Ecosystem team related issues/PRs label Apr 16, 2026
@yitzhak12 yitzhak12 requested a review from a team as a code owner April 16, 2026 09:33
@pull-request-size pull-request-size bot added the size/M PR that changes 30-99 lines label Apr 16, 2026
Copy link
Copy Markdown

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: ikave-lso13-421
Cluster Configuration: conf/deployment/vsphere/upi_1az_rhcos_vsan_lso_vmdk_3m_3w.yaml
PR Test Suite: libtest
PR Test Path: tests/libtest/test_disks_available_to_cleanup.py
Additional Test Params:
OCP VERSION: 4.22
OCS VERSION: 4.22
tested against branch: master

Job UNSTABLE (some or all tests failed).

@yitzhak12
Copy link
Copy Markdown
Contributor Author

The Pr validation error above is related to a Ceph health issue, and not to the test.

Copy link
Copy Markdown

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: ikave-lso13-421
Cluster Configuration: conf/deployment/vsphere/upi_1az_rhcos_vsan_lso_vmdk_3m_3w.yaml
PR Test Suite: libtest
PR Test Path: tests/libtest/test_disks_available_to_cleanup.py
Additional Test Params:
OCP VERSION: 4.22
OCS VERSION: 4.22
tested against branch: master

Job PASSED.

Copy link
Copy Markdown
Contributor

@dahorak dahorak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but it should be verified also in the Baremetal environment UPI/AI deployment type (at least one of them, better both).

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dahorak, petr-balogh, yitzhak12

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@dahorak
Copy link
Copy Markdown
Contributor

dahorak commented Apr 17, 2026

Verification job on BM UPI deployment passed: https://url.corp.redhat.com/7f411c6

@dahorak dahorak added the Verified Mark when PR was verified and log provided label Apr 17, 2026
@dahorak dahorak merged commit 0ab1c0b into red-hat-storage:master Apr 17, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

IBM HCI FDF lgtm size/M PR that changes 30-99 lines team/ecosystem Ecosystem team related issues/PRs Verified Mark when PR was verified and log provided

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants