{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":30121,"path":"it-operations-management/discovery-and-service-mapping-patterns/ibm-cloud-platform-discovery.md","title":"IBM Cloud Platform discovery","bundle":null,"doc_type":null,"release":"australia","body":"\n# IBM Cloud Platform discovery\n\nThe ServiceNow Discovery application finds IBM Cloud Platform components \\(Softlayer API v3 and v3.1 and Bluemix API v2\\) using the IBM Cloud Platform patterns. Discovering some of these resources might require updating to the latest version of the Discovery and Service Mapping Patterns application from the ServiceNow Store.\n\nYou can use the patterns on the ServiceNow AI Platform using London Patch 7, Madrid Patch 2, or later releases.\n\n## Request apps on the Store\n\nVisit the [ServiceNow Store](https://store.servicenow.com/sn_appstore_store.do#!/store/home) to view all the available apps, and for information about submitting requests to the store. For cumulative release notes information for all released apps, see the [ServiceNow Store version history release notes](https://www.servicenow.com/docs/r/store-release-notes/sn-store-release-notes.html).\n\n## Prerequisites\n\n-   **MID Server**\n\n    Use a dedicated MID Server for cloud discovery. The MID Server must have 16 Cores, 8 GB with 4 GB Java Memory Model \\(JVM\\) memory allocation.\n\n    Deploy and connect the dedicated MID Server with internet access.\n\n-   **Credentials**\n\n    The cloud resources are in an IBM cloud. Create the IBM Credentials for accessing your IBM account.\n\n    1.  Navigate to **Discovery** &gt; **Credentials**.\n    2.  Click **New**.\n    3.  Click **IBM Credentials** and then fill in the form:\n\n        |Field|Description|\n        |-----|-----------|\n        |Name|Credential name. An example is `ibm-cred`.|\n        |Order|Order in which the platform tries this credential as it attempts to log on to devices. A smaller number indicates that the credential appears higher in the list. Establish the credential order when using large numbers of credentials or when security locks out users after three failed login attempts. If all the credentials have the same order number, or none, the instance tries the credentials in a random order. The default value is 100.|\n        |Softlayer API User|Username for the Softlayer API. Use the Softlayer API Username defined in the Softlayer console.|\n        |Softlayer API Key|Key for the Softlayer API. Use the Softlayer API Key that is defined in the Softlayer console.|\n        |Bluemix API Key|Key for the Bluemix API. Use the Bluemix API Key defined in the IBM Cloud console.|\n\n    4.  Click **Submit**.\n-   **Create an IBM cloud service account**\n\n    Use the credentials defined in the preceding procedure to create the IBM cloud service account.\n\n\n1.  Navigate to **Cloud Provisioning and Governance** &gt; **Service Accounts**.\n2.  Click **New**.\n3.  On the form, fill in the fields:\n\n    |Field|Description|\n    |-----|-----------|\n    |Name|Credential name. An example is `ibm-snow`|\n    |Account Id|IBM account ID name. Enter the IBM Account ID.|\n    |Discovery credentials|Discovery credentials that you defined earlier.|\n    |Datacenter Type|Datacenter type. As an example, `IBM Datacenter [cmdb_ci_ibm_datacenter]`|\n\n4.  Click **Submit**.\n\n-   **Create a Discovery schedule**\n\n    To configure a Discovery schedule through Discovery Admin Workspace, see [Create an IBM Discovery schedule in Discovery Admin Workspace](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/discovery/create-ibm-schedule-DAW.md).\n\n    To configure a serverless Discovery schedule:\n\n    1.  On the ServiceNow AI Platform, navigate to **Discovery** &gt; **Discovery Schedules**.\n    2.  Click **New**.\n    3.  On the form, fill in the fields:\n\n        |Field|Description|\n        |-----|-----------|\n        |Name|Name for this Discovery schedule. As an example, `Serverless Pattern`|\n        |Discover|Discover type. Select **Serverless**|\n        |MID Server|Name of the MID Server. As an example, `Discovery_Server`|\n        |Active|Option for enabling this schedule for Discovery. Select this check box to enable Discovery.|\n        |Run|Specifies how frequently to run the Discovery schedule.|\n\n    4.  Right-click the header of the Discovery Schedule form and select **Save**.\n\n        \\[Omitted image \"serverless-execution-pattern.png\"\\] Alt text: Serverless execution pattern\n\n    5.  Click the **Serverless Execution Patterns** tab.\n    6.  Click **New**.\n    7.  On the form, fill in the fields:\n\n<table id=\"table_k3d_bzy_fhb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nName for this Serverless Execution Pattern. As an example, `IBM1`\n\n</td></tr><tr><td>\n\nPattern\n\n</td><td>\n\nName of the pattern that you want to run.\\[Omitted image \"ibm-patterns.png\"\\] Alt text: IBM patterns\n\n If you want to run multiple patterns, create multiple records.\n\n</td></tr><tr><td>\n\nProxy Host\n\n</td><td>\n\nFully qualified domain name of the machine on which you are installing the proxy server. Specify **Global**.\n\n</td></tr><tr><td>\n\nActive\n\n</td><td>\n\nOption for enabling this schedule for Discovery. Select this check box to enable Discovery.\n\n</td></tr></tbody>\n</table>    8.  Configure the parameters required by the IBM Cloud Platform pattern as follows:\n\n        |Parameter|Description|\n        |---------|-----------|\n        |cloud\\_cred\\_id|The sys\\_id of the IBM credentials specified into the configuration.|\n        |cloud\\_account\\_id|The IBM account ID.|\n        |cloud\\_datacenter\\_type|cmdb\\_ci\\_ibm\\_datacenter|\n\n    9.  **Update**.\n    10. To start Discovery, navigate to the Serverless Discovery definition and click **Discover Now**.\n-   **IBM flow - horizontal discovery**\n    -   To perform a discovery using a serverless schedule, the IBM Cloud Platform patterns that were selected run and discover IBM Cloud Platform resources.\n    -   To perform a discovery using a service account, a full IBM Cloud Platform discovery schedule runs, discovering all supported IBM Cloud Platform resources.\n-   **Cloud custom operation**\n\n    Cloud REST – Add Response to Context\n\n    Operation for Cloud REST queries that supports large-scale responses and better memory usage.\n\n    -   Specify all the fields with the same values as in the Cloud REST Query custom operation, except to specify the table for the response, which is set in the **Response Variable Name** field.\n\n        \\[Omitted image \"response-variable-name.png\"\\] Alt text: Response field\n\n    -   Set **Define parsing** to None.\n    Methods to retrieve data for the IBM account\n\n    1.  Navigate to **Pattern Designer** &gt; **Custom Operations**.\n\n        \\[Omitted image \"cloud-rest-query.png\"\\] Alt text: Cloud REST query\n\n    2.  Click **Cloud REST – add response to context**.\n    Method: Get Call\n\n    API URLs used to retrieve the data:\n\n    -   Load Balancer **https://api.softlayer.com/rest&lt;api\\_version&gt;/SoftLayer\\_Network\\_LBaaS\\_LoadBalancer/getAllObjects?objectMask=mask\\[listeners\\[defaultPool\\],members,healthMonitors\\]**\n    -   Network **https://api.softlayer.com/rest/&lt;API\\_VERSION&gt;/SoftLayer\\_Account/getNetworkVlans?objectMask=mask\\[primaryRouter.datacenter,name,id,vlanNumber,networkSpace\\]**\n    -   Network **https://api.softlayer.com/rest/&lt;API\\_VERSION&gt;/SoftLayer\\_Account/getSubnets?objectMask=mask\\[datacenter\\]**\n    -   Network**https://api.softlayer.com/rest/&lt;API\\_VERSION&gt;/SoftLayer\\_Account/getSecurityGroups?objectMask=mask\\[rules\\]**\n    -   Organizations and Spaces **https://api.&lt;region&gt;.bluemix.net/v2/organizations**\n    -   **https://api.&lt;region&gt;.bluemix.net/v2/spaces**\n    -   SSH Key **https://api.softlayer.com/rest/v3/SoftLayer\\_Account/SoftLayer\\_Account/getSshKeys**\n    -   Storage **https://api.softlayer.com/rest/&lt;api\\_version&gt;/SoftLayer\\_Account/getNetworkStorage**\n    -   Virtual Server **https://api.softlayer.com/rest/v3.1/SoftLayer\\_Account/getSecurityGroups**\n    -   **http://api.softlayer.com/rest/v3.1/SoftLayer\\_Account/getSecurityGroups?objectMask=mask\\[id,name,networkComponentBindings\\[networkComponentId,networkComponent\\[networkId,guest\\[fullyQualifiedDomainName,hostname,id,datacenter\\[name\\]\\]\\]\\]\\]**\n    -   **https://api.softlayer.com/rest/v3.1/SoftLayer\\_Account/getVirtualGuests?objectMask=mask\\[hostname,domain,powerState,fullyQualifiedDomainName,notes,id,statusId,placementGroupId,sshKeys\\[label,key,id,fingerprint,createDate,modifyDate,notes\\],primaryBackendIpAddress,primaryIpAddress,networkVlans\\[id,name,note,vlanNumber\\],blockDeviceCount,blockDevices\\[device,diskImageId,mountType,guestId,id,mountMode\\],allowedNetworkStorage\\[id,fileNetworkMountAddress,iscsiTargetIpAddresses,nasType,username,serviceResourceBackendIpAddress\\],maxCpu,maxMemory,datacenter,networkComponentCount,regionalGroup,datacenter,location,operatingSystem\\[id,softwareDescription\\[id,name,longDescription,manufacturer,referenceCode,version\\]\\],networkComponents\\[guestId,id,port,name,primarySubnet\\[networkIdentifier,id,networkVlan\\[id\\]\\],status,macAddress,primaryIpAddress\\]\\]**\n-   **EVAL functions**\n\n    Use the following EVAL function to transform the Load Balancer API response into a full JSON format. The default response is formatted as “\\[&lt;resource objects&gt;\\]”.\n\n    ```\n    var cloud_lb_response = ${cloud_lb_response};\n    for (var i = 0; i < cloud_lb_response.size(); i++){\n          cloud_lb_response.set(i, '{\"result\":[' + cloud_lb_response.get(i) + ']}');\n    }\n    CTX.setAttribute(\"cloud_lb_response\", cloud_lb_response;\n    \n    ```\n\n    Use the following EVAL function to transform the Network API response into a full JSON format. The default response is formatted as “\\[&lt;resource objects&gt;\\]”.\n\n    ```\n    var network_response = ${network_response};\n    for (var i = 0; i < network_response.size(); i++){\n          network_response.set(i, '{\"result\":[' + network_response.get(i) + ']}');\n    }\n    CTX.setAttribute(\"network_response\", network_response);\n    \n    ```\n\n    Use the following EVAL function to get the IBM region from the LB availability zone \\(datacenter\\). The same function is used for other resources inside the pattern.\n\n    ```\n    var res = \"\";\n    res = IbmCloudDcToRegion.convertDctoRegion(${cloud_lb[].cloud_lb_az_short_name});\n    \n    \n    ```\n\n    Use the following EVAL function to select the required algorithm in the pattern.\n\n    ```\n    var rtrn\n    var lb_algorithm = ${cloud_lb_pools[].lb_algorithm}.toString();\n    switch (lb_algorithm){  \n       case \"ROUNDROBIN\":\n          lb_algorithm = \"round-robin\";\n          break;    \n       case \"WEIGHTED_RR\":\n          lb_algorithm = \"round-robin\";\n          break;          \n       case \"LEASTCONNECTION\":\n          lb_algorithm = \"least-connections\";\n          break;     \n       default: break;\n    \n    ```\n\n    Use the following EVAL function to parse the unique region to the account that hosts the Organizations and the corresponding spaces.\n\n    ```\n    var tableWithoutDuplicates = '';\n    tableWithoutDuplicates =  DuplicateRemover.removeDuplicates(${account_region},[\"region_name\"]);\n    CTX.setAttribute(\"account_region_unique\",  tableWithoutDuplicates);\n    \n    ```\n\n    Use the following EVAL function to get information for all the organizations that are assigned to the IBM cloud account. Iteration for getting the unique region is performed.\n\n    ```\n    var cloudcall = new CloudRestAPIClient();\n    var resourceTable = ${account_region_unique[*].region_name};\n    var tableSize = resourceTable.size();                                     \n    var tmp_response = new Packages.java.util.ArrayList();\n    var all_organizations_response = new Packages.java.util.ArrayList();\n    for (var i = 0; i < tableSize ; i++){\n       if  (!resourceTable.get(i)) continue;\n       var url = \"https://api.\"+resourceTable.get(i)+\".bluemix.net/v2/organizations\";\n       tmp_response = cloudcall.arrayListExecute(${service_account}, null, url, null, 'GET', null, 'true', CTX);\n       \n       for (var j = 0; j < tmp_response.size(); j++){\n          all_organizations_response.add('{\"result\":[' + tmp_response.get(j) + ']}');\n       }\n    }\n    CTX.setAttribute(\"all_organizations_response\", all_organizations_response);\n    \n    ```\n\n    Use the following EVAL function to get information for all the IBM cloud account assigned spaces, where the iteration for getting the unique region is performed.\n\n    ```\n    var rtrn = '';\n    var cloudcall = new CloudRestAPIClient();\n    var resultList = new Packages.java.util.ArrayList();\n    var rest = '';\n    var resourceTable = ${account_region_unique[*].region_name};\n    var result = new Packages.java.util.ArrayList();\n    var all_organizations_response = ${all_organizations_response}\n    for (var i = 0; i < resourceTable.size() ; i++){\n       var url = \"https://api.\"+resourceTable.get(i)+\".bluemix.net/v2/spaces\";\n       result = cloudcall.arrayListExecute(${service_account}, null, url, null, 'GET', null, 'true', CTX);\n       for (var z = 0; z < all_organizations_response.size(); z++){\n          var jsonObj = JSON.parse(result.get(z));\n          ms.log(\"length \"+jsonObj.resources.length);\n    for(var j=0;j<jsonObj.resources.length;j++){\n             var guid = jsonObj.resources[j].metadata.guid;\n             var url = jsonObj.resources[j].metadata.url;\n             var name = jsonObj.resources[j].entity.name;\n             var organization_guid = jsonObj.resources[j].entity.organization_guid;\n             var allow_ssh = jsonObj.resources[j].entity.allow_ssh ? \"true\" : \"false\";\n             var row = new Packages.java.util.HashMap();\n     Packages.com.snc.sw.log.DiscoLog.getLogger(\"IBM Cloud Space and Org\").debug(\">>>>>>>>>>>>>||||||||||||>>>>>> region alias=\" + resourceTable.get(i)); \n             Packages.com.snc.sw.log.DiscoLog.getLogger(\"IBM Cloud Space and Org\").debug(\">>>>>>>>>>>>>||||||||||||>>>>>> region full name=\" + IbmCloudDcToRegion.regionNamebyAlias(resourceTable.get(i))); \n             row.put(\"region\", IbmCloudDcToRegion.regionNamebyAlias(resourceTable.get(i)));\n             row.put(\"space_guid\",guid);\n             row.put(\"space_url\",url);\n             row.put(\"space_name\",name);\n             row.put(\"space_organization_guid\",organization_guid);\n             row.put(\"space_allow_ssh\",allow_ssh);\n             row.put(\"rest\", rest);\n             resultList.add(row);\n          }\n       }\n       CTX.setAttribute('spaces_table', resultList);\n    }\n         \n    \n    ```\n\n    Use the following EVAL function to filter all the spaces by unique region.\n\n    ```\n    var space_region = ${spaces_table[].region};\n    \n    Packages.com.snc.sw.log.DiscoLog.getLogger(\"IBM Cloud Space and Org\").debug(\"filtering space according to LDC. space_region=\" + space_region);\n    var regions = ${cmdb_ci_ibm_datacenter[*].region};\n    Packages.com.snc.sw.log.DiscoLog.getLogger(\"IBM Cloud Space and Org\").debug(\"input regions list=\" + regions.toString());\n    \n    var rtrn = \"false\";\n    if(regions.contains(space_region)) {\n        rtrn = \"true\";\n    }\n    rtrn;\n    \n    ```\n\n    Use the following EVAL function to filter all the spaces by storage discovery.\n\n    ```\n    var storage_response = ${storage_response};\n    for (var i = 0; i < storage_response.size(); i++){\n          storage_response.set(i, '{\"result\":[' + storage_response.get(i) + ']}');\n    }\n    CTX.setAttribute(\"storage_response\", storage_response);\n    \n    \n    ```\n\n    Use the following EVAL function to transform the API response into full JSON format, as the untouched response is formatted as “\\[&lt;resource objects&gt;\\]”.\n\n    ```\n    var ssh_key = ${ssh_key_json};\n    for(var i = 0; i < ssh_key.size(); i++){\n       ssh_key.set(i,'{\"result\\\" : ' + ssh_key.get(i) + \"}\");\n    }\n    CTX.setAttribute(\"ssh_key_json\", ssh_key);\n    \n    ```\n\n    Use the following EVAL function to populate the availability zone into the storage volume table.\n\n    ```\n    var rtrn;\n    var resource_group = ${network_storage[].resource_name};\n    var regex = /.*-(\\w{3}\\d{2}).*/;\n    var az_name = regex.exec(resource_group);\n    if (az_name) {\n       rtrn = az_name[1];\n    } else {\n       rtrn;\n    }\n    \n    ```\n\n    Use the following EVAL function to populate the region into the storage volume table.\n\n    ```\n    var res = \"\";\n    res = IbmCloudDcToRegion.convertDctoRegion(${network_storage[].availability_zone});\n    \n    \n    ```\n\n    Use the following EVAL function to transform the size of the storages to bytes from gigabytes.\n\n    ```\n    var rtrn = '';\n    \n    var size = ${network_storage[].size};\n    \n    rtrn = (parseInt(size) * 1073741824) + ‘’;\n    \n    ```\n\n    Use the following EVAL function to transform the size of the storages to bytes from gigabytes.\n\n    ```\n    var cloudcall = new CloudRestAPIClient();\n    var resourceTable = ${network_storage[*].storage_object_id};\n    var tableSize = resourceTable.size();\n    var allResources = new Packages.java.util.ArrayList();\n    var response = new Packages.java.util.ArrayList();\n    for (var i = 0; i < tableSize ; i++){\n       if  (!resourceTable.get(i)) continue;\n       var url = \"https://api.softlayer.com/rest/\"+${api_version}+\"/SoftLayer_Network_Storage/\"+resourceTable.get(i)+\"/getObject?objectMask=mask[snapshots]\";\n       // the commented out code is to call the \"Cloud Rest Call\" API\n       \n       allResources = cloudcall.arrayListExecute(${service_account}, null, url, null, 'GET', null, 'true', CTX);\n       for (var j = 0; j < allResources.size(); j++){\n          response.add('{\"result\":[' + allResources.get(j) + ']}');\n       }\n    }\n    CTX.setAttribute(\"all_snapshots_response\", response);\n    \n    ```\n\n    Use the following EVAL closure that transforms the JSON that is received from the API to a format that the JSON parser can work with. The default JSON is saved in `$vm_json_array`, the new JSON is in `$vm_json`.\n\n    ```\n    var vm_json = new Packages.java.util.ArrayList();\n    vm_json.addAll(${vm_json_array});\n    \n    for (var i = 0 ; i < vm_json.size(); i++){\n          vm_json.set(i, '{\\\"result\\\":[' + vm_json.get(i) + ']}');\n    }\n    \n    CTX.setAttribute(\"vm_json\", vm_json); \n    \n    ```\n\n    Use the following EVAL closure that returns ‘on’ if the power status is running. The value ‘off’ is returned if the power status is off.\n\n    ```\n    var power = ${cmdb_ci_vm_instance[].state};\n    var rtrn = '';\n    \n    if (power == 'Running'){\n       rtrn = \"on\";\n    }\n    else {\n       rtrn = \"off\"\n    } \n    \n    ```\n\n    Use the following EVAL closure that returns the region of the CI, based on provided availability zone name.\n\n    ```\n    var az = ${cmdb_ci_vm_instance[].avail_zone};\n    var rtrn = '';\n    rtrn = IbmCloudDcToRegion.convertDctoRegion(az);\n    \n    ```\n\n    Use the following EVAL closure that builds a HashMap of HashSets, Connecting VMs with their network storages. The following key is used:\n\n    -   P = page\n    -   V = VM\n    -   N = network storage\n    ```\n    var rtrn = '';\n    var vmJson = ${vm_json_array};\n    var VMtoStorageHashMap = new Packages.java.util.HashMap();\n    \n    for (var p = 0 ; p < vmJson.size(); p++){\n       var page = JSON.parse(vmJson.get(p));\n       for (var now_V in page){\n          if (page[v].allowedNetworkStorage.length > 0){\n             var vm_id = page[v].id + '';\n             var storageSet = new Packages.java.util.HashSet();\n             for (var n in page[v].allowedNetworkStorage){\n                storageSet.add(page[v].allowedNetworkStorage[n].id + '');\n             }\n             VMtoStorageHashMap.put(vm_id,storageSet);\n          }\n       }\n    }\n    CTX.setAttribute(\"VMStorageCache\", VMtoStorageHashMap); \n    \n    ```\n\n    Use the following EVAL closure to remove duplicate entries from tables.\n\n    ```\n    var tableWithoutDuplicates = '';\n    tableWithoutDuplicates = DuplicateRemover.removeDuplicates(${cmdb_ci_os_template},[\"object_id\"]);\n    CTX.setAttribute(\"cmdb_ci_os_template\", tableWithoutDuplicates);\n    \n    ```\n\n    Use the following EVAL closure that builds a list of VM IDs that are related to the current security group ID.\n\n    ```\n    var rtrn = '';\n    //get the Security Group ID of the current record in the table for comparison\n    var current_table_id = ${security_groups[].sec_group_id};\n    var current_table_id_string = current_table_id + '';\n    \n    // get the list of instance's ID that will be then added to Security Group table\n    var needed_value_id_list = ${sec_group_network_components[*].vm_instance_id};\n    //get the list of Security Group IDs in the Network Component table, which will then be compared one by one to the current record of the security_groups table\n    var compare_id_list = ${sec_group_network_components[*].sec_group_id};\n    \n    var beforeReturn = '';\n    var separator = '';\n    for (var i = 0; i <  compare_id_list.size(); i++)   {\n       \n       if   (current_table_id_string == compare_id_list.get(i)){\n          \n          beforeReturn += separator + needed_value_id_list.get(i);\n          separator = ',';\n       }\n    }\n    rtrn = beforeReturn;\n    \n    ```\n\n    Use the following EVAL closure that builds a HashMap of HashSet between security groups and the VMs that are configured to use them.\n\n    ```\n    rtrn = '';\n    var secGroupTable = ${cmdb_ci_endpoint_comp_security};\n    var secToVMHashSet = new Packages.java.util.HashMap();\n    \n    // this loop worst case O(N*M) M = security groups, N = VMs\n    for(var i=0; i<secGroupTable.size(); i++){\n       var securityTableId = secGroupTable.get(i).get('object_id');\n       var vmListStr = secGroupTable.get(i).get('instance_list');\n       var vmList = vmListStr.split(\",\");\n    \n       var vmSet = new Packages.java.util.HashSet();\n       for (var j in vmList){\n          vmSet.add(vmList[j]);\n       }\n    \n       secToVMHashSet.put(securityTableId,vmSet);\n    }\n    CTX.setAttribute(\"securityVMCache\",  secToVMHashSet);\n    \n    ```\n\n    Use the following EVAL closure that returns ‘true’ if the current VM is using the current security group ID.\n\n    ```\n    var rtrn = '';\n    var vm_id = ${cmdb_ci_vm_instance[].object_id};\n    var vmHashSet = ${securityVMCache}.get(${cmdb_ci_endpoint_comp_security[].object_id});\n    rtrn = vmHashSet.contains(vm_id);\n    \n    ```\n\n    Use the following EVAL closure that returns ‘true’ if the current VM is using the current storage volume.\n\n    ```\n    var rtrn = '';\n    var vm_id = ${cmdb_ci_vm_instance[].object_id};\n    var vol_id = ${cmdb_ci_endpoint_iscsi[].object_id};\n    var vmHashSet = ${VMStorageCache}.get(vm_id);\n    if (vmHashSet){\n       rtrn = vmHashSet.contains(vol_id);\n    }\n    else {\n       rtrn = 'false'\n    }\n    \n    ```\n\n    Use the following EVAL function to transform the API response into full JSON format, as the untouched response is formatted as “\\[&lt;resource objects&gt;\\]”.\n\n    ```\n    var cloud_response = ${location_groups_response}\n    for (var i = 0; i < cloud_response.size(); i++){\n        cloud_response.set(I, '{\"result\":[' + cloud_response.get(i) + ']}');\n    }\n    CTX.setAttribute(\"location_groups_response\", cloud_response);\n    ```\n\n    Parses the unique Location Groups in the “location\\_groups\\_az” table basdon the column “lg\\_id” and creates a new table \"location\\_groups\\_az\\_unique“ that contains the result.\n\n    ```\n    var tableWithoutDuplicates= '';\n    tableWithoutDuplicates = DuplicateRemover.removeDuplicates(${location_groups_az},[\"lg_id\"]);\n    CTX.setAttribute(\"location_groups_az_unique\", tableWithoutDuplicates);\n    ```\n\n    Creates a list of Availability Zones per Location Group, that is stored in a column new column in the location\\_groups\\_az\\_uniquetable. The list records are divided by commas purposely, so that unique relations could be made in consecutive step.\n\n    ```\n    var current_table_id= ${location_groups_az_unique[].lg_id};\n    var current_table_id_string = current_table_id+ '';\n    var needed_v alue_id_list = ${location_groups_az[*].lg_az_id};\n    var compare_id_list= ${location_groups_az[*].lg_id};\n    var beforeReturn= '';\n    var separator = ',';\n    for (var i= 0; i< compare_id_list.size(); i++)  {\n        if (current_table_id_string == compare_id_list.get(i)){\n        beforeReturn += separator + needed_v alue_id_list.get(i) + separator;\n      }\n    }\n    rtrn = beforeReturn;\n    ```\n\n-   **Activate the cloud-related CI relationships**\n\n    To include discovered components into service instances, enable CI relationships used in tag-based discovery by Service Mapping. These CI relationships are available from the 1.0.68 release on the ServiceNow Store. For operational steps, see [Tag-based discovery configuration]().\n\n-   **\\(Optional\\) Populate Service Account and Logical Datacenter fields in cloud CIs**\n\n    Starting with Discovery and Service Mapping Patterns version 1.30.2, you can improve query performance by populating Service Account and Logical Datacenter fields directly in cloud CIs. For more information, see [Improved query performance with direct field population in CI tables]().\n\n\n## Data collected by Discovery during horizontal discovery\n\nData is collected using these patterns:\n\n-   IBM Cloud Load Balancer\n-   IBM Cloud Location Groups\n-   IBM Cloud Network\n-   IBM Cloud Organizations and Spaces\n-   IBM Cloud Resource Groups\n-   IBM Cloud SSH Key\n-   IBM Cloud Storage\n-   IBM Cloud Virtual Server\n\nData collected for IBM components:\n\n-   **IBM Cloud Load Balancer discovered resources**\n\n<table id=\"table_o21_dlv_2hb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td class=\"sub-head\" colspan=\"2\">\n\nMain CI: cmdb\\_ci\\_cloud\\_load\\_balancer\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nLoad balancer name.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nLoad balancer unique identifier.\n\n</td></tr><tr><td>\n\nfqdn\n\n</td><td>\n\nLoad balancer address \\(host name\\).\n\n</td></tr><tr><td>\n\ndns\\_name\n\n</td><td>\n\nLoad balancer domain server name.\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nLoad balancer description that you provide for easy identification.\n\n</td></tr><tr><td>\n\noperational\\_status\n\n</td><td>\n\nLoad balancer status, one of either: -   ONLINE\n-   OFFLINE\n\n\n</td></tr><tr><td>\n\nlocation\n\n</td><td>\n\nDatacenter location.\n\n</td></tr><tr><td>\n\nstate\n\n</td><td>\n\nLoad balancer provisioning status.\n\n</td></tr><tr class=\"sub-head\"><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_lb\\_service\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nPattern created name, composed of:-   load balancer name\n-   type of protocol\n-   resource type listener\n\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nLoad balancer unique identifier.\n\n</td></tr><tr><td>\n\nport\n\n</td><td>\n\nPort number of the listener.\n\n</td></tr><tr><td>\n\nfront\\_end\\_port\n\n</td><td>\n\nProtocol port number of the listener.\n\n</td></tr><tr><td>\n\nlistener\\_protocol\n\n</td><td>\n\nProtocol of the listener. One of the following protocols:-   TCP\n-   HTTP\n-   HTTPS\n\n\n</td></tr><tr><td>\n\noperational\\_status\n\n</td><td>\n\nProvisioning status of the listener.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_lb\\_pool\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nPattern created name, composed of: -   load balancer name\n-   type of protocol\n-   port\n-   resource type “pool”\n\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nLoad balancer pool unique identifier.\n\n</td></tr><tr><td>\n\nport\n\n</td><td>\n\nProtocol port of the backend.\n\n</td></tr><tr><td>\n\npool\\_status\n\n</td><td>\n\nLoad balancer pool provisioning status.\n\n</td></tr><tr><td>\n\nload\\_balancing\\_method\n\n</td><td>\n\nLoad balancing method. One of the following algorithms: -   \"ROUNDROBIN\"\n-   \"WEIGHTED\\_RR\"\n-   \"LEASTCONNECTION\"\n\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_lb\\_pool\\_member\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nPattern created name, composed of:-   load balancer name\n-   type of protocol\n-   IP address of the Pool Member\n\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nLoad balancer pool member unique identifier, composed of:-   Member ID\n-   Listener ID\n\n\n</td></tr><tr><td>\n\nip\\_address\n\n</td><td>\n\nIP address of a load balancer member.\n\n</td></tr><tr><td>\n\nserver\\_id\n\n</td><td>\n\nID of the member in IBM cloud.\n\n</td></tr><tr><td>\n\nload\\_balancer\n\n</td><td>\n\nName of the related Load Balancer.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_lb\\_health\\_service\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nPattern created name, composed of:-   load balancer name\n-   type of protocol\n-   resource type: **Health Check**\n-   resource ID\n\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier of the Health Service Check.\n\n</td></tr><tr><td>\n\nmonitor\\_type\n\n</td><td>\n\nHealth check type. One of the following: -   TCP\n-   HTTP\n-   HTTPS\n\n\n</td></tr><tr><td>\n\ntimeout\\_sec\n\n</td><td>\n\nTimeout, in seconds, to wait for health check responses.\n\n</td></tr><tr><td>\n\ncheck\\_interval\\_sec\n\n</td><td>\n\nInterval, in seconds, to perform health check.\n\n</td></tr></tbody>\n</table>-   **IBM Cloud Location Groups discovered resources**\n\n    |Field|Description|\n    |-----|-----------|\n    |Main CI: cmdb\\_ci\\_cloud\\_location\\_group|\n    |name|A descriptive name used to identify a Location Group.|\n    |object\\_id|The ID of the Location Group record.|\n    |locationGroupType Name|The name of the Location Group Type.|\n    |short\\_description|A small note about a Location Group to use at your discretion.|\n    |locationGroup Type ID|The ID of the Location Group Type.|\n\n-   **IBM Cloud Network discovered resources**\n\n<table id=\"table_wlf_ybx_jhb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td class=\"sub-head\" colspan=\"2\">\n\nMain CI: cmdb\\_ci\\_network\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nVLAN number.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nNetwork unique identifier.\n\n</td></tr><tr><td>\n\naccess\\_port\\_vlan\n\n</td><td>\n\nVLAN number.\n\n</td></tr><tr><td>\n\nis\\_external\n\n</td><td>\n\nNetwork space value. The value is either: -   true if the network\\_space is “PUBLIC”\n-   false if the network\\_space is “PRIVATE”.\n\n\n</td></tr><tr><td>\n\nstate\n\n</td><td>\n\nState has the value \"available\".\n\n</td></tr><tr class=\"sub-head\"><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_cloud\\_subnet\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName, composed of: “network\\_identifier/cidr”\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nSubnet unique identifier.\n\n</td></tr><tr><td>\n\nsubnet\\_mask\n\n</td><td>\n\nNetmask of the subnet.\n\n</td></tr><tr><td>\n\ngateway\n\n</td><td>\n\nGateway IP address.\n\n</td></tr><tr><td>\n\ncidr\n\n</td><td>\n\nMethod for allocating IP addresses and IP routing: “network\\_identifier/cidr”.\n\n</td></tr><tr><td>\n\ncategory\n\n</td><td>\n\nSubnet type.\n\n</td></tr><tr><td>\n\nbroadcast\\_address\n\n</td><td>\n\nSubnet broadcast address.\n\n</td></tr><tr><td>\n\navailable\\_ip\\_count\n\n</td><td>\n\nNumber of available IP addresses in the subnet.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_compute\\_security\\_group\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nSecurity Group name.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nSecurity Group unique identifier.\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nSecurity Group description that you provide for easy identification.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_compute\\_security\\_group\\_rule\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nField with the same value as the Security Group Rule object\\_id field.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nSecurity Group Rule unique identifier.\n\n</td></tr><tr><td>\n\ncreated\n\n</td><td>\n\nDate the CI was created.\n\n</td></tr><tr><td>\n\ndirection\n\n</td><td>\n\nDirection of the information. One of the following: -   inbound\n-   outbound\n\n\n</td></tr><tr><td>\n\nEthertype\n\n</td><td>\n\nEthertype. One of the following: -   IPv4\n-   IPv6\n\n\n</td></tr><tr><td>\n\nport\\_range\\_min\n\n</td><td>\n\nThe first port of the range that the rule applies to.\n\n</td></tr><tr><td>\n\nport\\_range\\_max\n\n</td><td>\n\nThe last port of the range that the rule applies to.\n\n</td></tr><tr><td>\n\nprotocol\n\n</td><td>\n\nProtocol that the rule is applied to.\n\n</td></tr><tr><td>\n\nremote\\_group\\_id\n\n</td><td>\n\nSecurity Group ID for the Source/Destination security group. It means that this rule applies on all IP addresses that were configured in this security group.\n\n</td></tr></tbody>\n</table>-   **IBM Cloud Organizations and Space discovered resources**\n\n<table id=\"table_vbc_2cx_jhb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td class=\"sub-head\" colspan=\"2\">\n\nMain CI: cmdb\\_ci\\_cloud\\_org\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the cloud organization.\n\n</td></tr><tr><td>\n\nguid\n\n</td><td>\n\nUnique identifier of the organization.\n\n</td></tr><tr><td>\n\nurl\n\n</td><td>\n\nUnique URL of the organization.\n\n</td></tr><tr><td>\n\nbilling\\_enabled\n\n</td><td>\n\nBilling method in use by the organization. One of either: -   Enabled / \\(TRUE\\)\n-   Disabled / \\(FALSE\\)\n\n\n</td></tr><tr><td>\n\nquota\\_definition\\_url\n\n</td><td>\n\nResources that are available to an organization.\n\n</td></tr><tr><td>\n\nspaces\\_url\n\n</td><td>\n\nUnique URL of the space assigned to the organization.\n\n</td></tr><tr><td>\n\noperational\\_status\n\n</td><td>\n\nOperational status of the organization.\n\n</td></tr><tr class=\"sub-head\"><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_cloud\\_space\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nUnique name of the space.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nSpace unique identifier \\(guid\\).\n\n</td></tr><tr><td>\n\nalllow\\_ssh\n\n</td><td>\n\nAccess to the application over SSH is either allowed or not allowed. Boolean, one of either: -   TRUE\n-   FALSE\n\n\n</td></tr><tr><td>\n\nURL\n\n</td><td>\n\nURL of the space from the metadata description.\n\n</td></tr></tbody>\n</table>-   **IBM Cloud Resource Groups discovered resources**\n\n    |Field|Description|\n    |-----|-----------|\n    |Main CI: cmdb\\_ci\\_resource\\_group|\n    |name|Name of the resource group.|\n    |object\\_id|Unique identifier of the resource group.|\n    |quota\\_id|Value identifying the quota ID associated with the resource group.|\n\n-   **IBM Cloud SSH Key discovered resources**\n\n    |Field|Description|\n    |-----|-----------|\n    |Main CI: cmdb\\_ci\\_cloud\\_key\\_pair|\n    |name|Name to identify an SSH key.|\n    |object\\_id|ID of the SSH key record.|\n    |key|SSH Key record.|\n    |finger\\_print|Short sequence of bytes used to authenticate or lookup a longer SSH Key. This value is automatically generated when adding or modifying the SSH Key. Read only. Changes made are ignored.|\n    |created \\_date|Date when the SSH Key was added. Read only. Changes made are ignored.|\n    |modify\\_date|Date when the SSH Key was modified. Read only. Changes made are ignored.|\n    |short\\_description|SSH description that you provide for easy identification.|\n    |Related CI: cmdb\\_ci\\_ibm\\_datacenter|\n    |name|Name of the datacenter.|\n    |region|Region that the datacenter is in.|\n    |discovery\\_status|Status information about the IBM datacenter.|\n    |sys\\_class\\_name|Class of the datacenter|\n    |Related CI: cmdb\\_ci\\_cloud\\_service\\_account|\n    |name|Name of the cloud service account.|\n    |account\\_id|Account ID for this cloud service account.|\n    |discovery\\_credentials|Credentials for this cloud service account.|\n    |datacenter\\_url|URL used to populate Logical Data Centers \\(LDCs\\).|\n    |datacenter\\_type|Type of datacenter. As an example, IBM Datacenter \\[cmdb\\_ci\\_ibm\\_datacenter\\]|\n    |datacenter\\_discovery\\_status|Status of last execution of Discover Datacenters.|\n\n-   **IBM Cloud Storage discovered resources**\n\n<table id=\"table_zd3_wdx_jhb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td class=\"sub-head\" colspan=\"2\">\n\nMain CI: cmdb\\_ci\\_storage\\_volume\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nUsername used to:-   access a non-EVault Storage volume\n-   register the EVault server agent with the vault backup system\n\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nStorage account unique identifier.\n\n</td></tr><tr><td>\n\nsize\n\n</td><td>\n\nCapacity of the storage account, measured in gigabytes.\n\n</td></tr><tr><td>\n\nsize\\_bytes\n\n</td><td>\n\nCapacity of the storage account, measured in bytes.\n\n</td></tr><tr><td>\n\nlabel\n\n</td><td>\n\nName of the storage network resource.\n\n</td></tr><tr><td>\n\nstorage\\_type\n\n</td><td>\n\nDescription of the storage type. As an example, NAS.\n\n</td></tr><tr><td>\n\nfqdn\n\n</td><td>\n\nIP address of a storage resource or fully qualified domain name.\n\n</td></tr><tr><td>\n\ndevice\n\n</td><td>\n\nUnique identification number of the device associated with a Storage volume.\n\n</td></tr><tr class=\"sub-head\"><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_storage\\_vol\\_snapshot\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of a storage network resource.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nStorage unique identifier.\n\n</td></tr><tr><td>\n\ncapacity\n\n</td><td>\n\nCapacity of the snapshot volume in gigabytes.\n\n</td></tr><tr><td>\n\nfqdn\n\n</td><td>\n\nIP address of a storage resource or fully qualified domain name.\n\n</td></tr><tr><td>\n\nlocation\n\n</td><td>\n\nUnique availability zone where the storage volume is located.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_ibm\\_datacenter\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the datacenter.\n\n</td></tr><tr><td>\n\nregion\n\n</td><td>\n\nRegion that the datacenter is in.\n\n</td></tr><tr><td>\n\ndiscovery\\_status\n\n</td><td>\n\nStatus information about the IBM datacenter.\n\n</td></tr><tr><td>\n\nsys\\_class\\_name\n\n</td><td>\n\nClass of the datacenter\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_cloud\\_service\\_account\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the cloud service account.\n\n</td></tr><tr><td>\n\naccount\\_id\n\n</td><td>\n\nAccount ID for this cloud service account.\n\n</td></tr><tr><td>\n\ndiscovery\\_credentials\n\n</td><td>\n\nCredentials for this cloud service account.\n\n</td></tr><tr><td>\n\ndatacenter\\_url\n\n</td><td>\n\nURL used to populate LDCs.\n\n</td></tr><tr><td>\n\ndatacenter\\_type\n\n</td><td>\n\nType of datacenter. As an example, IBM Datacenter \\[cmdb\\_ci\\_ibm\\_datacenter\\]\n\n</td></tr><tr><td>\n\ndatacenter\\_discovery\\_status\n\n</td><td>\n\nStatus of last execution of Discover Datacenters.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_availability\\_zone\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the availability zone \\(AZ\\).\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier for this resource.\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nAvailability zone description that you provide.\n\n</td></tr></tbody>\n</table>-   **IBM Cloud Virtual Server discovered resources**\n\n<table id=\"table_njj_ydx_jhb\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td class=\"sub-head\" colspan=\"2\">\n\nMain CI: cmdb\\_ci\\_vm\\_instance\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the VM.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier of the VM.\n\n</td></tr><tr><td>\n\ndns\\_domain\n\n</td><td>\n\nVM domain server name.\n\n</td></tr><tr><td>\n\nfqdn\n\n</td><td>\n\nVM IP address.\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nDescription in a note that is attached to the VM on the IBM console.\n\n</td></tr><tr><td>\n\ncpus\n\n</td><td>\n\nNumber of CPU cores assigned to this VM.\n\n</td></tr><tr><td>\n\nmemory\n\n</td><td>\n\nMemory size assigned to this VM.\n\n</td></tr><tr><td>\n\ndisks\n\n</td><td>\n\nNumber of disks assigned to this VM.\n\n</td></tr><tr><td>\n\nstate\n\n</td><td>\n\nThe running state of the VM.\n\n -   On – returned as ‘Running’ from the API.\n-   Off – returned as ‘Halted’ from the API.\n\n\n</td></tr><tr><td>\n\nplacement\\_group\\_id\n\n</td><td>\n\nPlacement group ID.\n\n</td></tr><tr><td>\n\nnics\n\n</td><td>\n\nNumber of NICs.\n\n</td></tr><tr class=\"sub-head\"><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_nic\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName, composed of:-   load balancer name\n-   Port\n\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier of the NIC.\n\n</td></tr><tr><td>\n\nip\\_address\n\n</td><td>\n\nIP that is configured on the NIC.\n\n</td></tr><tr><td>\n\nmac\\_address\n\n</td><td>\n\nNIC MAC details.\n\n</td></tr><tr><td>\n\nnetmask\n\n</td><td>\n\nMask used to divide the IP address into subnets and to specify the available hosts in the network.\n\n</td></tr><tr><td>\n\nstatus\n\n</td><td>\n\nState of the NIC.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_endpoint\\_vnic\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName for the VNIC endpoint.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier of the VNIC endpoint.\n\n</td></tr><tr><td>\n\nhost\n\n</td><td>\n\nHost identifier.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_storage\\_volume\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nUsername used to:-   access a non-EVault Storage volume\n-   register the EVault server agent with the vault backup system\n\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nStorage account unique identifier.\n\n</td></tr><tr><td>\n\nsize\n\n</td><td>\n\nCapacity of the storage account, measured in gigabytes.\n\n</td></tr><tr><td>\n\nsize\\_bytes\n\n</td><td>\n\nCapacity of the storage account, measured in bytes.\n\n</td></tr><tr><td>\n\nlabel\n\n</td><td>\n\nName of the storage network resource.\n\n</td></tr><tr><td>\n\nstorage\\_type\n\n</td><td>\n\nDescription of the storage type. As an example, NAS.\n\n</td></tr><tr><td>\n\nfqdn\n\n</td><td>\n\nIP address of a storage resource or fully qualified domain name.\n\n</td></tr><tr><td>\n\ndevice\n\n</td><td>\n\nUnique identification number of the guest associated with a Storage volume.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_endpoint\\_nfs\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName for the NFS endpoint.\n\n</td></tr><tr><td>\n\nhost\n\n</td><td>\n\nHost identifier.\n\n</td></tr><tr><td>\n\nprotocol\n\n</td><td>\n\nProtocol that was applied.\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nNFS endpoint type.\n\n</td></tr><tr><td>\n\ncreated\n\n</td><td>\n\nDate that the NFS endpoint was created.\n\n</td></tr><tr><td>\n\nupdated\n\n</td><td>\n\nDate that the NFS endpoint was updated.\n\n</td></tr><tr><td>\n\ndiscovery\\_source\n\n</td><td>\n\nSource of the discovery. As an example, ServiceWatch\n\n</td></tr><tr><td>\n\nhost\\_name\n\n</td><td>\n\nHost name of the NFS endpoint\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_endpoint\\_iscsi\n\n</td></tr><tr><td>\n\nhost\n\n</td><td>\n\nHost identifier for the ISCSI endpoint.\n\n</td></tr><tr><td>\n\nport\n\n</td><td>\n\nPort to determine how GCP iscsi contact to the VMs.\n\n</td></tr><tr><td>\n\nprotocol\n\n</td><td>\n\nProtocol that was applied.\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nISCSI endpoint type\n\n</td></tr><tr><td>\n\ncreated\n\n</td><td>\n\nDate that the ISCSI endpoint was created.\n\n</td></tr><tr><td>\n\nupdated\n\n</td><td>\n\nDate that the ISCSI endpoint was updated.\n\n</td></tr><tr><td>\n\ndiscovery\\_source\n\n</td><td>\n\nSource of the discovery. As an example, ImportSet\n\n</td></tr><tr><td>\n\nhost\\_name\n\n</td><td>\n\nHost name of the ISCSI endpoint\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_endpoint\\_block\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName for the block endpoint.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier of the block endpoint.\n\n</td></tr><tr><td>\n\nhost\n\n</td><td>\n\nHost identifier.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_os\\_template\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the image. For example, ‘CentOS 7.0-64 Minimal for VSI’.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier of the image.\n\n</td></tr><tr><td>\n\nguest\\_os\n\n</td><td>\n\nOS used by the image. As an example, Linux.\n\n</td></tr><tr><td>\n\nroot\\_device\\_type\n\n</td><td>\n\nType of device used by root.\n\n</td></tr><tr><td>\n\nimage\\_source\n\n</td><td>\n\nSource of the image.\n\n</td></tr><tr><td>\n\nimage\\_type\n\n</td><td>\n\nImage type.\n\n</td></tr><tr><td>\n\ninfuse\\_key\n\n</td><td>\n\nKey used to infuse the image.\n\n</td></tr><tr><td>\n\nupdate\\_host\\_name\n\n</td><td>\n\nUpdate host name for the image.\n\n</td></tr><tr><td>\n\ncredentials\n\n</td><td>\n\nCredentials for the image.\n\n</td></tr><tr><td>\n\nversion\n\n</td><td>\n\nOS version. For example, ‘7.0-64 Minimal for VSI’.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_cloud\\_key\\_pair\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName to identify a key \\(key label\\).\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nID of the key record.\n\n</td></tr><tr><td>\n\nkey\n\n</td><td>\n\nKey record.\n\n</td></tr><tr><td>\n\nfinger\\_print\n\n</td><td>\n\nShort sequence of bytes used to authenticate or look up a Key. This value is automatically generated when adding or modifying the Key. Read only. Changes made are ignored.\n\n</td></tr><tr><td>\n\ncreated \\_date\n\n</td><td>\n\nDate when the Key was added. Read only. Changes made are ignored.\n\n</td></tr><tr><td>\n\nmodify\\_date\n\n</td><td>\n\nDate when the Key was modified. Read only. Changes made are ignored.\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nDescription that you provide for easy identification.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_compute\\_security\\_group\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nSecurity Group name.\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nSecurity Group unique identifier.\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nSecurity Group description that you provide for easy identification.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_endpoint\\_comp\\_security\n\n</td></tr><tr><td>\n\nhost\n\n</td><td>\n\nHost identifier of the compute security endpoint.\n\n</td></tr><tr><td>\n\nport\n\n</td><td>\n\nUnique identifier of the compute security endpoint.\n\n</td></tr><tr><td>\n\nprotocol\n\n</td><td>\n\nProtocol that was applied.\n\n</td></tr><tr><td>\n\ntype\n\n</td><td>\n\nType of compute security endpoint.\n\n</td></tr><tr><td>\n\ncreated\n\n</td><td>\n\nDate when the compute security endpoint was added. Read only. Changes made are ignored.\n\n</td></tr><tr><td>\n\nupdated\n\n</td><td>\n\nDate when the compute security endpoint was modified. Read only. Changes made are ignored.\n\n</td></tr><tr><td>\n\ndiscovery\\_source\n\n</td><td>\n\nSource of the discovery. As an example, Manual Entry.\n\n</td></tr><tr><td>\n\nhost\\_name\n\n</td><td>\n\nHost name of the compute security endpoint.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_ibm\\_datacenter\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the datacenter.\n\n</td></tr><tr><td>\n\nregion\n\n</td><td>\n\nRegion that the datacenter is in.\n\n</td></tr><tr><td>\n\ndiscovery\\_status\n\n</td><td>\n\nStatus information about the IBM datacenter.\n\n</td></tr><tr><td>\n\nsys\\_class\\_name\n\n</td><td>\n\nClass of the datacenter\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_availability\\_zone\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the availability zone \\(AZ\\).\n\n</td></tr><tr><td>\n\nobject\\_id\n\n</td><td>\n\nUnique identifier for this resource.\n\n</td></tr><tr><td>\n\nshort\\_description\n\n</td><td>\n\nAvailability zone description that you provide.\n\n</td></tr><tr><td class=\"sub-head\" colspan=\"2\">\n\nRelated CI: cmdb\\_ci\\_cloud\\_service\\_account\n\n</td></tr><tr><td>\n\nname\n\n</td><td>\n\nName of the cloud service account.\n\n</td></tr><tr><td>\n\naccount\\_id\n\n</td><td>\n\nAccount ID for this cloud service account.\n\n</td></tr><tr><td>\n\ndiscovery\\_credentials\n\n</td><td>\n\nCredentials for this cloud service account.\n\n</td></tr><tr><td>\n\ndatacenter\\_url\n\n</td><td>\n\nURL used to populate LDCs.\n\n</td></tr><tr><td>\n\ndatacenter\\_type\n\n</td><td>\n\nType of datacenter. As an example, IBM Datacenter \\[cmdb\\_ci\\_ibm\\_datacenter\\]\n\n</td></tr><tr><td>\n\ndatacenter\\_discovery\\_status\n\n</td><td>\n\nStatus of last execution of Discover Datacenters.\n\n</td></tr></tbody>\n</table>-   **IBM Cloud Virtual Server – Related Items view**\n\n    \\[Omitted image \"ibm-vserver-related-items-1.png\"\\] Alt text: IBM Cloud Virtual Server – Related Items view\n\n\n## CI Relationships\n\nThese relationships are created to support IBM Cloud Platform discovery.\n\n-   **Relationships for IBM Cloud Load Balancer discovered resources**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Related CI: cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_ibm\\_datacenter|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_ibm\\_datacenter|Contains::Contained by|cmdb\\_ci\\_availability\\_zone|\n    |Related CI: cmdb\\_ci\\_cloud\\_load\\_balancer|\n    |cmdb\\_ci\\_cloud\\_load\\_balancer|Hosted on::Hosts|cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_cloud\\_load\\_balancer|Contains::Contained by|cmdb\\_ci\\_lb\\_health\\_service|\n    |Related CI: cmdb\\_ci\\_availability\\_zone|\n    |cmdb\\_ci\\_availability\\_zone|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_load\\_balancer|\n    |cmdb\\_ci\\_availability\\_zone|Contains::Contained by|cmdb\\_ci\\_lb\\_service|\n    |Related CI: cmdb\\_ci\\_lb\\_service|\n    |cmdb\\_ci\\_lb\\_service|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_load\\_balancer|\n    |cmdb\\_ci\\_lb\\_service|Contains::Contained by|cmdb\\_ci\\_lb\\_pool|\n    |Related CI: cmdb\\_ci\\_lb\\_pool|\n    |cmdb\\_ci\\_lb\\_pool|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_load\\_balancer|\n    |cmdb\\_ci\\_lb\\_pool|Owns::Owned by|cmdb\\_ci\\_lb\\_pool\\_member|\n    |Related CI: cmdb\\_ci\\_lb\\_health\\_service|\n    |cmdb\\_ci\\_lb\\_health\\_service|Contains::Contained by|cmdb\\_ci\\_cloud\\_load\\_balancer|\n\n-   **Relationships for IBM Cloud Location Groups discovered resources**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Related CI: cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_ibm\\_datacenter|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_ibm\\_datacenter|Contains::Contained by|cmdb\\_ci\\_availability\\_zone|\n    |Related CI: cmdb\\_ci\\_cloud\\_location\\_group|\n    |cmdb\\_ci\\_cloud\\_location\\_group|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_cloud\\_location\\_group|Contains::Contained by|cmdb\\_ci\\_availability\\_zone|\n\n-   **Relationships for IBM Cloud Network discovered resources**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Related CI: cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_ibm\\_datacenter|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_ibm\\_datacenter|Contains::Contained by|cmdb\\_ci\\_availability\\_zone|\n    |Related CI: cmdb\\_ci\\_network|\n    |cmdb\\_ci\\_network|Hosted on::Hosts|cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_network|Contains::Contained by|cmdb\\_ci\\_cloud\\_subnet|\n    |Related CI: cmdb\\_ci\\_compute\\_security\\_group|\n    |cmdb\\_ci\\_compute\\_security\\_group|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_compute\\_security\\_group|Contains::Contained by|cmdb\\_ci\\_compute\\_security\\_group\\_rule|\n\n-   **Relationships for IBM Cloud Resource Groups discovered resources**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Related CI: cmdb\\_ci\\_resource\\_group|\n    |cmdb\\_ci\\_resource\\_group|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n\n-   **Relationships for IBM Cloud SSH Key discovered resources**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Related CI: cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_ibm\\_datacenter|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_ibm\\_datacenter|Contains::Contained by|cmdb\\_ci\\_availability\\_zone|\n    |Related CI: cmdb\\_ci\\_cloud\\_key\\_pair|\n    |cmdb\\_ci\\_cloud\\_key\\_pair|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n\n-   **Relationships for IBM Cloud Storage discovered resources**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Related CI: cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_ibm\\_datacenter|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_ibm\\_datacenter|Contains::Contained by|cmdb\\_ci\\_availability\\_zone|\n    |Related CI: cmdb\\_ci\\_storage\\_volume|\n    |cmdb\\_ci\\_storage\\_volume|Hosted on::Hosts|cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_storage\\_volume|Provisioned::Provisioned From|cmdb\\_ci\\_storage\\_vol\\_snapshot|\n    |Related CI: cmdb\\_ci\\_storage\\_vol\\_snapshot|\n    |cmdb\\_ci\\_storage\\_vol\\_snapshot|Hosted on::Hosts|cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_storage\\_vol\\_snapshot|Located in Zone::Zone contains|cmdb\\_ci\\_availability\\_zone|\n    |Related CI: cmdb\\_ci\\_availability\\_zone|\n    |cmdb\\_ci\\_availability\\_zone|Contains::Contained by|cmdb\\_ci\\_storage\\_volume|\n\n-   **Relationships for IBM Cloud Virtual Server discovered resources**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Related CI: cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_ibm\\_datacenter|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_ibm\\_datacenter|Contains::Contained by|cmdb\\_ci\\_availability\\_zone|\n    |cmdb\\_ci\\_ibm\\_datacenter|Hosted on::Hosts|cmdb\\_ci\\_vm\\_instance|\n    |Related CI: cmdb\\_ci\\_vm\\_instance|\n    |cmdb\\_ci\\_vm\\_instance|Hosted on::Hosts|cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_vm\\_instance|Located in:Houses|cmdb\\_ci\\_availability\\_zone|\n    |cmdb\\_ci\\_vm\\_instance|Uses:Used By|cmdb\\_ci\\_cloud\\_key\\_pair|\n    |cmdb\\_ci\\_vm\\_instance|Contains:Contained By|cmdb\\_ci\\_nic|\n    |cmdb\\_ci\\_vm\\_instance|endpoint|cmdb\\_ci\\_nic|\n    |Related CI: cmdb\\_ci\\_availability\\_zone|\n    |cmdb\\_ci\\_availability\\_zone|Hosted on::Hosts|cmdb\\_ci\\_vm\\_instance|\n    |Related CI: cmdb\\_ci\\_nic|\n    |cmdb\\_ci\\_nic|Hosted on::Hosts|cmdb\\_ci\\_vm\\_instance|\n    |Related CI: cmdb\\_ci\\_os\\_template|\n    |cmdb\\_ci\\_os\\_template|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_os\\_template|Provisioned::Provisioned by|cmdb\\_ci\\_vm\\_instance|\n    |Related CI: cmdb\\_ci\\_compute\\_security\\_group|\n    |cmdb\\_ci\\_compute\\_security\\_group|Hosted on::Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n    |cmdb\\_ci\\_compute\\_security\\_group|Implement::Implemented from|cmdb\\_ci\\_vm\\_instance|\n    |Related CI: cmdb\\_ci\\_storage\\_volume|\n    |cmdb\\_ci\\_storage\\_volume|Hosted on::Hosts|cmdb\\_ci\\_ibm\\_datacenter|\n    |cmdb\\_ci\\_storage\\_volume|Implement::Implemented from|cmdb\\_ci\\_vm\\_instance|\n    |Related CI: cmdb\\_ci\\_cloud\\_key\\_pair|\n    |cmdb\\_ci\\_cloud\\_key\\_pair|Hosted On:Hosts|cmdb\\_ci\\_cloud\\_service\\_account|\n\n-   **Relationships discovered for the virtual machine \\(VM\\) instance**\n\n    |CI|Relationship|CI|\n    |---|------------|---|\n    |Servers \\[cmdb\\_ci\\_server\\]|Virtualized by:: Virtualizes|Virtual Machine Instance \\[cmdb\\_ci\\_instance\\]|\n\n\n## Data collected by Service Mapping during tag-based discovery\n\nService Mapping uses tag-based discovery to create service instance maps including the Cloud components. The Service Mapping application comes with the following preconfigured CI relationships used for tag-based discovery. These CI relationships are available from the 1.0.68 release on the ServiceNow Store.\n\n|CI|Relationship|CI|\n|---|------------|---|\n|Configuration Item \\[cmdb\\_ci\\]|Hosted on::Hosts|Logical Datacenter \\[cmdb\\_ci\\_logical\\_datacenter\\]|\n|Logical Datacenter \\[cmdb\\_ci\\_logical\\_datacenter\\]|Hosted on::Hosts|Cloud Service Account \\[cmdb\\_ci\\_cloud\\_service\\_account\\]|\n\n## Troubleshooting\n\nIf the mapping process does not proceed as you expected, follow the following suggestions.\n\n<table id=\"table_ggn_ypj_yhb\"><thead><tr><th>\n\nSymptom\n\n</th><th>\n\nCause\n\n</th><th>\n\nSolution\n\n</th></tr></thead><tbody><tr><td>\n\nDiscovery fails. The discovery message contains the information about an error caused by the REST timeout.\n\n</td><td>\n\nThere are many CIs sending the REST call response in the deployment. The MID Server cannot process the REST call response without exceeding the time limit controlled by the **mid.sa.cloud.request\\_timeout** parameter.\n\n</td><td>\n\nBy default, the **mid.sa.cloud.request\\_timeout** parameter is set to 30000 milliseconds. Increase the value of this parameter on the relevant MID Server and run discovery again.\n\n**Note:** If the **Configuration Parameters** related list for the relevant MID Server does not show this parameter, you may need to add it.\n\n</td></tr><tr><td>\n\nPattern Designer fails during a debug session. The Pattern Designer message contains information about an error caused by a timeout.\n\n</td><td>\n\nThe Pattern Designer fails because of a timeout during pattern debugging \\(and not during discovery\\).\n\n</td><td>\n\nBy default, the **sa.debugger.max\\_timeout**parameter is set to 240 seconds.Increase the value of this parameter on the relevant MID Server.\n\n</td></tr></tbody>\n</table>**Parent Topic:**[Available cloud discovery patterns](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/it-operations-management/discovery-and-service-mapping-patterns/available-patterns-cloud.md)\n\n"}}