Store additional OSD information in ZK

Ensures that information like the FSIDs and the OSD LVM volume are
stored in Zookeeper at creation time and updated at daemon start time
(to ensure the data is populated at least once, or if the /dev/sdX
path changes).

This will allow safer operation of OSD removals and the potential
implementation of re-activation after node replacements.
This commit is contained in:
2022-05-02 12:11:32 -04:00
parent cea8832f90
commit 464f0e0356
4 changed files with 159 additions and 11 deletions

View File

@ -943,7 +943,9 @@ def entrypoint():
# Add any missing OSDs to the list
for osd in [osd for osd in new_osd_list if osd not in osd_list]:
d_osd[osd] = CephInstance.CephOSDInstance(zkhandler, this_node, osd)
d_osd[osd] = CephInstance.CephOSDInstance(
zkhandler, logger, this_node, osd
)
# Remove any deleted OSDs from the list
for osd in [osd for osd in osd_list if osd not in new_osd_list]:
@ -963,7 +965,9 @@ def entrypoint():
# Add any missing pools to the list
for pool in [pool for pool in new_pool_list if pool not in pool_list]:
d_pool[pool] = CephInstance.CephPoolInstance(zkhandler, this_node, pool)
d_pool[pool] = CephInstance.CephPoolInstance(
zkhandler, logger, this_node, pool
)
# Prepare the volume components for this pool
volume_list[pool] = list()
d_volume[pool] = dict()
@ -993,7 +997,7 @@ def entrypoint():
if volume not in volume_list[pool]
]:
d_volume[pool][volume] = CephInstance.CephVolumeInstance(
zkhandler, this_node, pool, volume
zkhandler, logger, this_node, pool, volume
)
# Remove any deleted volumes from the list