This article explains how to run a cleanup script to remove unnecessary VM records if you have been using version 1.6 or 1.7 of the Flexera One ServiceNow app before the 1.7 patch release and have VM instance records sourced from the IT Visibility Hardware Inventory API.
The cleanup script removes all VM records created by the FlexeraOne app in the cmdb_ci_vm_instance table. These records represent Guest VMs, not VM instances, and therefore should reside under the Computer/Server hierarchy within the CMDB. Removing them ensures that during the next snapshot run, the Classification Rules Framework correctly maps and classifies guest VM data into the appropriate CI classes. The version 1.7 patch fixes the mapping logic, but does not remove the existing records in the cmdb_ci_vm_instance table.
Clean up VM instances
-
Create a new Scheduled Script Execution (sysauto_script) record in the Global scope and name the record: FlexeraOne job to remove VM from VMI table.
-
Set the Run option to On Demand.
-
In the Script field, add the following cleanup script:
var deletedCount = 0;
var guestVM = new GlideRecord('cmdb_ci_vm_instance');
guestVM.addQuery('discovery_source', 'FlexeraOne');
guestVM.query();
while (guestVM.next()) {
guestVM.deleteRecord();
deletedCount++;
}
gs.info('[Cleanup Job] Deleted ' + deletedCount + ' VM records from cmdb_ci_vm_instance where discovery_source=FlexeraOne');
-
After entering the script and configuring required fields, select Save.
-
Click Execute Now to run the script.
-
Monitor script progress:
-
-
Navigate to System Scheduler > Progress Worker to track the execution status.
-
-
-
You can also monitor System Logs > System Log > All for entries from the script. Look for log entries like:
[Cleanup Job] Deleted X VM records from cmdb_ci_vm_instance where discovery_source=FlexeraOne
-
-
Validate the cleanup:
-
-
Navigate to the cmdb_ci_vm_instance table.
-
-
-
Apply the filter: discovery_source=FlexeraOne
-
-
-
Confirm that no records are returned. This result indicates the cleanup was successful.
-
-
Run the Snapshot Job.
Related Articles
Duplicate license records may be created in Flexera One ITAM based on data imported from Fexera One SaaS Management 17Number of Views How to create a local application in FNMS/Flexera One 40Number of Views Create local file evidence in Flexera One ITAM or FlexNet Manager Suite 53Number of Views Unable to remove the administrator role in ITAM 17Number of Views No details are available to enable users to troubleshoot when a Flexera One ITAM export to ServiceNow fails 5Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Case id: 00001065
Activity: Status change: 2 hours ago