none
Unknown Network Allocation Error when deploying VM RRS feed

  • Question

  • I am getting the error “Unknown Network Allocation Error”. This is a repeatable error when deploying VMs through an ARM template to only this subscription (i.e. the ARM template works just fine in other environments). Error details below:

    3:19:38 PM - Resource Microsoft.Compute/virtualMachines 'xxx-tst04' failed with message '{
      "status": "Failed",
      "error": {
        "code": "ResourceDeploymentFailure",
        "message": "The resource operation completed with terminal provisioning state 'Failed'.",
        "details": [
          {
            "code": "NetworkingInternalOperationError",
            "message": "Unknown network allocation error."
          }
        ]
      }
    }' 

    The resources (NIC and VM) do finish deployment. However, the NIC shows as being unattached from the VM:

    However, the VM resource shows that it is indeed associated with that NIC:

     

    The VM is of course in a failed state.

    Anyone seen this error before?


    Tuesday, November 28, 2017 10:26 PM

Answers

  • Resolved: There was an underlying Network Resource Provider (NRP) bug. After a support case was opened, a hotfix has been applied by the PG team.

    Wednesday, December 6, 2017 2:47 PM

All replies

  • I haven’t come across an error of that sort before. Could you share the ARM template you’re using?

    Also, could you elaborate on this statement since it indicates that the template does work fine in some cases : “This is a repeatable error when deploying VMs through an ARM template to only this subscription (i.e. the ARM template works just fine in other environments).”

    -----------------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.


    Wednesday, November 29, 2017 7:21 AM
  • Sure, here is the ARM template.

    {
      "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
      "contentVersion": "1.0.0.0",
      "parameters": {
        "adminPassword": {
          "type": "SecureString",
          "metadata": {
            "description": "Admin password for VM"
          }
        },
        "numberOfInstances": {
          "defaultValue": 1,
          "type": "Int",
          "metadata": {
            "description": "Number of VMs to deploy"
          }
        }
      },
      "variables": {
        "vnetID": "[resourceId('RG-Networking', 'Microsoft.Network/virtualNetworks','vnetnamehere')]",
        "subnet1Ref": "[concat(variables('vnetID'),'/subnets/subnetnamehere')]"
      },
      "resources": [
        {
          "type": "Microsoft.Network/networkInterfaces",
          "name": "[concat('','xxx-test-c', padLeft(copyindex(10),2,'0'), '-nic1')]",
          "apiVersion": "2017-03-01",
          "location": "South Central US",
          "copy": {
            "name": "nicLoop",
            "count": "[parameters('numberOfInstances')]"
          },
          "tags": {
            "CreationDate": "11-29-2017",
            "Project": "ProjectNameHere",
            "Owner": "IT"
          },
          "properties": {
            "ipConfigurations": [
              {
                "properties": {
                  "privateIPAllocationMethod": "Dynamic",
                  "subnet": {
                    "id": "[variables('subnet1Ref')]"
                  }
                },
                "name": "ipcon"
              }
            ]
          }
        },
        {
          "type": "Microsoft.Compute/virtualMachines",
          "name": "[concat('xxx-test-c', padLeft(copyindex(10),2,'0'))]",
          "apiVersion": "2017-03-30",
          "location": "South Central US",
          "copy": {
            "name": "virtualMachineLoop",
            "count": "[parameters('numberOfInstances')]"
          },
          "tags": {
            "CreationDate": "11-29-2017",
            "Project": "ProjectNameHere",
            "Owner": "IT"
          },
          "properties": {
            "storageProfile": {
              "imageReference": {
                "publisher": "RedHat",
                "version": "latest",
                "offer": "RHEL",
                "sku": "7-RAW"
              },
              "osDisk": {
                "createOption": "FromImage",
                "name": "[concat('VD-','xxx-test-c', padLeft(copyindex(10),2,'0'), '-OS-Disk')]",
                "managedDisk": {
                  "storageAccountType": "Premium_LRS"
                },
                "caching": "ReadWrite"
              }
            },
            "networkProfile": {
              "networkInterfaces": [
                {
                  "id": "[resourceId('Microsoft.Network/networkInterfaces',concat('','xxx-test-c', padLeft(copyindex(10),2,'0'), '-nic1'))]",
                  "properties": {
                    "primary": true
                  }
                }
              ]
            },
            "osProfile": {
              "adminPassword": "[parameters('adminPassword')]",
              "computerName": "[concat('xxx-test-c', padLeft(copyindex(10),2,'0'))]",
              "adminUsername": "usernamehere"
            },
            "hardwareProfile": {
              "vmSize": "Standard_DS12_v2"
            }
          },
          "dependsOn": [
            "[concat('Microsoft.Network/networkInterfaces/', '', 'xxx-test-c', padLeft(copyindex(10),2,'0'), '-nic1')]"
          ]
        }
      ],
      "outputs": {
        "xxx-test-c10-nic1": {
          "type": "Object",
          "value": "[reference('Microsoft.Network/networkInterfaces/xxx-test-c10-nic1', '2015-06-15')]"
        },
        "xxx-test-c10": {
          "type": "Object",
          "value": "[reference('Microsoft.Compute/virtualMachines/xxx-test-c10' , '2015-06-15')]"
        }
      }
    }

    Note that this exact ARM template with the exact same parameters works just fine when deployed through Visual Studio (which uses a PowerShell script in the background anyway to actually deploy the template). However, this template fails when using a custom PowerShell script that leverages the cmdlet New-AzureRmResourceGroupDeployment.

    The only difference that I see between the Visual Studio deployment and the custom PowerShell script deployment is the name of the ARM template deployment... which of course shouldn't have any effect.

    Very strange error.

    Wednesday, November 29, 2017 3:41 PM
  • Strange, indeed. What version of Azure PowerShell module are you using to invoke this template from?

    -----------------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Thursday, November 30, 2017 10:01 AM
  • Resolved: There was an underlying Network Resource Provider (NRP) bug. After a support case was opened, a hotfix has been applied by the PG team.

    Wednesday, December 6, 2017 2:47 PM
  • Glad that this is resolved. I’m curious to know what really went on. Could you share the support ticket number?

    -----------------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Thursday, December 7, 2017 5:42 AM
  • SR number 117112817232956
    Monday, March 5, 2018 11:23 PM
  • Thanks for sharing the ticket number.

    -----------------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" on the post that helps you, this can be beneficial to other community members.

    Tuesday, March 6, 2018 10:38 AM