]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: add dmcrypt support in raw mode
authorGuillaume Abrioux <gabrioux@redhat.com>
Fri, 24 Apr 2020 14:45:02 +0000 (16:45 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 29 Jun 2020 11:44:49 +0000 (11:44 +0000)
commit02cda36478a3b0a2f61aa2c692726477c4f67117
treebd30edbf41cdc0fb5eeed2bc12b7d5c7503e1ec2
parentb340acf629a010a74d90da5782a2c5fe0b54ac20
ceph-volume: add dmcrypt support in raw mode

This commit adds the dmcrypt support in `ceph-volume raw` mode.

Note about `ceph-volume raw list` change:
Given `lsblk -J` (json output) option isn't available on all OS, I came up with
adding '--inverse' option to the existing command which allows us to get the
mapper devices list in that command output. Not listing root devices containing
partitions shouldn't have side effect since we are in `ceph-volume raw`
context.

example:
running `lsblk --paths --nodeps --output=NAME --noheadings` doesn't allow to
get the mapper list because the output is like following :

$ lsblk --paths --nodeps --output=NAME --noheadings
/dev/sda
/dev/sdb
/dev/sdc
/dev/sdd

the dmcrypt mappers are hidden because of the `--nodeps` given they are
displayed as a dependency.

$ lsblk --paths --output=NAME --noheadings
/dev/sda
|-/dev/mapper/ceph-3b52c90d-6548-407d-bde1-efd31809702f-sda-block-dmcrypt
`-/dev/mapper/ceph-3b52c90d-6548-407d-bde1-efd31809702f-sda-db-dmcrypt
/dev/sdb
/dev/sdc
/dev/sdd

adding `--inverse` is a trick to get around this issue, the counterpart is that
we can't list root devices if they contain at least one partition but this
shouldn't be an issue in `ceph-volume raw` context given we only deal with
raw devices.

Fixes: https://tracker.ceph.com/issues/45959
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 159c30d29f009c07e51a4bd7cd5ecea8cf6c8739)
src/ceph-volume/ceph_volume/devices/raw/common.py
src/ceph-volume/ceph_volume/devices/raw/list.py
src/ceph-volume/ceph_volume/devices/raw/prepare.py