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

remove losetup dependency for ROX support #93

Merged
merged 1 commit into from
Nov 19, 2020

Conversation

WanzenBug
Copy link
Member

In d2f23d6 we introduced ROX volume support, which works around DRBD's
autopromote feature by introducing a readonly loop-device so all access
is done readonly.

The code to handle detaching needed to clean up the loop device, which
relied on a specifc implementation of "losetup --list", which is not
compatible with older version (such as the one found in CentOS 7).
This meant that all PVC failed to detach.

This commit switches to using "blockdev --setro" to ensure readonly access.
That in turn requires DRBD v9.0.26, which is not released yet. This should
not be a problem, as the feature was probably never used anyways.

In d2f23d6 we introduced ROX volume support, which works around DRBD's
autopromote feature by introducing a readonly loop-device so all access
is done readonly.

The code to handle detaching needed to clean up the loop device, which
relied on a specifc implementation of "losetup --list", which is not
compatible with older version (such as the one found in CentOS 7).
This meant that _all_ PVC failed to detach.

This commit switches to using "blockdev --setro" to ensure readonly access.
That in turn requires DRBD v9.0.26, which is not released yet. This should
not be a problem, as the feature was probably never used anyways.
@WanzenBug WanzenBug requested a review from rck November 18, 2020 17:13
@WanzenBug
Copy link
Member Author

@rck I guess you were right about this feature :/

@rck
Copy link
Member

rck commented Nov 19, 2020

LGTM. Thanks for fixing it

@rck rck merged commit 6782ef1 into piraeusdatastore:master Nov 19, 2020
@WanzenBug WanzenBug deleted the remove-losetup branch November 19, 2020 08:32
@kvaps
Copy link
Member

kvaps commented Apr 7, 2022

I just noticed that RWX volumes has loop device set as well, is it bug or feature? I'm using tag 0.18.0

@WanzenBug
Copy link
Member Author

WanzenBug commented Apr 7, 2022

That has nothing to do with LINSTOR CSI (we don't use losetup anywhere, anymore). For some reason kubelet always creates a loop device for Block volumes, even if the exported bind target is already a block device

@kvaps
Copy link
Member

kvaps commented Apr 7, 2022

Got it! Thanks

@kvaps
Copy link
Member

kvaps commented Apr 13, 2022

After some digging, I found that loop devices are used by Kubernetes for some locking mechanism to not let volume device be silently detached.

more details here:

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.

3 participants