Location field in Cloud Discovery VMs

MMGF
Tera Contributor

I would like to populate the Location field for my Virtual Machine Instances. The location appears to be populated in the Azure Virtual Machine (LP) Pattern but it does not get set in the CI. 

 

In the pattern step 14 (Add attributes to VM instance) there is a setAttribute for vm_location=virg1nia

 

In the pattern 'Creating CI' step we see --

2025-02-02 17:00:26: CIType 'cmdb_ci_vm_instance': {disks=2, install_status=1, vm_inst_id=3a8c3862-ecf3-4fe0-98b5-305bf8fd593a, name=azr-v-dc01, nics=1, state=on, disks_size=177, object_id=/subscriptions/76f9000x-eb29-4ae6-81ab-39318/resourceGroups/RG-V-DC01/providers/Microsoft.Compute/virtualMachines/azr-v-dc01, sys_class_name=cmdb_ci_vm_instance}
CIType 'cmdb_ci_vm_instance': {disks=2, install_status=1, vm_inst_id=dcb806c2-cfd1-4814-8a62-b9fbe2722654, name=azr-v-dc02, nics=1, state=on, disks_size=177, object_id=/subscriptions/76f9000x-eb29-4ae6-81ab-39318/resourceGroups/RG-V-DC02/providers/Microsoft.Compute/virtualMachines/AZR-V-DC02, sys_class_name=cmdb_ci_vm_instance}
CIType 'cmdb_ci_os_template': {offer=WindowsServer, comments=76f9000b-eb29-4ae6-81ab-3937fc4afc18_usgovvirg1nia_62043ae7dbc11010b2a1f9627596197e, install_status=1, name=/MicrosoftWindowsServer/WindowsServer/2019-Datacenter/latest, location=virg1nia, version=latest, object_id=/MicrosoftWindowsServer/WindowsServer/2019-Da

 

Here we see that the cmdb_ci_os_template gets location set but not the VMI. 

However, If I go to the os template table and look at Location, it is empty/null.

 

In the payload for the VM we do not see location set:

  {

      "className": "cmdb_ci_vm_instance",

      "values": {

        "disks": "2",

        "install_status": "1",

        "vm_inst_id": "3a8c3cc2-ecf3-4fe0-98b5-305bf8fd593a",

        "name": "azr-v-dc01",

        "nics": "1",

        "state": "on",

        "disks_size": "177",

        "object_id": "/subscriptions/76f9000x-eb29-4ae6-81ab-3918/resourceGroups/RG-V-DC01/providers/Microsoft.Compute/virtualMachines/azr-v-dc01",

        "sys_class_name": "cmdb_ci_vm_instance"

      },

 

 

I do not want to modify the OOB pattern. I am curious to know if the location not being set is a bug or expected. 

More importantly, I would like to know the best way to grab the information to extend this pattern to include Location when the VMI CI is created.

 

Thanks

0 REPLIES 0