Setting the [location] field of a Virtual Machine Instances [cmdb_ci_vm_instance] based on Hosted on
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2023 03:30 AM
Based on my observation, the location field of the Virtual Machine Instances [cmdb_ci_vm_instance] record is empty for all Azure VM configuration items. To address this, we aim to populate the location field value using the CI Relationships [cmdb_rel_ci] Hosted on::Hosts relationship.
Current Record:
- Name: John-Doe-Server
- Hosted on::Hosts: East US 2
Consequently, the location field value should also be East US 2.
There are two potential options I think we can use to achieve this:
Scheduled Job: Create a scheduled job that runs at specified intervals to update the location field based on the information from the CI Relationships [cmdb_rel_ci] Hosted on::Hosts relationship.
Pattern extension of Azure - Virtual Machine (LP): Alternatively, we consider extending the existing pattern for Azure - Virtual Machine (LP) to include logic that automatically populates the location field based on the Hosted on::Hosts relationship.
Which of the 2 option is best?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-20-2023 06:35 AM
when you are in ROME lets talk like Romans 🙂
I will go with Service Now Discovery Pattern extension when requirement is from Discovery Module. 🙂
Regards
RP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2023 12:30 AM
Hi @HH10
You already have precise info via CI Relations on the form as to where that VM is located and vice versa from the LDC record
you can see which resources are in that region, which is all due to the CI relations.
In addition to this, we have great cloud dashboards to see and visualize the data. If you still need the location field despite these, as Rahul suggested, you can go with Pattern Extension.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-24-2023 01:03 PM
This is more for ease of reporting on the [cmdb_ci_vm_instance] table wherein AWS, Azure and VMWare VM instance must have the location field populated. Unless there is an easier way.