azure icon indicating copy to clipboard operation
azure copied to clipboard

Added possibility to assign RG name via env var ANSIBLE_AZURE_VMSS_RESOURCE_GROUPS for VMSS and Fix inventory fail when trying to parse instance from the flexible scale set

Open Justwmz opened this issue 1 year ago • 4 comments

SUMMARY

Added possibility to assign RG name via env var ANSIBLE_AZURE_VMSS_RESOURCE_GROUPS for VMSS closes https://github.com/ansible-collections/azure/issues/1432

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

azure_rm

Justwmz avatar Feb 09 '24 22:02 Justwmz

SUMMARY

Fix inventory failure when trying to parse instances from the flexible scale set closes https://github.com/ansible-collections/azure/issues/1431

ISSUE TYPE
  • Bug Fix
COMPONENT NAME

azure_rm

Justwmz avatar Feb 09 '24 22:02 Justwmz

@Justwmz According to the return range, should we return VMSS instances and filter VMSS instances in VMS? right?

Fred-sun avatar Feb 26 '24 01:02 Fred-sun

@Fred-sun We can do that, but there will be another problem. If you supply the name of the rg for the include_vm_resource_groups and include_vmss_resource_groups to the same value. It will cause a double fetch of instances within a scale set because they are regular VMS. After all, they are a part of both types...

We can add a check when we fetch vms if it is a part of the scale set, but you need to perform an API call to Azure to see from the response if this property is present or not. Which will anyway cause a double API call.

So in our case, better to completely filter out flexible parents, and let inventory fetch flexible instances using --> include_vm_resource_groups.

This solves a problem with double API calls for the same instances and from the performance side it will be better.

Justwmz avatar Mar 02 '24 20:03 Justwmz

@Justwmz Your idea is really acceptable, but we still need to discuss it, thank you!

Fred-sun avatar Mar 04 '24 02:03 Fred-sun

Hi @Fred-sun, Is there any news regarding this issue? Any decisions being made?

Justwmz avatar Nov 04 '24 01:11 Justwmz

@Justwmz There is a conflict, please fix it. Thank you!

Fred-sun avatar Nov 04 '24 06:11 Fred-sun