Merge "Implment controller storage config"
This commit is contained in:
commit
5e6e047ed1
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user