-
Notifications
You must be signed in to change notification settings - Fork 341
Description
SUMMARY
Currently the azure_rm inventory script is getting details on all virtual machines (instance view and nic details) for every VM in your defined resource groups (include_vm_resource_groups) or your whole subscription. It does not take into account *_host_filters until filtering the results. This means depending on how restrictive your filters are you may do a lot of unnecessary calls to the azure batch api.
Looking at the code I had no good idea how to easily filter it, but I guess you can do it either in:
azure/plugins/inventory/azure_rm.py
Lines 763 to 765 in b960a0b
inventory_client._enqueue_get(url="{0}/instanceView".format(vm_model['id']), | |
api_version=self._inventory_client._compute_api_version, | |
handler=self._on_instanceview_response) |
and
azure/plugins/inventory/azure_rm.py
Lines 772 to 775 in b960a0b
inventory_client._enqueue_get(url=nic['id'], | |
api_version=api_version, | |
handler=self._on_nic_response, | |
handler_args=dict(is_primary=is_primary)) |
or maybe directly in
azure/plugins/inventory/azure_rm.py
Lines 338 to 341 in b960a0b
def _enqueue_get(self, url, api_version, handler, handler_args=None): | |
if not handler_args: | |
handler_args = {} | |
self._request_queue.put_nowait(UrlAction(url=url, api_version=api_version, handler=handler, handler_args=handler_args)) |
ISSUE TYPE
- Feature Idea
COMPONENT NAME
azure_rm