Incorrect rehoming error message when DX subcloud controller-1 is the active controller

Bug #2051262 reported by srana
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Low
srana

Bug Description

Brief Description
-----------------
The Rehoming Ansible Playbook is failing as expected when controller-1 is the Active Controller for an AIO-DX subcloud; however, the error message is showing that the target is not a subcloud, which may confuse the user.

msg: The target is not a subcloud. Only subclouds can be rehomed.

Severity
--------
Minor

Steps to Reproduce
------------------
1. Install 2 System Controllers (S1 & S2) for Rehoming a subcloud

2. Deploy and Manage an AIO-DX subcloud on S1

3. Unmanage AIO-DX HW subcloud on S1

4. Swact subcloud controller-0, making controller-1 the active controller

5. Connect to S2 and initiate the rehoming

Expected Behavior
------------------
Rehoming playbook displaying a message that rehoming cannot be performed as controller-0 is not the active controller

Actual Behavior
----------------
Rehoming playbook displaying a message that rehoming cannot be performed that the target is not a subcloud

Reproducibility
---------------
100%

System Configuration
--------------------
2 DC Systems

Branch/Pull Time/Commit
-----------------------
Master

Last Pass
---------
N/A

Timestamp/Logs
--------------
TASK [rehome-subcloud/validate-before-rehome : Verify that the target is a subcloud] ***
Wednesday 17 January 2024 20:24:02 +0000 (0:00:07.240) 0:00:13.269 *****
fatal: [subcloud4008]: FAILED! => changed=false
  msg: The target is not a subcloud. Only subclouds can be rehomed.

PLAY RECAP *********************************************************************
subcloud4008 : ok=15 changed=4 unreachable=0 failed=1 skipped=18 rescued=0 ignored=0

Test Activity
-------------
Evaluation

Workaround
----------
Ignore the error message and swact to controller-0.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ansible-playbooks (master)
Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ansible-playbooks (master)

Reviewed: https://review.opendev.org/c/starlingx/ansible-playbooks/+/906744
Committed: https://opendev.org/starlingx/ansible-playbooks/commit/4d2e62d02a45917555ce933afbf465bd4de9e7aa
Submitter: "Zuul (22348)"
Branch: master

commit 4d2e62d02a45917555ce933afbf465bd4de9e7aa
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,
    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.

    Closes-Bug: 2051262

    Change-Id: I1a289e26db0a95619c8107a3e734e8531e77592e
    Signed-off-by: Salman Rana <email address hidden>

Changed in starlingx:
status: In Progress → Fix Released
Ghada Khalil (gkhalil)
tags: added: stx.9.0 stx.distcloud
Changed in starlingx:
assignee: nobody → srana (salmanr)
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.