pkg/azure/api: Add cleanup in case of provision fail in Azure public IP provisionning#43598
Merged
aanm merged 2 commits intocilium:mainfrom Jan 14, 2026
Merged
Conversation
This addresses an issue with Azure where it will accept a public IP configuration even if a prefix is exhausted. This triggers a provisioning failure and Azure fails to reconcile the machine state. This change checks for such cases of provisioning failure and addresses them by deleting the public IP configuration and retrying. Signed-off-by: Alex Melhem <alex.melhem@datadoghq.com>
antonipp
reviewed
Jan 7, 2026
Contributor
antonipp
left a comment
There was a problem hiding this comment.
Thanks, good find! Generally looks good, just one small comment to make sure we address all failure scenarios
This addresses an issue with Azure where it will accept a public IP configuration even if a prefix is exhausted. This triggers a provisioning failure and Azure fails to reconcile the machine state. This change checks for such cases of provisioning failure and addresses them by deleting the public IP configuration and retrying. Signed-off-by: Alex Melhem <alex.melhem@datadoghq.com>
58a45f6 to
23a3866
Compare
Contributor
|
/test |
Member
|
Heads up for @Azure reviewers (@antonipp in this case), you should set the |
Contributor
|
Ah, I missed this, thanks for fixing this! |
Member
Member
|
@aanm It also looks like this was already applied to v1.19. Removing the v1.19 label as well. |
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.
Observation
When using public IP assignment with Azure VMSS instances, we have observed a bug that causes instances to fail during provisioning due to exhausted public IP prefixes.
When a public IP prefix is assigned to a node, the prefix is first selected and then the VM update is performed. If multiple nodes are created and a prefix has, for example, only one available IP address, all nodes may see this address as available during the check phase and attempt to acquire it simultaneously.
This scenario should be handled by Azure: only one configuration should be accepted, while the others should be rejected and retried with a different prefix. However, in certain cases, Azure’s API behaves unexpectedly, and we observe the following error message:
The error code 200 suggests that the update was successfully carried out, which is consistent with what we observe on the VM instance. The IP configuration is registered in Azure, but the VM remains in a ProvisionFailed state.
Since the current logic for assigning public IPs considers only the configuration state and not the provisioning status, Cilium assumes that the VM already has a public IP assigned and therefore does not attempt to assign a new one. As a result, the VM never reconciles successfully and never actually receives a public IP.
How does this fix the problem
To fix the problem, we updated the check logic to be aware of the provisioning status. It now detects when provisioning has failed due to
ProvisioningState/failed/PublicIpPrefixOutOfIpAddressesForVMScaleSet. In this case, it deletes the erroneous configuration and then proceeds to reassign a new public IP prefix.We tested this new version of the VMSS public IP assignment on our clusters and it successfully reconciled broken VMs.