如何在配置Azure VM(资源管理器)时保留IP [英] How to reserve IP when provisioning Azure VM (resource manager)

查看:191
本文介绍了如何在配置Azure VM(资源管理器)时保留IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过Ubuntu命令行配置新的Azure VM(资源管理器)。我按照此处列出的步骤执行此操作: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-tutorial/

I'm provisioning a new Azure VM (resource manager) via Ubuntu command line. I'm following the steps outlined here to do so: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-tutorial/

我的问题是:在配置新VM时,如何在命令行上执行以确保其具有静态IP (保留IP)?

My question is: while provisioning a new VM, what do I do on the command line to ensure it has a static IP (reserved IP)?

使用Azure PowerShell通过 New-AzureReservedIP -ReservedIPName $ reservedIP可以完成同样的事情 - 位置$ location

The same thing can be accomplished using Azure PowerShell via New-AzureReservedIP -ReservedIPName $reservedIP -Location $location

推荐答案

您需要将公共IP地址定义为资源组的一部分然后将其分配给正确的虚拟NIC(网络接口卡)。

You need to define a public IP address as part of your Resource Groupm then assign it to the correct Virtual NIC (Network Interface Card).

公共IP地址资源类型表示公共互联网上的DNS名称。它可用于为Azure负载均衡器上托管的虚拟IP地址(VIP)或直接托管在VM上的公共实例IP地址(PIP)提供DNS名称。

A public IP Address resource type represents a DNS name on the public internet. It may be used to provide a DNS name to either a virtual IP address (VIP) hosted on an Azure Load Balancer or a public instance IP address (PIP) hosted directly on a VM.

使用Azure CLI,您需要编写如下内容:

With the Azure CLI, you need to write something like this:

azure network public-ip create -g MyResourceGroup -a Dynamic -l northeurope MyPublicIP

然后,您将IP分配给VM的虚拟NIC。 VM和NIC都属于同一资源组:

Then you would assign your IP to the Virtual NIC of the VM. Both the VM and the NIC are part of the same resource group:

azure network nic set -g MyResourceGroup -p MyPublicIP MyNicName

您可以使用azure network nic list来获取NIC的名称。

You can use "azure network nic list" to get the name of the NIC.

似乎目前仅支持动态公共IP直接在VM上使用(在ARM模式下)。目前,静态IP只能分配给Load Balancer配置。尝试使用-a Static在执行azure network nic set时吐出错误:

It also seems that currently only Dynamic Public IPs are supported for being used directly on VMs (in ARM mode). Right now, static IPs can only be assigned to Load Balancer configurations. Trying to use "-a Static" spits out an error when doing "azure network nic set":


网络接口
xxx
引用公共IP地址
yyy
,并将AllocationMethod属性设置为Static。目前不支持此
配置。网络接口只能使用
动态公共IP。

Network interface xxx references public IP address yyy with AllocationMethod property set to Static. Currently this configuration is not supported. Network interfaces can use only dynamic public IPs.

我还想了解何时支持此功能。

I would also like to find out when this will be supported.

编辑:这是一个很好的Azure CLI参考。您也可以使用-h来获取命令用法帮助。

edit: here is a good Azure CLI reference. You can also use -h to get command usage help.

这篇关于如何在配置Azure VM(资源管理器)时保留IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆