This commit will automatically delete the subcloud that was removed
from SPG on the peer site after the peer site migrated the SGP.
Conduct syntax checks for managing, unmanaging, deleting, and updating
subclouds, add or remove subcloud from SPG.
Specifically, If the secondary site leads the current SPG, the
subcloud can be removed from the SPG only when the primary site is
unavailable.
Test Plan:
PASS - Shutdown site1, migrate SPG to site2, and verify the status of
subclouds upon site1 recovery. As anticipated, the subclouds
transitioned to the secondary status.
PASS - Shutdown site1, migrate SPG to site2, then remove a subcloud
from the SPG on site2. Upon site1 recovery, verify the subclouds'
status. As expected, the subcloud was deleted in site1
corresponding to the removal of the subcloud from the SPG in
site2.
PASS - Shutdown site1, migrate SPG to site2, then remove a subcloud from
the SPG on site2 and subsequently delete it. Check the status of
subclouds upon site1 recovery. As expected, the subcloud was
deleted in site1 corresponding to the removal of the subcloud
from the SPG in site2.
PASS - Removal subcloud from the SPG in the primary site when it is the
current leader was successful as expected.
PASS - Keep site1 online, migrate SPG to site2, remove a subcloud from
SPG in site2 should not be allowed if site1 is online.
PASS - Add a subcloud that is offline/unmanaged to an SPG failed in
the primary site as expected.
PASS - Manage/unmanage subcloud failed when it associated to SPG.
PASS - Update subcloud successful when it associated to SPG in the
primary site and the SPG is the current leader.
PASS - Update subcloud failed when it associated to SPG in the secondary
site as expected.
Closes-bug: 2052415
Closes-bug: 2052584
Signed-off-by: Zhang Rong(Jon) <rong.zhang@windriver.com>
Change-Id: I210e2865228d166d7f5a5b26015ab07b4d09db47