fix: Call wipefs -a
in LonghornV2Provisioner.Format() (backport #157)
#158
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem:
When using the Longhorn V2 data engine, for NVMe devices where Longhorn decides to use the nvme bdev driver, device activation will fail if there's an existing filesystem. This does not appear to be a problem when using the aio driver.
Solution:
Run
wipefs -a $devPath
during provisioning.Without this, we'll potentially have devices stuck unschedulable with an obscure error message like this:
Disk c1fd02d173a3f4b9176705e9b2e37d39(0003:03:00.0) on node altra is not ready: failed to generate disk config: error: rpc error: code = Internal desc = rpc error: code = Internal desc = failed to add disk block device: failed to create disk bdev: failed to attach NVMe disk 0003:03:00.0: error sending message, id 3126, method bdev_nvme_attach_controller, params {c1fd02d173a3f4b9176705e9b2e37d39 {PCIe 0003:03:00.0 } 30 2 15 disable}: {"code": -19,"message": "No such device"}
Related Issue:
harvester/harvester#6828
Test plan:
mkfs.ext4 /dev/nvme0n1
(or whatever the device name is) to make a filesystem.kubectl -n longhorn-system get lhn -o yaml
and look underdiskStatus
for an error message similar to the description above).This is an automatic backport of pull request #157 done by [Mergify](https://mergify.com).