When an inactive controller-0 DX subcloud is targeted for rehoming,
the pre-rehome validation is observed to fail incorrectly and report
a misleading error. In this scenario, the active_controller check
(verify if it's controller-0) is expected to fail. However, the playbook
fails incorrectly/pre-maturely with the distributed_cloud_role check
failing to identify the target as a subcloud.
This pre-mature failure is a result of credentials not loading when
attempting to check the distributed_cloud_role. The credentials failure
is expected in this specific scenario, as the target is not the active
controller. However, this should not be
reported as distributed_cloud_role failure, as the issue is related
to the active controller.
This change ensures that the active controller check is performed
prior to the distributed_cloud_role check.
Test Plan:
1. PASS: Rehome a controller-1 active DX subcloud. Attempt it with each controller's oam address.
For each attempt, check the playbook logs and ensure:
1. Correct playbook task fails: controller check fails
(not the subcloud check)
2. The following error message is printed in the playbook logs: "Rehoming can only be done when controller-0 is active."
2. PASS: Swact the previously failing controller-1 active DX subcloud
and ensure that it can be rehomed successfully.
Reviewed: https:/ /review. opendev. org/c/starlingx /ansible- playbooks/ +/906744 /opendev. org/starlingx/ ansible- playbooks/ commit/ 4d2e62d02a45917 555ce933afbf465 bd4de9e7aa
Committed: https:/
Submitter: "Zuul (22348)"
Branch: master
commit 4d2e62d02a45917 555ce933afbf465 bd4de9e7aa
Author: Salman Rana <email address hidden>
Date: Thu Jan 25 11:00:52 2024 -0500
Fix: Rehoming Active Controller Check
When an inactive controller-0 DX subcloud is targeted for rehoming, pre-maturely with the distributed_ cloud_role check
the pre-rehome validation is observed to fail incorrectly and report
a misleading error. In this scenario, the active_controller check
(verify if it's controller-0) is expected to fail. However, the playbook
fails incorrectly/
failing to identify the target as a subcloud.
This pre-mature failure is a result of credentials not loading when cloud_role. The credentials failure cloud_role failure, as the issue is related
attempting to check the distributed_
is expected in this specific scenario, as the target is not the active
controller. However, this should not be
reported as distributed_
to the active controller.
This change ensures that the active controller check is performed cloud_role check.
prior to the distributed_
Test Plan:
Attempt it with each controller's oam address.
"Rehoming can only be done when controller-0 is active."
1. PASS: Rehome a controller-1 active DX subcloud.
For each attempt, check the playbook logs and ensure:
1. Correct playbook task fails: controller check fails
(not the subcloud check)
2. The following error message is printed in the playbook logs:
2. PASS: Swact the previously failing controller-1 active DX subcloud
and ensure that it can be rehomed successfully.
Closes-Bug: 2051262
Change-Id: I1a289e26db0a95 619c8107a3e734e 8531e77592e
Signed-off-by: Salman Rana <email address hidden>