Retry platform resize during upgrade-activate

Due to the validation added on [1], the first attempt to resize
the platform controllerfs may now fail as the script will resize
backup host filesystems prior to resizing platform, thus forcing
subsequent fs resize commands to wait for the agent to report back
to conductor before allowing other filesystem resize commands.

This commit makes the script retry the controllerfs-modify command
during its validation phase if the platform size is different from
the resized size.

Also, because of the possible extra waiting time added until agents
report back, the sleep time during the platform fs validation phase
was bumped up.

[1] https://review.opendev.org/c/starlingx/config/+/839384

Test Plan:
PASS: run upgrade-activate on Standard System Controller, verify
      that script runs successfully and backup/platform filesystems
      are resized accordingly
PASS: run upgrade-activate on AIO-DX System Controller, verify that
      script runs successfully and backup/platform are resized
      accordingly

Closes-bug: 1973817
Change-Id: I83dc7ce365d8cd490fdfd3c6b68661082e9dd102
Signed-off-by: Heitor Matsui <HeitorVieira.Matsui@windriver.com>
This commit is contained in:
Heitor Matsui 2022-05-17 15:10:35 -03:00
parent a08d48e6e9
commit 5d36bedaa5
1 changed files with 6 additions and 1 deletions

View File

@ -29,7 +29,7 @@ ACTION=$3
EXPANDED_PLATFORM_SIZE=20
NODE_LIST=(controller-0 controller-1)
RESIZE_SLEEP_TIME=60
RESIZE_SLEEP_TIME=90
RESIZE_CHECK_MAX_RETRIES=5
source /etc/platform/openrc
@ -93,6 +93,11 @@ function resize_platform_controllerfs {
if [[ ($_CURRENT_PLATFORM_SIZE -eq $EXPANDED_PLATFORM_SIZE) && ($_CURRENT_PLATFORM_STATE == "available") ]]; then
return 0
fi
# if current size is less than the expanded size, retry the resize command
if [[ $_CURRENT_PLATFORM_SIZE -lt $EXPANDED_PLATFORM_SIZE ]]; then
log "$NAME: Current platform size is less than ${EXPANDED_PLATFORM_SIZE}G, retrying resize command..."
system controllerfs-modify platform=$EXPANDED_PLATFORM_SIZE
fi
sleep $RESIZE_SLEEP_TIME
done