Skip to content

Commit

Permalink
entrypoint: Allow to map dmcrypt data partitions
Browse files Browse the repository at this point in the history
In order to get the OSD ids with ceph-disk list command, we need first
to map the dmcrypt data partitions (mount the lockbox partition and
then open the encrypted partition).

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

Signed-off-by: Dimitri Savineau <[email protected]>
(cherry picked from commit 3a5e7c8)
  • Loading branch information
dsavineau committed Jul 24, 2019
1 parent cc63710 commit f511e94
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/daemon/common_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -517,3 +517,15 @@ function ami_privileged {
# lsblk is not able to get device mappers path and is complaining.
# That's why stderr is suppressed in /dev/null
}

# Map dmcrypt data device
function dmcrypt_data_map() {
for lockbox in $(blkid -t PARTLABEL="ceph lockbox" -o device | tr '\n' ' '); do
OSD_DEVICE=${lockbox:0:-1}
DATA_PART=$(dev_part "${OSD_DEVICE}" 1)
DATA_UUID=$(get_part_uuid "$(dev_part "${OSD_DEVICE}" 1)")
LOCKBOX_UUID=$(get_part_uuid "$(dev_part "${OSD_DEVICE}" 5)")
mount_lockbox "${DATA_UUID}" "${LOCKBOX_UUID}"
ceph-disk --setuser ceph --setgroup disk activate --dmcrypt --no-start-daemon ${DATA_PART} || true
done
}
4 changes: 4 additions & 0 deletions src/daemon/entrypoint.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ case "$CEPH_DAEMON" in
source osd_volume_activate.sh
osd_volume_activate
;;
osd_ceph_disk_dmcrypt_data_map)
# TAG: osd_ceph_disk_dmcrypt_data_map
dmcrypt_data_map
;;
mds)
# TAG: mds
source start_mds.sh
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/variables_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# LIST OF ALL SCENARIOS AVAILABLE #
###################################

ALL_SCENARIOS="populate_kvstore mon osd osd_directory osd_directory_single osd_ceph_disk osd_ceph_disk_prepare osd_ceph_disk_activate osd_ceph_disk_activate_only osd_ceph_activate_journal mds rgw rgw_user restapi nfs zap_device mon_health mgr disk_introspection demo disk_list tcmu_runner rbd_target_api rbd_target_gw"
ALL_SCENARIOS="populate_kvstore mon osd osd_directory osd_directory_single osd_ceph_disk osd_ceph_disk_prepare osd_ceph_disk_activate osd_ceph_disk_activate_only osd_ceph_activate_journal osd_ceph_disk_dmcrypt_data_map mds rgw rgw_user restapi nfs zap_device mon_health mgr disk_introspection demo disk_list tcmu_runner rbd_target_api rbd_target_gw"


#########################
Expand Down

0 comments on commit f511e94

Please sign in to comment.