Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/azurerm: Fixing a bug in azurerm_network_interface #14365

Merged
merged 4 commits into from
May 11, 2017
Merged

Conversation

tombuildsstuff
Copy link
Contributor

When using this Terraform configuration, which creates multiple NIC's in different Subnets within the same Virtual Network using either Terraform 0.9.4 / the master branch this returns an error:

Error applying plan:

2 error(s) occurred:

* azurerm_network_interface.test2: 1 error(s) occurred:

* azurerm_network_interface.test2: network.InterfacesClient#CreateOrUpdate: Failure responding to request: StatusCode=429 -- Original Error: autorest/azure: Service returned an error. Status=429 Code="RetryableError" Message="A retryable error occured." Details=[{"code":"ReferencedResourceNotProvisioned","message":"Cannot proceed with operation because resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tharvey-dev7986/providers/Microsoft.Network/virtualNetworks/tharveydev7986nw/subnets/tharveydev7986sn1 used by resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tharvey-dev7986/providers/Microsoft.Network/networkInterfaces/tharveydev7986ni2 is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is PutSubnetOperation."}]
* azurerm_network_interface.test1: 1 error(s) occurred:

* azurerm_network_interface.test1: network.InterfacesClient#CreateOrUpdate: Failure responding to request: StatusCode=429 -- Original Error: autorest/azure: Service returned an error. Status=429 Code="RetryableError" Message="A retryable error occured." Details=[{"code":"ReferencedResourceNotProvisioned","message":"Cannot proceed with operation because resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tharvey-dev7986/providers/Microsoft.Network/virtualNetworks/tharveydev7986nw/subnets/tharveydev7986sn1 used by resource /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/tharvey-dev7986/providers/Microsoft.Network/networkInterfaces/tharveydev7986ni1 is not in Succeeded state. Resource is in Updating state and the last operation that updated/is updating the resource is PutSubnetOperation."}]

When provisioning using the changes in this PR, which ensures we only modify one subnet/virtual network at a time - this gets provisioned as expected:

Apply complete! Resources: 11 added, 0 changed, 0 destroyed.

Fixes #7986

@tombuildsstuff
Copy link
Contributor Author

Ran the entire test suite - the tests pass (ignoring some unrelated/intermittent failures):

screen shot 2017-05-10 at 22 09 10

Copy link
Contributor

@paddycarver paddycarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a minor nitpick, but this looks fine to me. Let's wait for @stack72 to weigh in, though, before merging this.

@@ -373,9 +396,10 @@ func validateNetworkInterfacePrivateIpAddressAllocation(v interface{}, k string)
return
}

func expandAzureRmNetworkInterfaceIpConfigurations(d *schema.ResourceData) ([]network.InterfaceIPConfiguration, error) {
func expandAzureRmNetworkInterfaceIpConfigurations(d *schema.ResourceData) ([]network.InterfaceIPConfiguration, *[]string, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return a pointer to a slice? A slice is basically a pointer already, so I don't really see the benefit.

@stack72 stack72 merged commit b3a02b0 into master May 11, 2017
@stack72 stack72 deleted the fix-7986 branch May 11, 2017 08:39
@ghost
Copy link

ghost commented Apr 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Status=429 Code="RetryableError" Message="A retryable error occured."
3 participants