无法在Azure中创建具有多个NIC的VM

时间:2017-01-02 11:53:29

标签: azure networking cloud openstack azure-virtual-machine

我正在尝试在Azure(用于OpenStack实验)中构建一个实现this网络架构的OpenStack云。

我已经使用Azure CLI构建了所有内容并使其正常运行,但在添加第二个NIC时收到以下错误。

error:   Deployment provisioning state was not successful
error:   Subnet default referenced by resource /subscriptions/<subscriptionid>/resourceGroups/openstack/providers/Microsoft.Network/networkInterfaces/controller-prov-nic/ipConfigurations/ipconfig2 is not in the same Virtual Network as the subnets of other VMs in the availability set.

网络不是我的力量。为什么我不能有两个网络连接到他们自己的VNET?任何人都可以建议如何最好地在上面的OpenStack链接中实现拓扑?

您可以下载整个项目here。该项目连续构建每种资源类型。这样可以更轻松地处理每个模板文件。

注意:

  1. 您需要在VM目录中的template.json中编辑一行 添加您自己的公共SSH密钥。
  2. 构建整个堆栈(使用bash 和Azure CLI)只需在顶级目录中运行./build-all.sh。 (假设您在本地存储了Azure凭据。如果没有 删除build-all.sh中的-n开关。)
  3. 我的项目只是以上面列出的OpenStack模式构建到Controller节点。
  4. 由于

    拜伦

1 个答案:

答案 0 :(得分:0)

解决了我自己的问题.... 我没有意识到您可以在单个VNET中设置多个子网,然后将每个NIC连接到每个子网。以下是解决问题的JSON:

    "resources": [
    {
        "comments": "VNet definition for OpenStack Network Layout.",
        "type": "Microsoft.Network/virtualNetworks",
        "name": "[parameters('virtualNetworks_os_vnet_name')]",
        "apiVersion": "2016-03-30",
        "location": "[parameters('location')]",
        "properties": {
            "addressSpace": {
                "addressPrefixes": [
                    "10.0.0.0/16",
                    "203.0.113.0/24"
                ]
            },
            "subnets": [
                {
                    "name": "Management-Network",
                    "properties": {
                        "addressPrefix": "10.0.0.0/16"
                    }
                },
                {
                    "name": "Provider-Network",
                    "properties": {
                        "addressPrefix": "203.0.113.0/24"
                    }
                }
            ]
        },
        "resources": [],
        "dependsOn": []
    }

然后NIC定义变为:

"resources": [
    {
        "comments": "Controller NIC for Management Network",
        "type": "Microsoft.Network/networkInterfaces",
        "name": "[parameters('networkInterfaces_controller_mgt_nic_name')]",
        "apiVersion": "2016-03-30",
        "location": "[parameters('location')]",
        "properties": {
            "ipConfigurations": [
                {
                    "name": "ipconfig1",
                    "properties": {
                        "privateIPAddress": "10.0.0.11",
                        "privateIPAllocationMethod": "Static",
                        "publicIPAddress": {
                            "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_pub_ip_mgt_ctrlr_name'))]"
                        },
                        "subnet": {
                            "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_os_vnet_name')), '/subnets/Management-Network')]"
                        }
                    }
                }
            ],
            "dnsSettings": {
                "dnsServers": []
            },
            "enableIPForwarding": false,
            "networkSecurityGroup": {
                "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_management_nsg_name'))]"
            }
        },
        "resources": [],
        "dependsOn": []
    },
    {
        "comments": "Controller NIC for Provider Network",
        "type": "Microsoft.Network/networkInterfaces",
        "name": "[parameters('networkInterfaces_controller_prov_nic_name')]",
        "apiVersion": "2016-03-30",
        "location": "[parameters('location')]",
        "properties": {
            "ipConfigurations": [
                {
                    "name": "ipconfig2",
                    "properties": {
                        "privateIPAddress": "203.0.113.4",
                        "privateIPAllocationMethod": "Dynamic",
                        // "publicIPAddress": {
                        //     "id": "[resourceId('Microsoft.Network/publicIPAddresses', parameters('publicIPAddresses_pub_ip_prov_ctrlr_name'))]"
                        // },
                        "subnet": {
                            "id": "[concat(resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_os_vnet_name')), '/subnets/Provider-Network')]"
                        }
                    }
                }
            ],
            "dnsSettings": {
                "dnsServers": []
            },
            "enableIPForwarding": false,
            "networkSecurityGroup": {
                "id": "[resourceId('Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroups_provider_nsg_name'))]"
            }
        },
        "resources": [],
        "dependsOn": []
     }
  ]
相关问题