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

osd_volume_activate: support ceph-disk based OSDs via ceph-volume #1684

Merged
merged 7 commits into from Jun 18, 2020

Conversation

dsavineau
Copy link
Contributor

This adds support for managing ceph-disk based OSDs via ceph-volume simple commands when using the OSD_CEPH_VOLUME_ACTIVATE entrypoint.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1844591

Signed-off-by: Dimitri Savineau dsavinea@redhat.com

dsavineau and others added 7 commits June 15, 2020 16:26
After upgrading to nautilus, the OSD deployed by ceph-disk needs to be
manage by ceph-volume with the simple subcommand.
This was part of the osd_ceph_disk_activate entrypoint but there's no
need to have a separate entrypoint because at the end we are using the
same command : ceph-volume.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit d467a30)
This commit adds dmcrypt cleanup support when osd is stopped.
Otherwise, once a dmcrypt osd is stopped, the resource is still
accessible.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 90511a4)
90511a4 introduced a bug in
osd_volume_lvm function.
OSDs couldn't start because `$CEPH_VOLUME_LIST_JSON` is seen as an empty
variable when consumed in this function.
Since there's no need to have a separate function for detecting the
volume type, let's refact this part of the code so we can fix this
issue.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit bbf493d)
`$DATA` isn't a path to a file.

This commit fixes the error : "File name too long"

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 9bc10f3)
Loop devices are like nvme or cciss devices because the partitions are
referenced with an extra 'p' before the partition number.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 21d0b04)
When managing legacy ceph-disk based OSD with ceph-volume then we need
to open the encrypted partitions before running the ceph-volume simple
scan command otherwise the scan will fail.
This situation happens after a reboot because all encrypted partitions
are closed.

$ ceph-volume simple scan /dev/sdb1 --force
(...)
--> broken symlink found /tmp/tmpept0ox2j/block -> /dev/mapper/457d7196-4015-40fe-aa83-a160477450f7

$ ceph-volume.log
(...)
[ceph_volume.util.system][INFO  ] /dev/sdb1 was not found as mounted
[ceph_volume.util.encryption][WARNING] failed to detect device mapper information
[ceph_volume.util.encryption][WARNING] failed to detect device mapper information
[ceph_volume.devices.simple.scan][WARNING] broken symlink found /tmp/tmpept0ox2j/block -> /dev/mapper/457d7196-4015-40fe-aa83-a160477450f7
[ceph_volume.devices.simple.scan][ERROR ] skipping due to IOError on file: /tmp/tmpept0ox2j/block
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/ceph_volume/devices/simple/scan.py", line 118, in scan_directory
    if system.is_binary(file_path):
  File "/usr/lib/python3.6/site-packages/ceph_volume/util/system.py", line 116, in is_binary
    with open(path, 'rb') as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpept0ox2j/block'
[ceph_volume.util.encryption][WARNING] failed to detect device mapper information
[ceph_volume.devices.simple.scan][INFO  ] skipping binary file: /tmp/tmpept0ox2j/block_dmcrypt

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1792122

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit d07436a)
To find the correct OSD id in all the OSD devices we need to scan them.
This requires to mount the lockbox partitions and open the encrypted
partitions when using dmcrypt.
After the ceph-volume simple scan command we should umount the lockbox
partitions otherwise each OSD containers will mount all lockbox
partitions.

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1806033

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 82a1ee7)
@dsavineau
Copy link
Contributor Author

jenkins test ceph_ansible-lvm_osds

1 similar comment
@dsavineau
Copy link
Contributor Author

jenkins test ceph_ansible-lvm_osds

@dsavineau dsavineau merged commit e213b24 into ceph:stable-3.2 Jun 18, 2020
@dsavineau dsavineau deleted the BZ1844591 branch June 18, 2020 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants