You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error thrown CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool when using azurerm_network_interface_backend_address_pool_association
#25962
Open
1 task done
ashleysommer opened this issue
May 14, 2024
· 3 comments
Error: updating Backend Address Pool Association forNetwork Interface: (Name "nic-1" / Resource Group "minimal_rg"): network.InterfacesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool" Message="Mixing backend ipconfigurations and IPAddressesin backend pool /subscriptions/f9226acc-94d1-46a8-af99-88fb2757df4a/resourceGroups/minimal_rg/providers/Microsoft.Network/loadBalancers/lb-1/backendAddressPools/lb-backend-pool-1 is not allowed." Details=[]│ │ with azurerm_network_interface_backend_address_pool_association.my_nic_address_pool,│ on main.tf line 132, in resource "azurerm_network_interface_backend_address_pool_association""my_nic_address_pool":│ 132: resource "azurerm_network_interface_backend_address_pool_association""my_nic_address_pool" {
I'm trying to assign my VM's NIC to a Load-Balancer Backend Address Pool using azurerm_network_interface_backend_address_pool_association, I followed the docs for azurerm_network_interface_backend_address_pool_association as well as other example implementations and guides, I believe I've configured it correctly.
Actual Behaviour
Azure fails to associate the NIC to the Load-balancer's Backend Address Pool.
Code="CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool" Message="Mixing backend ipconfigurations and IPAddresses in backend pool /subscriptions/f9226acc-94d1-46a8-af99-88fb2757df4a/resourceGroups/minimal_rg/providers/Microsoft.Network/loadBalancers/lb-1/backendAddressPools/lb-backend-pool-1 is not allowed."
The error indicates mixing IP-based addresses and IP Configurations on the LoadBalancer Backend Address Pool, however notice in the example I'm only adding a single item, that is a NIC IP Configuration to the Backend Address Pool.
Steps to Reproduce
Use minimal reproduction supplied, run terraform apply .
Important Factoids
No response
References
Seems like a recent issue with the Azure backend? Searching google for "CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool" only shows hits starting from the last 48 hours. Searching this issue tracker and other issue trackers shows no reference to this error being reported before.
Thank you for taking the time to open this issue. #25959 has been merged and should be released soon, if you're able to upgrade once it is released and let us know if this issue is resolved that would be much appreciated!
@rcskosir
I've just upgraded to release v3.104.0, which contains the changes from #25959 and I'm still seeing the same error as in the initial report.
CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool: Mixing backend ipconfigurations and IPAddresses in backend pool
For what its worth, I also downgraded to v3.85.0 yesterday to see if that helps, and I'm seeing the same error on that version too.
This could well still be something wrong with my understanding of how to use azurerm_network_interface_backend_address_pool_association (as seen in my provided terraform files), but I'm struggling to see where my mistake is, it should be a straightforward operation.
@rcskosir
I found that if I remove the virtual_network_id from my lb_backend_address_pool then my problem resolves itself.
I was wondering why virtual_network_id is an "optional" attribute, and it seems that if you specify a virtual_network_id on the lb_backend_address_pool then it puts the address pool in "IPAddress" mode. But if you don't supply the virtual_network_id, then the pool allows you to add NIC IPConfiguration Associations as I wanted.
resource"azurerm_lb_backend_address_pool""my_lb_backend_pool" {
name ="lb-backend-pool-1"
loadbalancer_id = azurerm_lb.my_lb.id#virtual_network_id = azurerm_virtual_network.my_vnet.id <-- remove this
}
I wonder if this is a recent change, or has always been like that? Does it need to be put in the documentation?
Is there an existing issue for this?
Community Note
Terraform Version
1.8.3
AzureRM Provider Version
3.103.1
Affected Resource(s)/Data Source(s)
azurerm_network_interface_backend_address_pool_association
Terraform Configuration Files
This Gist shows a minimal reproduction of the error:
https://gist.github.com/ashleysommer/7a9d62eb3dbc770118e95d4d963da940
Debug Output/Panic Output
This Gist contains the relevant debug output:
https://gist.github.com/ashleysommer/4a6767bd3b774eebb2b3f7718926e850
Expected Behaviour
I'm trying to assign my VM's NIC to a Load-Balancer Backend Address Pool using
azurerm_network_interface_backend_address_pool_association
, I followed the docs forazurerm_network_interface_backend_address_pool_association
as well as other example implementations and guides, I believe I've configured it correctly.Actual Behaviour
Azure fails to associate the NIC to the Load-balancer's Backend Address Pool.
The error indicates mixing IP-based addresses and IP Configurations on the LoadBalancer Backend Address Pool, however notice in the example I'm only adding a single item, that is a NIC IP Configuration to the Backend Address Pool.
Steps to Reproduce
Use minimal reproduction supplied, run
terraform apply
.Important Factoids
No response
References
Seems like a recent issue with the Azure backend? Searching google for "CannotMixIPBasedAddressesAndIPConfigurationsOnLoadBalancerBackendAddressPool" only shows hits starting from the last 48 hours. Searching this issue tracker and other issue trackers shows no reference to this error being reported before.
This may be fixed by #25959 ?
The text was updated successfully, but these errors were encountered: