CAPI to Pattern Migration: Procedure for switching from CAPI-based Cloud Discovery to pattern-based Cloud DiscoveryDescriptionThis article will document the migration process for converting specific cloud discoveries from using Cloud API probes (CAPI) to new pattern based discovery. Currently, this is available for Amazon Web Services (AWS) discovery and for Azure discovery.Release or EnvironmentThis CAPI to pattern migration process is supported only for customers who: are on Paris release or later.have the Discovery and/or Cloud Management plugin installed.have the Discovery and Service Mapping Patterns store application installed with versions mentioned below. Amazon Web Services (AWS) - version 1.0.66 or later.Azure - version 1.0.71 or later. InstructionsThis migration process will do the following: Disable the appropriate CAPI steps for the specific cloud environment to prevent them being triggered during cloud discovery.Enable the appropriate cloud patterns for the specific cloud environment that will be used to run future cloud discoveries. Below are the instructions for how to run this migration using UI 1. Navigate to Pattern Designer -> Migrate CPG to Pattern (In some old instance releases, the menu is: Pattern Designer -> Migrate CAPI to Pattern) 2. The initial UI Page should look like this once loaded. 3. Under Step One, click the Run Prerequisite Check button, which will trigger the prerequisite script to make sure the environment is ready to run the migration and also to check which migrations can be ran. More information on this prerequisite process can be found in the prerequisite section below. 4. After running the prerequisite check, if this completes successfully, there should be a scan PASSED message. This means the scan passed successfully.There will also be a link to the log record for this prerequisite check, which will reference the probe_to_pattern_log record that will look like this below. NOTE: If the scan does not complete successfully, there will be a message that says Prerequisite scan FAILED and then the log should contain the source of the failure.Please see troubleshooting section below for more details. 5. After the prerequisite scan is completed, there should also be a Step Two section that appears. Each button that appears will trigger the corresponding migration of the specified cloud type (except for the Migrate ALL button, which will trigger all the migrations sequentially). 6. Once a button is selected, there will be a pop-up window to confirm if the customer wants to run the selected migration. Once the OK button is selected, the migration will start.This will gray-out the respective migrate button and show that the migration is running.The log record should also show the migration as In Progress. 7. Once the migration completes, there should be a migration PASSED message and the log should state Completed. Additional InformationPrerequisite Before starting the CAPI to pattern migration, there are some prerequisites that must be met. This Run Prerequisite Check helps run these prerequisite checks and identifies what issues will need to be addressed prior to converting from CAPI to patterns. This process checks the following: Makes sure the instance has the appropriate Script Includes that are installed for customers who have Discovery plugin and are on Paris or later release.Checks the current CAPI scripts to make sure they exist and also checks which ones may have already been disabled.Checks if the new patterns that should be installed from the Discovery and Service Mapping Patterns store application exist and also if any of these patterns are already active. If all of these checks pass, then in the Capi Migration Prerequisite Check probe_to_pattern_log record, there should be results like this below. Otherwise, if any of these checks fail or if some warning messages appear, please check the troubleshooting section below to see how these issues can be addressed. then the prerequisite check will fail and the migrate buttons will not appear until the prerequisite scan is ran again and is successful. Known Issues There is a known issue after upgrading to the Discovery and Service Mapping Patterns application to version 1.0.71-74 with Azure Cloud Events creating relationships to West US datacenter.This is being addressed in PRB1478229. Troubleshooting 1. Prerequisite Results Below are some of the messages you may see on the UI Page and/or in the probe_to_pattern_log record with regards to the prerequisite check. A. Prerequisite scan FAILED Reason: This mainly occurs if there is a missing or inactive Script Include record that we require as part of the CAPI to pattern migration process, or if there are duplicate records with the same name that are active. See this list below for the Script Include files that this prerequisite script checks against. DiscoveryPatternOrchestratorEventHandler (sys_id: 4eea4e860f3580106dc4fe39b4767ef3)DiscoveryPatternOrchestratorFlowLauncher (sys_id: b0b205820ff180106dc4fe39b4767e4b)DiscoveryPatternOrchestratorFlowManager (sys_id: baf9b6b00f9040106dc4fe39b4767e5e)DiscoveryPatternOrchestratorUtil (sys_id: 9c3d828a0f3580106dc4fe39b4767eb1)PatternPayloadUtil (sys_id: c9f7ed010ff140106dc4fe39b4767ec8)DiscoveryPageManager (sys_id: 5b5dbf100f2700106dc4fe39b4767e17)AbstractDiscoveryMigrationHelper (sys_id: 650e9815dbee3300ef28f3e51d961972)DiscoveryAwsMigrationHelper (sys_id: c1865899dbae3300ef28f3e51d961966)DiscoveryAzureMigrationHelper (sys_id: 7b8f5895dbee3300ef28f3e51d961966) Solution: Check the probe_to_pattern_log record to see which Script Include(s) are causing this failure and address accordingly. B. Prerequisite scan PASSED, but some patterns and/or CAPI scripts may be missing Reason: This mainly occurs if there is a missing pattern and/or CAPI script record that we require as part of the CAPI to pattern migration process.In the probe_to_pattern_log record, you should also see at least one WARNING message when this occurs. Solution: The prerequisite check should still pass, but is is advised to check the probe_to_pattern log result to see which patterns and/or CAPI scripts are missing.For reference, the pattern records should be in the sa_pattern table and the CAPI scripts should be in the sn_cmp_rb_op_impl_step table. C. Found pattern record with different name Reason: This occurs if we found the pattern we are searching for based on sys_id, but the name value is different. Solution: The prerequisite check should still pass, but it is advised to check to see which patterns have had their name changed and why these have been changed. D. Pattern already active, CAPI step already disabled Reason: This occurs if the pattern being checked has already been activated or if the CAPI step being checked has already been disabled. Solution: The prerequisite check should still pass and as long as there is at least one pattern record to activate or one CAPI step to disable, then you should still be able to run the migration.Otherwise, if all the checked pattern are already active and all the checked CAPI steps are already disabled, then you should not see the migration button for the specific cloud type. 2. Migration Results Below are some of the messages you may see on the UI Page and/or in the probe_to_pattern_log record with regards to the cloud migrations. A. migration FAILED or migration stalled in migration running (>5 minutes) Reason: This should only occur if there is something wrong during the execution of the migration or something was modified that caused this behavior to occur. Solution: Retry the migration if possible (may need to reload the UI Page and run Prerequisite check again. If issue continues, please open a case with Technical Support to investigate accordingly. B. Migration has already been completed Reason: This pop-up window will appear if you are trying to run a migration that has already previously been completed.This can occur if someone deactivates one of the patterns or re-enables one of the CAPI steps after a migration has already been done before. Solution: Please check if this repeated migration is necessary and then you can either click OK to proceed or click Cancel to prevent running this migration again. C. Migration is already in progress Reason: This will appear if you are trying to run a migration against a cloud type that already has a migration currently running. Solution: Continue to monitor the currently running migration to see if/when it completes. If the migration does not complete after several minutes, please open a case with Technical Support to investigate accordingly. D. Migrations are still in progress Reason: This is a pop-up window that can appear to confirm about running a migration against a cloud type if there is another migration running against a different cloud type. Solution: While it is not recommended to run multiple migrations concurrently, this gives you the option to be able to do so if necessary.