Azure VM: Adding a Reserved IP address to an existing VM

前端 未结 8 1657
情话喂你
情话喂你 2021-02-05 23:13

What I have read so far on the web is that there is no way to add a reserved IP to an existing VM (unless I recreate the VM which I am trying to avoid). However, I have noticed

相关标签:
8条回答
  • 2021-02-05 23:59

    For new VMs (with resource manager) you should do the following:

    Create new static IP address:

    $ip = New-AzureRmPublicIpAddress -Name "<ip-name>"  -ResourceGroupName <group-name> -Location eastus -AllocationMethod Static
    

    Get information about VM Network Interface:

    Get-AzureRmVM -ResourceGroupName <group-name> -Name <vm-name> | Select -ExpandProperty NetworkProfile
    

    Get corresponding network interface and set new ip and update NIC:

    $netInt = Get-AzureRmNetworkInterface -ResourceGroupName "group-name" -Name <nic-name>
    $netInt.IpConfigurations[0].PublicIpAddress = $ip
    Set-AzureRmNetworkInterface -NetworkInterface $netInt
    
    0 讨论(0)
  • 2021-02-06 00:01

    At this point, we don't support the capability to associate a Reserved IP to an already existing VM. We are currently working on the capability to reserve the IP of an existing VM.

    Ref: http://azure.microsoft.com/blog/2014/05/14/reserved-ip-addresses/ http://www.petri.com/how-to-reserve-public-virtual-ip-addresses-in-microsoft-azure.htm

    Girish Prajwal

    0 讨论(0)
提交回复
热议问题