Implment controller storage config

Implementation of the function that configures
the OSDs in controller-0 and controller-1

Test Plan:
PASS - OSDs are configured in both controllers
in the STANDARD installation.

Story: 2005051
Task: 49185

Change-Id: If0c5ef02da705165bc01f7db2236e8bf727eefb8
Signed-off-by: Daniel Caires <daniel.caires@encora.com>
This commit is contained in:
Daniel Caires 2023-12-06 13:44:26 -03:00
parent 778b379768
commit 7074eee6a0

View File

@ -1706,14 +1706,30 @@ def stage_setup_controller_storage(ssh_client):
"""Provision controller storage"""
try:
# Add controller storage setup here
LOG.info("#### Provision controller storage")
commands = [
'echo "TODO";',
]
run_ssh_cmd_list(ssh_client,
commands,
timeout=HostTimeout.NORMAL_OP)
controllers = list(get_hostnames(personalities=
['controller']).values())
osd = "/dev/sdb"
for controller in controllers:
commands = [
f'DISKS=$(system host-disk-list {controller});'
f'TIERS=$(system storage-tier-list ceph_cluster);'
f"""UUID=$(echo "$DISKS" | grep "{osd}" | awk '{{print $2}}')"""
r"TIER_UUID=$(echo $TIERS | grep storage | awk '{print $2}');"
f'system host-stor-add {controller} $UUID --tier-uuid $TIER_UUID'
f'while true; do '
f' system host-stor-list {controller} | grep {osd} | grep configuring; '
f"if [ $? -ne 0 ]; "
f"then break; "
f"fi; "
f"sleep 1; "
f"done",
f"system host-stor-list {controller}"
]
run_ssh_cmd_list(ssh_client,
commands,
timeout=HostTimeout.NORMAL_OP)
except:
LOG.error("Failed stage: %s", STG_SETUP_CTRL_STORAGE)
raise