Set subcloud to offline before reinstalling

In this commit, the DC upgrade orchestrator was updated to make
sure the subcloud would be offline during installation and migrating
data stages. This was changed to avoid misleading output when
checking the subcloud availability. Before this change, during the
mentioned stages, the availability would be online, even though it
was not possible to ping the subcloud. When the subcloud deploy
status changes to migrated, install failed or migration failed,
the audit will be triggered and the availability will be set
accordingly.

Test Plan:
PASS: upgrade system controller and sx subcloud and when orchestration
reach upgrade simplex, verify that subcloud is offline. Once subcloud
deploy status changes to migrated, verify that the subcloud is online.

Closes-Bug: 2017012

Signed-off-by: Christopher Souza <Christopher.DeOliveiraSouza@windriver.com>
Change-Id: Ie13e5750fabd35cc91689d5b7f9d3e09f637bba7
This commit is contained in:
Christopher Souza 2023-04-19 13:31:04 -03:00
parent 46c0c59a9c
commit d76f79b9bc
1 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2020-2022 Wind River Systems, Inc.
# Copyright (c) 2020-2023 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
@ -8,6 +8,7 @@ import keyring
import os
from base64 import b64encode
from dccommon.consts import AVAILABILITY_OFFLINE
from dccommon.install_consts import ANSIBLE_SUBCLOUD_INSTALL_PLAYBOOK
from dccommon.subcloud_install import SubcloudInstall
@ -379,6 +380,7 @@ class UpgradingSimplexState(BaseState):
# Run the remote install playbook
db_api.subcloud_update(
self.context, strategy_step.subcloud_id,
availability_status=AVAILABILITY_OFFLINE,
deploy_status=consts.DEPLOY_STATE_INSTALLING)
try:
install.install(consts.DC_ANSIBLE_LOG_DIR, install_command)