Search code examples
azurevnet

Azure v-net in failed state after re-deploying ARM script


I previously used this script: https://github.com/AdamBJ/SAP-HANA-ARM to spin up two Azure VMs. I wanted to use the script to spin up two more VMs, so I changed the VM names that were hard-coded into the script and tried running it again. However, the second time the script failed to deploy with the following error message:

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.","details":[{"code":"Conflict","message":"{\r\n \"status\": \"Failed\",\r\n \"error\": {\r\n \"code\": \"ResourceDeploymentFailure\",\r\n \"message\": \"The resource operation completed with terminal provisioning state 'Failed'.\",\r\n \"details\": [\r\n {\r\n \"code\": \"VirtualNetworkServiceEndpointUpdateTimedOut\",\r\n \"message\": \"Configuration of ServiceEndpoints for subnets sapdatasubnet, sapmgmtsubnet of virtual network /subscriptions/e7bf4de8-4b3c-439b-b8de-f81609dd73e9/resourceGroups/HanaWestUS2Rscgrp/providers/Microsoft.Network/virtualNetworks/ra-sap-hana-vnet did not complete in 1209 seconds. The configuration did not get applied to the following IPs of the subnet sapdatasubnet: 10.0.5.10, 10.0.5.16, 10.0.5.13; sapmgmtsubnet: 10.0.6.9. These subnets are in Failed state now. Try updating the virtual network or individual subnets again (with the same or different ServiceEndpoints value) to return subnets to Succeeded state. You can also try stopping/deallocating or removing VMs that use these IPs and re-applying the configuration again.\",\r\n \"details\": []\r\n }\r\n ]\r\n }\r\n}"}]}

This is the important part (I think):

Configuration of ServiceEndpoints for subnets sapdatasubnet, sapmgmtsubnet of virtual network /subscriptions/e7bf4de8-4b3c-439b-b8de-f81609dd73e9/resourceGroups/HanaWestUS2Rscgrp/providers/Microsoft.Network/virtualNetworks/ra-sap-hana-vnet did not complete in 1209 seconds. The configuration did not get applied to the following IPs of the subnet sapdatasubnet: 10.0.5.10, 10.0.5.16, 10.0.5.13; sapmgmtsubnet: 10.0.6.9. These subnets are in Failed state now. Try updating the virtual network or individual subnets again (with the same or different ServiceEndpoints value) to return subnets to Succeeded state. You can also try stopping/deallocating or removing VMs that use these IPs and re-applying the configuration again

I guess a networking conflict was created when I tried to run the script a second time, and now my primary vnet is in a "failed state". The vnet seems fine in that I can still connect to the two original VMs, but I can't create any new VMs belonging to my vnet or change the "Service Endpoints" while it's in a failed state. Does anyone know how I can get my vent out of the failed state?


Solution

  • The ARM script knocked out the custom DNS settings I had for the vnet. Re-establishing the custom settings force a redeployment of the vnet that fixed the failed state issue.