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
quincy: ceph-volume/cephadm: support lv devices in inventory #53287
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
this adds `get_lv_path_from_mapper()` and `get_mapper_from_lv_path()` functions in api.lvm. they will help translating either an LV path from `/dev/mapper/LV` to the format `/dev/VG/LV` or the opposite. Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com> (cherry picked from commit c7164df)
LV devices are valid devices, they shouldn't be filtered in `disk.get_devices()` Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com> (cherry picked from commit 5470a86)
The inventory should report LV devices as they are valid devices that can be used to be prepared as OSDs. Fixes: https://tracker.ceph.com/issues/62362 Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com> (cherry picked from commit 605da29)
This adds a new config option 'inventory_list_all' so one can make the command `ceph orch device ls` report lvm devices too as they are valid devices that can be used to be prepared as OSDs. Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com> (cherry picked from commit e98ec82)
This adds two unit tests in order to cover `test_get_mapper_from_lv_path()` and `test_get_lv_path_from_mapper()` functions from `api.lvm` Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com> (cherry picked from commit a485883)
This functions works for what it is supposed to do: check if a device is busy. That being said, this induces a race condition in `get_devices()` Indeed, it does: 1/ `os.open()` with `(os.O_RDWR | os.O_EXCL)` 2/ `os.close()` The second call has an effect: it triggers a udev event which causes systemd-udevd to re-process the device. This seems to be a question of millisecond but because of this, /sys (sysfs) isn't fully populated as expected. Given that get_devices() collects a lot of details from sysfs in a loop, some of these details can be missed. ceph-volume overall doesn't make decisions based on `is_locked_raw_device()` This detail is used only for reporting (inventory). For this reason, dropping this function seems reasonnable. As a compromise, we can check if the device has partitions and/or a FileSystem on it. Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com> (cherry picked from commit 2422ad8)
This makes ceph-volume report partitions in inventory. A partition is a valid device for `ceph-volume lvm prepare` so we should report them in inventory (when using `--list-all` parameter). Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com> (cherry picked from commit 00ba00f)
adk3798
approved these changes
Sep 5, 2023
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.
backport tracker: https://tracker.ceph.com/issues/62707
backport of #52877
parent tracker: https://tracker.ceph.com/issues/62362
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/master/src/script/ceph-backport.sh