How to add an existing business service to Service Mapping

Alexander Mitov
Giga Guru

Hi,

 

We have recently enabled Service Mapping on one of our Istanbul instances and we need to map some Business Services. The problem that we are facing is that we already have CIs for those services in the cmdb_ci_service table and those are being used by Incident Management. We are looking for a way to make those records visible in Service Mapping as well, so that we could start mapping them. Is that even possible?

 

During my research on this I found out the following flow is in place:

1. Creating a Business Service in Service Mapping populates the cmdb_ci_service_discovered table.

2. This new record triggers a business rule: "Sync with Service Modeling". It uses a server-side java class (SNC.ServiceModelingIntegrationManager()) which seems to populate the cmdb_ci_service_auto and cmdb_ci_service tables with the same record (the sys_id is the same).

 

What we are trying to achieve is the reverse of this flow. Our Business Services exist in cmdb_ci_service and we need to have them visible in Service Mapping (cmdb_ci_service_discovered). I tried to use a script to manually create a record in cmdb_ci_service_discovered with the same attribute values and sys_id as one of the existing ones from cmdb_ci_service (after disabling the "Check service name uniqueness" business rule). Needless to say this didn't work - we can't set up sys_id values ourselves when creating a new record. The record was created, but the sys_id was a new one.

 

Any information on this matter is highly appreciated.

 

Thanks,

Alex

5 REPLIES 5

Dewin Albert2
Mega Expert

can you see the business services listed in this table?

"sa_discovered_services"

 

"cmdb_ci_service" is the table of cmdb for Bussiness services. The service mapping uses the table mentioned above. 

To begin with, open any BS from Service Mapping module and give an entry point and then go to view map. It ll trigger discovery when you enter for the first time. For the second time go to view map click on run discovery. 🙂

 

Hope this helps 🙂

Hi Dewin,

 

Thank you for your reply. 

 

 

What I am struggling with is that the services we have were created through Configuration >> Business Services (stored in cmdb_ci_service) and now that we have Service Mapping enabled, we need to perform mapping on those service CIs instead of creating new business services through Service Mapping >> Business Services. Otherwise all related historical data will remain linked to the old service CIs.

 

I see no table with name "sa_discovered_services". Our business services are located in "cmdb_ci_service" and services created through Service Mapping have an entry in "cmdb_ci_service_discovered", "cmdb_ci_service_auto" and "cmdb_ci_service". I don't know the exact mechanism of replicating the record between the three tables, so I am not sure if it is possible (and how) to revert the process and get an old record from "cmdb_ci_service" to be present in the other two tables.

 

The only alternative that I can think of is to create new services through Service Mapping, then write and run a script which will change the selected service from the old to the new one in all of the existing incidents and requests.

 

Thanks,

Alex 

Sorry, my bad. I mentioned the table from Kingston release.

 

Okay, So the Discovered Services(cmdb_ci_service_discovered) is nothing but an extended table of Bussiness service(cmdb_ci_service)

So what I did is, exported a ci record from Bussiness service table as xml, Changed the sys class name to cmdb_ci_service_discovered from cmdb_ci_service and import the xml record. Now the data is moved to the service mapping table without any other change.

"<sys_class_name>cmdb_ci_service_discovered</sys_class_name>"

 

Add an entrypoint and continue mapping.

Known Issue. It won't show the view map from the list. You need to open the service and then click on view map.

Will update if I find more information.

 

 

Alexander Mitov
Giga Guru

Hi Dewin,

 

Thank you. This is very helpful indeed.

 

I could not manage to import the service this way though. When it was being imported I got an error regarding an entry with this sys_id already being present. As I did not find anything helpful in the logs, I suspect that during insert in the discovered service table it tried to create a new record (not to update the existing one) in the business service table (cmdb_ci_service) as well and failed due to duplicate primary key. I think there is background logic which does that automatically (possibly the Sync with Service Modeling rule).

If I remove the original service, a new record is created in both tables and the original sys_id is used, which is the desired result. However, removing the original service also removes all relations to it (incidents and requests) so this won't work.

 

I will do some experiments with disabling/modifying the business rules on those tables to see if I get further. I will post the results I get.

 

Thanks,

Alex