Closed k-chu closed 3 years ago
@miq-bot add_label kasparov/yes?
Hi @agrare
Thanks for the review. It seems in the case of Azure, the only id we can matchup with Azure VMs is the one stored as ems_ref. I looked through our Terraform state file and have not found the value they use for uid_ems
In the case of VMware, the virtual_instance_ref matches the uid_ems in VMs
I compared between the Vmware and Azure vms and these are the values i see.
VMware - Configured Systems
VMware - VMs
Azure - Configured Systems | hostname | virtual_instance_ref |
---|---|---|
virtualmachine-tm-vm | /subscriptions/0e0a4287-8719-4849-bb0b-5242e4507709/resourceGroups/virtualmachine-tm-075b00e5-rg/providers/Microsoft.Compute/virtualMachines/virtualmachine-tm-vm |
Azure - VMs | name | uid_ems | ems_ref |
---|---|---|---|
virtualmachine-tm-vm | b70ad672-e302-4124-b771-f7f2e64dc6f8 | 0e0a4287-8719-4849-bb0b-5242e4507709/virtualmachine-tm-075b00e5-rg/microsoft.compute/virtualmachines/virtualmachine-tm-vm |
Okay if VMware needs to use uid_ems and Azure needs to use ems_ref we're going to need to create a new inventory_collection for azure vms in the persister.
I think we should rename the current vms
collection to vms_by_uid_ems
and add a new one called vms_by_ems_ref
.
Kasparov backport details:
$ git log -1
commit 0855063c73c1a5363bdd1c3d059a5abe42c2ecee
Author: Adam Grare <agrare@redhat.com>
Date: Thu Nov 12 16:22:06 2020 -0500
Merge pull request #47 from k-chu/fix_azure_ems_ref
Update Azure ems_ref to match Azure Provider
(cherry picked from commit c7b9ffef19881e484c0767dc7142aa60a1c534a2)
The format for the Azure virtual_instance_ref returned by Terraform is different from the one ManageIQ Azure provider creates. This change will modify the one from Terraform to match the one from Azure provider so that we can link the two vm's.
Fix for https://github.com/ManageIQ/manageiq-providers-ibm_terraform/issues/45