ManageIQ / manageiq-providers-ibm_terraform

Apache License 2.0
2 stars 27 forks source link

Cannot map azure configured system with the virtual machine instance #45

Closed epostea closed 3 years ago

epostea commented 3 years ago

In the IBM terraform provider, we create a link between the Configured system and the virtual machine instance. We use the resource id to map these two.

For the azure cloud, the terraform resource ID is:

While the virtual machine instance has the following ID:

epostea commented 3 years ago

fyi @agrare @k-chu

epostea commented 3 years ago

@miq-bot add_label bug

agrare commented 3 years ago

The Azure provider uses the vm_id as the uid_ems and this as the ems_ref: https://github.com/ManageIQ/manageiq-providers-azure/blob/master/app/models/manageiq/providers/azure/inventory/parser/cloud_manager.rb#L66-L69

uid = File.join(collector.subscription_id,
                instance.resource_group.downcase,
                instance.type.downcase,
                instance.name)

And the terraform persister.vms manager_ref is the uid_ems, @epostea is 0e0a4287-8719-4849-bb0b-5242e4507709/virtualmachine-tm-075b00e5-rg/microsoft.compute/virtualmachines/virtualmachine-tm-vm what you see in our azure VMs uid_ems column?

k-chu commented 3 years ago

Data from vms table:

   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
k-chu commented 3 years ago

@miq-bot assign @k-chu

k-chu commented 3 years ago

@miq-bot close_issue

agrare commented 3 years ago

@k-chu by the way if you want a PR to automatically close an issue you can put Fixes PR_NUMBER in the description