-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use BusPath to resolve dm device paths #130
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vicente-Cheng
approved these changes
Sep 23, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, please rebase to use the latest CI
Prior to this, if `mkfs.ext4` failed, all we saw was "failed to format /dev/sda. err: exit status 1". With this change, we'll see the command output, which is a bit more useful, for exmaple: "failed to format /dev/sda. exit status 1: mke2fs 1.46.4 (18-Aug-2021) /dev/sda is apparently in use by the system; will not make a filesystem here!" Signed-off-by: Tim Serong <[email protected]>
If multipathd is running and has taken over a device, ResolvePersistentDevPath() will end up returning a "/dev/dm-*" device path, which we don't want. We want the real underyling device (e.g. "/dev/sda"). If we take a "/dev/dm-*" path and later update the blockdevice CR with it, we lose all the interesting DeviceStatus information, like the WWN. Happily, in this case, we can figure out the right path to use by checking "/dev/disk/by-path/" + the device's bus path. This has the added advantage of also working for block devices that have no WWN. Related issue: harvester/harvester#6531 Signed-off-by: Tim Serong <[email protected]>
tserong
force-pushed
the
wip-fix-dm-paths
branch
from
September 24, 2024 01:50
aea41e8
to
1e57cf7
Compare
Rebased |
@Mergifyio backport v0.7.x |
✅ Backports have been created
|
bk201
approved these changes
Sep 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
If multipathd is running and has taken over a device,
ResolvePersistentDevPath()
will end up returning a/dev/dm-*
device path, which we don't want. We want the real underyling device (e.g./dev/sda
). If we take a/dev/dm-*
path and later update the blockdevice CR with it, we lose all the interesting DeviceStatus information, like the WWN.Happily, in this case, we can figure out the right path to use by checking
/dev/disk/by-path/
+ the device's bus path. This has the added advantage of also working for block devices that have no WWN.Solution:
This PR.
Note: we're not trying to make NDM support multipath devices here, we're just trying to avoid having it corrupt the blockdevice CRs if multipath happens to be active.
Related Issue:
harvester/harvester#6531
Test plan:
multipath=off
)/dev/sda
, not as/dev/dm-0
as in that bug report.multipath -F
to flush the multipath config. This will remove the device from multipath. It should be automatically formatted shortly afterwards.