When using 2020-05-01 network API, when I want to remove a load balancer rule that the load balancer is attached to VMSS, the request will fail.
The complete flow is as below:
GET https://management.azure.com/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1?api-version=2020-05-01 HTTP/2.0
{
"name": "hbtest1",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"type": "Microsoft.Network/loadBalancers",
"location": "eastus2",
"tags": {},
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "bf36d61a-728d-4255-8292-4397720a279d",
"frontendIPConfigurations": [
{
"name": "hbtest1",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/frontendIPConfigurations/hbtest1",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"type": "Microsoft.Network/loadBalancers/frontendIPConfigurations",
"properties": {
"provisioningState": "Succeeded",
"privateIPAddress": "10.0.1.4",
"privateIPAllocationMethod": "Dynamic",
"subnet": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/virtualNetworks/acceptanceTestVirtualNetwork1/subnets/testsubnet"
},
"loadBalancingRules": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/loadBalancingRules/rule1"
}
],
"privateIPAddressVersion": "IPv4"
}
}
],
"backendAddressPools": [
{
"name": "hbtest1",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/backendAddressPools/hbtest1",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"properties": {
"provisioningState": "Succeeded",
"loadBalancerBackendAddresses": [
{
"name": "test-hbtest_hbtest1_virtualMachines_1_networkInterfaces_primaryprimary",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/backendAddressPools/hbtest1/loadBalancerBackendAddresses/test-hbtest_hbtest1_virtualMachines_1_networkInterfaces_primaryprimary",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"properties": {
"provisioningState": "Succeeded",
"networkInterfaceIPConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/1/networkInterfaces/primary/ipConfigurations/primary"
}
},
"type": "Microsoft.Network/loadBalancers/backendAddressPools/loadBalancerBackendAddresses"
},
{
"name": "test-hbtest_hbtest1_virtualMachines_2_networkInterfaces_primaryprimary",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/backendAddressPools/hbtest1/loadBalancerBackendAddresses/test-hbtest_hbtest1_virtualMachines_2_networkInterfaces_primaryprimary",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"properties": {
"provisioningState": "Succeeded",
"networkInterfaceIPConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/2/networkInterfaces/primary/ipConfigurations/primary"
}
},
"type": "Microsoft.Network/loadBalancers/backendAddressPools/loadBalancerBackendAddresses"
},
{
"name": "test-hbtest_hbtest1_virtualMachines_0_networkInterfaces_primaryprimary",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/backendAddressPools/hbtest1/loadBalancerBackendAddresses/test-hbtest_hbtest1_virtualMachines_0_networkInterfaces_primaryprimary",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"properties": {
"provisioningState": "Succeeded",
"networkInterfaceIPConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/0/networkInterfaces/primary/ipConfigurations/primary"
}
},
"type": "Microsoft.Network/loadBalancers/backendAddressPools/loadBalancerBackendAddresses"
}
],
"backendIPConfigurations": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/1/networkInterfaces/primary/ipConfigurations/primary"
},
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/2/networkInterfaces/primary/ipConfigurations/primary"
},
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/0/networkInterfaces/primary/ipConfigurations/primary"
}
],
"loadBalancingRules": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/loadBalancingRules/rule1"
}
]
},
"type": "Microsoft.Network/loadBalancers/backendAddressPools"
}
],
"loadBalancingRules": [
{
"name": "rule1",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/loadBalancingRules/rule1",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"type": "Microsoft.Network/loadBalancers/loadBalancingRules",
"properties": {
"provisioningState": "Succeeded",
"frontendIPConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/frontendIPConfigurations/hbtest1"
},
"frontendPort": 5000,
"backendPort": 5000,
"enableFloatingIP": false,
"idleTimeoutInMinutes": 10,
"protocol": "Tcp",
"enableDestinationServiceEndpoint": false,
"enableTcpReset": false,
"allowBackendPortConflict": false,
"loadDistribution": "Default",
"disableOutboundSnat": true,
"backendAddressPool": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/backendAddressPools/hbtest1"
},
"probe": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/probes/rule1"
}
}
}
],
"probes": [
{
"name": "rule1",
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/probes/rule1",
"etag": "W/\"1867ac9a-5eca-431f-831c-939768a65794\"",
"properties": {
"provisioningState": "Succeeded",
"protocol": "Tcp",
"port": 5000,
"intervalInSeconds": 15,
"numberOfProbes": 2,
"loadBalancingRules": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/loadBalancingRules/rule1"
}
]
},
"type": "Microsoft.Network/loadBalancers/probes"
}
],
"inboundNatRules": [],
"outboundRules": [],
"inboundNatPools": []
},
"sku": {
"name": "Standard"
}
}
PUT https://management.azure.com/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1?api-version=2020-05-01 HTTP/2.0
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1",
"location": "eastus2",
"properties": {
"frontendIPConfigurations": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/frontendIPConfigurations/hbtest1",
"name": "hbtest1",
"properties": {
"loadBalancingRules": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/loadBalancingRules/rule1"
}
],
"privateIPAddress": "10.0.1.4",
"privateIPAllocationMethod": "Dynamic",
"privateIPAddressVersion": "IPv4",
"subnet": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/virtualNetworks/acceptanceTestVirtualNetwork1/subnets/testsubnet"
},
"provisioningState": "Succeeded"
}
}
],
"backendAddressPools": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/backendAddressPools/hbtest1",
"name": "hbtest1",
"properties": {
"backendIPConfigurations": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/1/networkInterfaces/primary/ipConfigurations/primary"
},
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/2/networkInterfaces/primary/ipConfigurations/primary"
},
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/0/networkInterfaces/primary/ipConfigurations/primary"
}
],
"loadBalancerBackendAddresses": [
{
"name": "test-hbtest_hbtest1_virtualMachines_1_networkInterfaces_primaryprimary",
"properties": {
"networkInterfaceIPConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/1/networkInterfaces/primary/ipConfigurations/primary"
}
}
},
{
"name": "test-hbtest_hbtest1_virtualMachines_2_networkInterfaces_primaryprimary",
"properties": {
"networkInterfaceIPConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/2/networkInterfaces/primary/ipConfigurations/primary"
}
}
},
{
"name": "test-hbtest_hbtest1_virtualMachines_0_networkInterfaces_primaryprimary",
"properties": {
"networkInterfaceIPConfiguration": {
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Compute/virtualMachineScaleSets/hbtest1/virtualMachines/0/networkInterfaces/primary/ipConfigurations/primary"
}
}
}
],
"loadBalancingRules": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/loadBalancingRules/rule1"
}
],
"provisioningState": "Succeeded"
}
}
],
"loadBalancingRules": [],
"probes": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/probes/rule1",
"name": "rule1",
"properties": {
"loadBalancingRules": [
{
"id": "/subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/loadBalancers/hbtest1/loadBalancingRules/rule1"
}
],
"protocol": "Tcp",
"port": 5000,
"intervalInSeconds": 15,
"numberOfProbes": 2,
"provisioningState": "Succeeded"
}
}
],
"inboundNatRules": [],
"inboundNatPools": [],
"outboundRules": [],
"resourceGuid": "bf36d61a-728d-4255-8292-4397720a279d",
"provisioningState": "Succeeded"
},
"sku": {
"name": "Standard"
},
"tags": {}
}
Response:
{
"error": {
"code": "InvalidRequestFormat",
"details": [
{
"code": "DuplicateIpConfigurationReferenceOnBackendAddressPool",
"message": "Found duplicate ipConfiguration reference /subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/networkInterfaces/|providers|Microsoft.Compute|virtualMachineScaleSets|hbtest1|virtualMachines|1|networkInterfaces|primary/ipConfigurations/primary on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/hbtest1/loadBalancerBackendAddresses/70f3bd40-2344-4c29-8177-768d4c3ca926."
},
{
"code": "DuplicateIpConfigurationReferenceOnBackendAddressPool",
"message": "Found duplicate ipConfiguration reference /subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/networkInterfaces/|providers|Microsoft.Compute|virtualMachineScaleSets|hbtest1|virtualMachines|2|networkInterfaces|primary/ipConfigurations/primary on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/hbtest1/loadBalancerBackendAddresses/46147dc8-81bf-42be-8372-7815357a3f3f."
},
{
"code": "DuplicateIpConfigurationReferenceOnBackendAddressPool",
"message": "Found duplicate ipConfiguration reference /subscriptions/0-0-0-0/resourceGroups/test-hbtest/providers/Microsoft.Network/networkInterfaces/|providers|Microsoft.Compute|virtualMachineScaleSets|hbtest1|virtualMachines|0|networkInterfaces|primary/ipConfigurations/primary on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/hbtest1/loadBalancerBackendAddresses/a34f230b-359e-42a3-bb2e-921085c852b8."
}
],
"message": "Cannot parse the request."
}
}
I am also facing the same issue, please fix
I just ran into this issue as well. I am pretty sure I didn't experience this until after implementing Scale Sets. But could be wrong.
Error: Error Creating/Updating Load Balancer "lbi.example.example-poc.development.services" (Resource Group "rg.example.example-poc.development.services"): network.LoadBalancersClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidRequestFormat" Message="Cannot parse the request." Details=[{"code":"DuplicateIpConfigurationReferenceOnBackendAddressPool","message":"Found duplicate ipConfiguration reference /subscriptions/134b3809-76mf-4891-bf25-edfaf8d5fc6f/resourceGroups/rg.example.example-poc.development.services/providers/Microsoft.Network/networkInterfaces/nic-wpapp01.example.example-poc.development.services/ipConfigurations/ip-wpapp01.example.example-poc.development.services on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/lbi-wpapp.example.example-poc.development.services/loadBalancerBackendAddresses/0af31b77-ec08-4910-a328-66fe0662a851."},{"code":"DuplicateIpConfigurationReferenceOnBackendAddressPool","message":"Found duplicate ipConfiguration reference /subscriptions/134b3809-76mf-4891-bf25-edfaf8d5fc6f/resourceGroups/rg.example.example-poc.development.services/providers/Microsoft.Network/networkInterfaces/nic-wpapp02.example.example-poc.development.services/ipConfigurations/ip-wpapp02.example.example-poc.development.services on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/lbi-wpapp.example.example-poc.development.services/loadBalancerBackendAddresses/e7c37c29-a3ac-403d-b234-a74009841b8a."}]
We have the same problem, please fix
This also affects any regular VMs in a Standard LB's backend pool
Error: Error Creating/Updating Load Balancer "LB-TEST01" (Resource Group "RGP-TESTAZURERMv2"):
network.LoadBalancersClient#CreateOrUpdate: Failure sending request: StatusCode=400 --
Original Error:
Code="InvalidRequestFormat"
Message="Cannot parse the request."
Details=[{
"code":"DuplicateIpConfigurationReferenceOnBackendAddressPool",
"message":"Found duplicate ipConfiguration reference /subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxx/resourceGroups/RGP-TESTAZURERMv2/providers/Microsoft.Network/networkInterfaces/vmtest01_nic-eth0/ipConfigurations/vmtest01-SubnetIPConfig on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/LB-TEST01-backend_pool/loadBalancerBackendAddresses/xxxxxx-xxxx-xxxx-xxxx-xxxxxx."},
{"code":"DuplicateIpConfigurationReferenceOnBackendAddressPool",
"message":"Found duplicate ipConfiguration reference /subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxx/resourceGroups/RGP-TESTAZURERMv2/providers/Microsoft.Network/networkInterfaces/vmtest02_nic-eth0/ipConfigurations/vmtest02-SubnetIPConfig on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/LB-TEST01-backend_pool/loadBalancerBackendAddresses/xxxxxx-xxxx-xxxx-xxxx-xxxxxx."
}]
You can temporarily lock down the azurerm module to version 2.17.0, it is still using the older Azure API and does not have this problem.
So this is interesting, I am using 2.15.0 and seeing this issue quite regularly.
provider "azurerm" {
client_id = var.azurerm_client_id
client_secret = var.azurerm_client_secret
subscription_id = var.azurerm_subscription_id
tenant_id = var.azurerm_tenant_id
version = "~> 2.15"
features {}
}
According to https://www.terraform.io/docs/configuration/modules.html#module-versions with "~> 2.15" you are allowing any version up to (excluding) 3.0.0. So, most likely you are using right now 2.19, which is the highest available one < 3.0.0
That is actually true. Thanks for catching that!
Btw, just in case it matters for some one, the same issue exist with managing LB health checks - same exact issue, and same (temporary) fix.
Saw this there as well. I am about to kick off a pipeline build to see if this solves the issues I've experienced as well. Just to clarify, I have pinned the provider to 2.17
provider "azurerm" {
client_id = var.azurerm_client_id
client_secret = var.azurerm_client_secret
subscription_id = var.azurerm_subscription_id
tenant_id = var.azurerm_tenant_id
version = "= 2.17"
features {}
}
Curious whether this is related as well. I have put in depends_on which seems to get around the race conditions I have been experiencing. Just a thought.
Hi @zikalino or @qianwens Could you please take a look at this?
BTW, does Azure/azure-rest-api-specs#10131 fixes this?
Just as an FYI. I have gone through pipeline several times now with success using 2.17. That is about 173 resources spinning up, tearing down, and spinning up again. This also includes removing the depends_on that I mentioned earlier. I will be testing quite a bit more as well.
UPDATE - The fourth teardown has gone into a race condition. So, maybe not related.
This one is still active and present :(
but it does work with the 2.17 version of the azurerm provider!
Test case - deploy Azure Loadbalancer
-> now create another backend pool or even a separate frontend and the same setup on the existing one
-> it fails to create a backend or even remove the existing one which is in no way connected to the backend that has VMs added to!
Error output:
[
{
"code":"DuplicateIpConfigurationReferenceOnBackendAddressPool",
"message":"Found duplicate ipConfiguration reference /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RG_NAME>/providers/Microsoft.Network/networkInterfaces/<VM-1>/ipConfigurations/primary on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/backend-internal-dns/loadBalancerBackendAddresses/XXXXXX."
},
{
"code":"DuplicateIpConfigurationReferenceOnBackendAddressPool",
"message":"Found duplicate ipConfiguration reference /subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RG_NAME>/providers/Microsoft.Network/networkInterfaces/<VM-2>/ipConfigurations/primary on backend pool addresses /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools//loadBalancerBackendAddresses/ and /subscriptions//resourceGroups//providers/Microsoft.Network/loadBalancers//backendAddressPools/backend-internal-dns/loadBalancerBackendAddresses/XXXXXX."
}
]
@ArcturusZhang can we get the "Service Attention" and "Load Balancer" labels on this one so the service team can look at this API bug?
@ArcturusZhang Additionally, please check whether #10131 has already addressed that.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @slbsupportgithub.
any updates regarding this fix in new provider version/upstream API?
Hi @gek0 this issue should have been fixed. I am going to close this issue. Please feel free to reopen this or comment if you see this issue again.
Reopen per request
馃憢 any update here?
@tombuildsstuff Confirmed with service team, this has been fixed. I've created a PR terraform-providers/terraform-provider-azurerm#10263 for the linked TF issue.