Criteria for "SAM - Delete Discovery Models if there are no related Installations" Scheduled Job

teacodess
Tera Contributor

I have a handful of discovery models that are in the "New" status with no related software installations. However, they're not getting deleted by the "SAM - Delete Discovery Models if there are no related Installations" OOTB scheduled job. I understand that the discovery model must not be in the "Manually Normalized" state. What other criteria could there be for discovery models to be deleted by this job?

1 REPLY 1

Vishnu-K
Kilo Sage

Hi @teacodess ,

 

Your DMs are in "New" status so they pass the first check. The script has three additional guards that prevent deletion even with no installs:

  1. Referenced in an Engineering App Denial (samp_eng_app_denial) - if com.sn_samp_eng_app plugin is active
  2. Referenced in IBM SW Classification (ibm_sw_classification) or ILMT Product Usage (ilmt_v2_product_usage) — if sn_samp_ibm_lic plugin is active
  3. A ghost install still exists in cmdb_sam_sw_install pointing to that DM

Run this to find out which one is blocking your specific DMs:

var dmSysId = 'discoveryModelSysId';

var si = new GlideRecord('cmdb_sam_sw_install');
si.addQuery('discovery_model', dmSysId);
si.query();
gs.print('Has installs: ' + si.hasNext());

var denial = new GlideRecord('samp_eng_app_denial');
denial.addQuery('discovery_model', dmSysId);
denial.query();
gs.print('In eng denial: ' + denial.hasNext());

var ibm = new GlideRecord('ibm_sw_classification');
ibm.addQuery('discovery_model', dmSysId);
ibm.query();
gs.print('In IBM classification: ' + ibm.hasNext());

Whichever prints true is your blocker. Hope this helps!

If it helped you please do mark it as helpful and accept the solution

 

Thanks,

Vishnu