distcloud/distributedcloud/dcmanager/manager
Yuxing Jiang f55c356ab2 Trigger subcloud patch and load audits by updating identity
During the 1st round subcloud audit triggered by the subcloud manage
call, there's a race condition between the dcdbsync and the subcloud
audit. The subcloud patch audit will fail to authenticate due to the
keystone database is synchronizing and the original keystone patching
user and its role cannot be found. It results the patching and load
sync status remain as "unkown" until the next periodic audit.

This commit removes the trigger of audit from the manage action,
instead, adds the trigger when updating the identity resource from
unknown to the other statuses.

After this change, the patching audit is expected to be audited and
its status should be updated right after the identity status is
updated out of unkown.

Test plan:
1. Deployed several subclouds with this change.
2. Manage all the subclouds at the same time, no RC 401 error returns
from the patching audit. All the subclouds go in-sync in a short time.
3. Unmanage all the subclouds, and manage them again, all the subcloud
endpoints except the "dc-cert_sync_status" go in-sync -> unkown ->
in-sync without any error. The subcloud patch and load audits are
triggered after the identity endpoints turn back to in-sync.
4. Leave the subclouds for 1 hr, the update calls for updating the
identity in-sync from dcorch will not trigger an extra round of audits.
5. Add a user to update the identity status from in-sync -> out-of-sync
-> in-sync, extra subcloud patch and load audits are not triggered.
6. Apply a patch to the SystemController, the patch audit should
detect and raise the appropriate subcloud alarms.

Closes-bug: 1949477
Signed-off-by: Yuxing Jiang <yuxing.jiang@windriver.com>
Change-Id: I6b88fa6e5d9fd86b47f9662112be137ce80ed9cd
2021-11-19 10:51:59 -05:00
..
README.rst Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00
__init__.py Move content to subdir to support relocated packaging 2019-11-04 13:57:02 -05:00
service.py Updating some of the dcmanager and audit logs 2021-05-17 12:05:30 -05:00
subcloud_manager.py Trigger subcloud patch and load audits by updating identity 2021-11-19 10:51:59 -05:00

README.rst

Service

DC Manager Service has responsibility for:

Main subcloud state machine as well as all operations on subclouds including creation, deletion and update.

service.py:

run DC Manager service in multi-worker mode, and establish RPC server

subcloud_manager.py:

Manages all subcloud related activities such as creation, deletion, availability status, management state

audit_manager.py:

A Periodic audit to contact each subcloud and ensure that at least one of each service group is up and active, which is a pre-requisite for declaring a subcloud as online.

scheduler.py:

Thread group manager, also responsible for periodic timer tasks - ie. audit.