ITOM discovery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
We’re encountering a situation where certain servers are incorrectly marked as “retired” in discovery tools due to terminated VM instance relations. However, these VMs are still active and running in production. This appears to stem from a prior migration activity, after which the VM status remained “terminated,” causing the operational status to reflect “retired.”
We’ve raised a HI case and were informed that this is expected out-of-box behavior—once a VM instance is marked terminated, it cannot be automatically updated back to “up.”
Is this behavior standard and meant to be managed manually?
Has anyone implemented a technical workaround or automation to restore accurate operational status in such scenarios?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
20 hours ago - last edited 20 hours ago
Hey,
This is indeed standard behavior, but it is not meant to be managed manually. To understand where this status comes from, feel free to take a look here: https://www.servicenow.com/docs/bundle/zurich-it-operations-management/page/product/discovery/refere...
Outside of that, the logic is, that terminated instances are retired for good (hence why it is a separate state from "just" retired). They are not meant to go back to a running state. To correct this, i'd propose you update all impacted instances once to be in the correct state. From then on onwards, the automation through the VM discovery/events should work correctly again.
This should not be a reoccurring issue - at least from my experience.
On a side note: I find the documentation here a bit irritating, as it leads to believe that "terminated" instances are indeed allowed to go back into a running state - which seems unreasonable.
Hope this helps,
Regards
Fabian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
19 hours ago
Hi @priyaadhikarla ,
- Logic: Identify records where the VM Instance state=terminated but the associated Server CI was recently updated by an IP-based Discovery or is known to be active.
- Script :
var gr = new GlideRecord('cmdb_ci_vm_instance'); gr.addEncodedQuery('state=terminated^install_status=3'); // '3' is typically 'Retired' // Add your logic to filter by your specific migration datagr.query();while (gr.next()) { gr.state = 'on'; // Or 'off' based on your requirement gr.install_status = 1; // Set to 'Installed' gr.operational_status = 1; // Set to 'Operational' gr.update(); }
Use code with caution.
- Modify the script to check if a "Terminated" VM instance actually still exists in the provider's response during a full horizontal discovery.
- If the VM is found during a full scan, force the state field to update regardless of its previous value.
If you find it helpful please mark it as helpful.
Regards,
Sagnic
