From: FrancescoFioraEst Date: Thu, 6 Nov 2025 16:10:25 +0000 (+0000) Subject: Update docs for Rollback in the reverse order X-Git-Tag: 5.2.2~2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F142395%2F2;p=policy%2Fparent.git Update docs for Rollback in the reverse order Issue-ID: POLICY-5474 Change-Id: I7bd000cca6326e9bb0eefdbe87f6aa8ac2435818 Signed-off-by: FrancescoFioraEst --- diff --git a/docs/clamp/acm/acm-participant-guide.rst b/docs/clamp/acm/acm-participant-guide.rst index 1418df9c..2b1e1a72 100644 --- a/docs/clamp/acm/acm-participant-guide.rst +++ b/docs/clamp/acm/acm-participant-guide.rst @@ -1105,7 +1105,7 @@ The following example shows the Handler implementation and how could be the impl The following example shows how could be the implemented the update/migration/rollback notifications. -Note: the removed elements always happen at stage 0 +**Note**: the removed elements always happen at stage 0 in migration and at the higher stage in rollback. .. code-block:: java diff --git a/docs/clamp/acm/design-impl/clamp-runtime-acm.rst b/docs/clamp/acm/design-impl/clamp-runtime-acm.rst index bfeecebe..71efd8a7 100644 --- a/docs/clamp/acm/design-impl/clamp-runtime-acm.rst +++ b/docs/clamp/acm/design-impl/clamp-runtime-acm.rst @@ -366,12 +366,15 @@ How Stage works +++++++++++++++ In state changes in MIGRATING Automation Composition elements starts in increasing order from stage 0. -Example of MIGRATE order with Http_PMSHMicroserviceAutomationCompositionElement with stage [0,2] and PMSH_K8SMicroserviceAutomationCompositionElement with stage to [0,1]: +Example of MIGRATE order with Http_PMSHMicroserviceAutomationCompositionElement with stages [0,2], +PMSH_K8SMicroserviceAutomationCompositionElement with stages [0,1], +and Policy_MicroserviceAutomationCompositionElement not present in composition target (default stages is [0]). +Stages are defined in composition target: - ACM-runtime sends a broadcast AUTOMATION_COMPOSITION_MIGRATION message to all participants with stage = 0 -- participant receives the AUTOMATION_COMPOSITION_MIGRATION message and runs the migration only the AC elements that contains stage 0: Http_PMSHMicroserviceAutomationCompositionElement and PMSH_K8SMicroserviceAutomationCompositionElement -- participant calculates the next stage and sends the AUTOMATION_COMPOSITION_DEPLOY_ACK message to runtime with the next stage -- ACM-runtime receives AUTOMATION_COMPOSITION_DEPLOY_ACK messages from participants and set the state and stage from the AC element of the message +- participant receives the AUTOMATION_COMPOSITION_MIGRATION message and runs the migration only the AC elements that contains stage 0: Http_PMSHMicroserviceAutomationCompositionElement, PMSH_K8SMicroserviceAutomationCompositionElement and Policy_MicroserviceAutomationCompositionElement +- participant calculates the next stage and sends the AUTOMATION_COMPOSITION_DEPLOY_ACK message to runtime with the next stage and DELETED for Policy_MicroserviceAutomationCompositionElement +- ACM-runtime receives AUTOMATION_COMPOSITION_DEPLOY_ACK messages from participants and set the state and stage from the AC element of the message and Policy_MicroserviceAutomationCompositionElement is removed from the instance - ACM-runtime calculates that all AC elements have forwarded to next stage and sends a broadcast AUTOMATION_COMPOSITION_MIGRATION message with stage = 1 - participant receives the AUTOMATION_COMPOSITION_MIGRATION message and runs the migration only the AC elements that contains stage 1: PMSH_K8SMicroserviceAutomationCompositionElement - participant sends the AUTOMATION_COMPOSITION_DEPLOY_ACK message to runtime with the next stage or migration completed @@ -383,7 +386,34 @@ Example of MIGRATE order with Http_PMSHMicroserviceAutomationCompositionElement - ACM-runtime calculates that all AC elements are set to proper state and set AC to DEPLOYED In that scenario the message AUTOMATION_COMPOSITION_MIGRATION has been sent three times, -Http_PMSHMicroserviceAutomationCompositionElement and PMSH_K8SMicroserviceAutomationCompositionElement will be executed two times. +Http_PMSHMicroserviceAutomationCompositionElement and PMSH_K8SMicroserviceAutomationCompositionElement will be executed two times, +and Policy_MicroserviceAutomationCompositionElement only in the first stage. + +How Stage works in Rollback ++++++++++++++++++++++++++++ +In state changes in MIGRATION_REVERTING Automation Composition elements starts in decreasing order from the higher stage to the lower one. + +Example of ROLLBACK order with Http_PMSHMicroserviceAutomationCompositionElement with stages [0,2], +PMSH_K8SMicroserviceAutomationCompositionElement not present in composition target (default stages is [2]). +and Policy_MicroserviceAutomationCompositionElement with stages [0,1]. Stages are defined in composition: + +- ACM-runtime sends a broadcast AUTOMATION_COMPOSITION_MIGRATION message to all participants with stage = 2 +- participant receives the AUTOMATION_COMPOSITION_MIGRATION message and runs the migration only the AC elements that contains stage 2: Http_PMSHMicroserviceAutomationCompositionElement and PMSH_K8SMicroserviceAutomationCompositionElement +- participant calculates the next stage and sends the AUTOMATION_COMPOSITION_DEPLOY_ACK message to runtime with the next stage and DELETED for PMSH_K8SMicroserviceAutomationCompositionElement +- ACM-runtime receives AUTOMATION_COMPOSITION_DEPLOY_ACK messages from participants and set the state and stage from the AC element of the message and PMSH_K8SMicroserviceAutomationCompositionElement is removed from the instance +- ACM-runtime calculates that all AC elements have forwarded to next stage and sends a broadcast AUTOMATION_COMPOSITION_MIGRATION message with stage = 1 +- participant receives the AUTOMATION_COMPOSITION_MIGRATION message and runs the migration only the AC elements that contains stage 1: Policy_MicroserviceAutomationCompositionElement +- participant sends the AUTOMATION_COMPOSITION_DEPLOY_ACK message to runtime with the next stage or migration completed +- ACM-runtime receives AUTOMATION_COMPOSITION_DEPLOY_ACK messages from participants and set the state and stage from the AC element of the message +- ACM-runtime calculates that all AC elements have forwarded to next stage or completed and sends a broadcast AUTOMATION_COMPOSITION_MIGRATION message with stage = 0 +- participant receives the AUTOMATION_COMPOSITION_MIGRATION message and runs the migration only the AC elements that contains stage 0: Http_PMSHMicroserviceAutomationCompositionElement and Policy_MicroserviceAutomationCompositionElement +- participant sends the AUTOMATION_COMPOSITION_DEPLOY_ACK message to runtime with migration completed +- ACM-runtime receives AUTOMATION_COMPOSITION_DEPLOY_ACK messages from participants and set the state (from the AC element of the message) to DEPLOYED +- ACM-runtime calculates that all AC elements are set to proper state and set AC to DEPLOYED + +In that scenario the message AUTOMATION_COMPOSITION_MIGRATION has been sent three times, +Http_PMSHMicroserviceAutomationCompositionElement and Policy_MicroserviceAutomationCompositionElement will be executed two times, +and PMSH_K8SMicroserviceAutomationCompositionElement only in the first stage. Add and remove elements during Migration **************************************** diff --git a/docs/clamp/acm/files/ACM-Message-Table.csv b/docs/clamp/acm/files/ACM-Message-Table.csv index 978ad033..8b6fd9b0 100755 --- a/docs/clamp/acm/files/ACM-Message-Table.csv +++ b/docs/clamp/acm/files/ACM-Message-Table.csv @@ -82,6 +82,7 @@ AutomationCompositionMigration,ACM Runtime,Participant,Message to request update ,,,,participantIdList, The list of all participants involved in this message ,,,,precheck,Flag - if true it is a Migration Precheck ,,,,rollback,Flag - if true it is a Rollback of the Migration failed +,,,,firstStage,Flag - if true it is a fist stage during Migration/Rollback ,,,,compositionId,The id of the AC Definition related to this message ,,,,compositionTargetId,The id of the AC Definition target ,,,,automationCompositionId,The id of the automation composition related to this message