Azure backports#668
Merged
Merged
Conversation
Since Azure does not expose a single API to list all network interfaces for VMSS instances, the way we currently list them is we first make an API call to list all VMSSs, then for each VMSS, we make a call to list its network interfaces. The thing is if a VMSS has zero instances (and so zero network interfaces), we still make that call to list VMSS network interfaces. Since the initial call that listed all VMSS also returned the number of instances in each VMSS, we can skip empty ones to save unnecessary API calls. Not only is this good for API call rate limit buckets consumption, but since each VMSS listNetworkInterfaces calls are done serially, this can also significantly speed up the overall instance sync. Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
`resyncInstance` previously called `GetInstance` twice: * once with an empty subnet map to discover referenced subnet IDs * then again with the resolved subnets to repopulate CIDR/gateway info. Each end up causing Azure API calls through `listVirtualMachineScaleSetVMNetworkInterfaces` even though the NIC data returned is identical in both cases. This PR mirrors the fetch-once/parse-twice pattern already used by the full-cluster `resyncInstances` path: call `ListVMNetworkInterfaces` once, then run `ParseInterfacesIntoInstance` twice (first with an empty subnet map, then with the resolved subnets). The second parse is a pure in-memory operation, eliminating the redundant `GetInstance` call per InstanceSync. Note: Since `GetInstance` was a wrapper over `ListVMNetworkInterfaces` + `ParseInterfacesIntoInstance` but we now run those separately as we only get once and parse twice, the `GetInstance` function is no longer used and is removed. Similarly, the already unused `GetInstances` function is removed as well. Signed-off-by: Hadrien Patte <hadrien.patte@datadoghq.com>
jaredledvina
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports:
GetInstancecall in per-instance resync cilium/cilium#46192