Customizing Cloud Discovery MID server selectionSummary<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Cloud Discovery schedules do not support enforced MID server selection in the same way that standard Configuration Item Discovery does. This creates a risk of data cross-contamination between clients when a shared Cloud Discovery MID server is in use, even on a client-neutral network or with domain separation in place. This article explains how to customize MID server selection logic using the CloudMidSelectionApi and CloudDiscoveryScheduleConfig script includes. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } Written with Orlando in mind. Slight modifications may be required for older versions; general concepts remain the same. Instructions The bulk of customizations are in the selectMid function in the CloudMidSelectionApi script include. Most cloud API calls pass a context object variable to the selectMid function. This object contains service account details that can be used to customize MID server selection. The relevant property is typically context.account_id, though this should be tested on the specific version in use to confirm. Some API calls do not pass a context variable. The most notable example is Discover Datacenters. For Orlando (OP3), locate the relevant call in CloudDiscoveryScheduleConfig.discoverDatacentersViaCapi(). The call appears as: capiSvrScript.resolveMid('',cloudType,'') The resolveMid() call supports four arguments in the back end. The fourth argument is the context variable. To pass a custom context object through Discover Datacenters, modify CloudDiscoveryScheduleConfig as follows: discoverDatacentersViaCapi: function(serviceAccountSysID) { var context = {'account_id':serviceAccountSysId}; Then update the resolveMid() call to pass the context object: capiSvrScript.resolveMid('',cloudType,'',context); With this change, Discover Datacenters respects the MID server selection algorithm defined in CloudMidSelectionApi. To apply MID server selection logic in CloudMidSelectionApi, add conditional blocks for the desired criteria. To assign a MID server by service account, add logic such as the following: if (context.account == '[desired service accountid]') { return '[desired mid server sysid]'; } Any logical customization can be implemented here. The context object variable contains most of the information needed to differentiate between options.