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

前端 未结 8 1614
情话喂你
情话喂你 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:37

    I read all of the previous entries and did not come away with a clear picture of how to proceed with assigning a reserved IP address to my existing Azure classic VM, so I opened a support ticket. I got excellent clear guidance from "Sruthi Saranya K", a support engineer in Azure Networking. Sruthi stated "in classic deployment model it is not possible to have a static public IP assigned to a VM", which I had read elsewhere, but she clarified that you simply assign the IP address to the cloud service and not the VM directly, then the VM will automatically pick up on the change. I outline all of the commands here for your convenience, starting from an Azure PowerShell prompt. The critical command was specified in the top response here, but not all of the steps. Also, that example also includes specifying the service, but it does not appear to be a supported parameter for that command, instead there is a second command to associate the IP with the service.

    add-azureaccount (to log in to Azure from PowerShell)
    New-AzureReservedIP -ReservedIPName "ipname" -Location "East US"
    get-azurereservedip (just to see what the reserved IP address is)
    Set-AzureReservedIPAssociation -ReservedIPName "ipname" -ServiceName "your cloud service name"

    Also, depending on the use, you may want to look up the IP address on mxtoolbox.com to make sure it is not already blacklisted. My reserved IP was for a web site, but the default @ DNS entry for the domain meant our domain was generally going to be associated with that IP address, and previously our mail has been blacklisted because our web server IP address was sullied by some other Azure tenant. If you get a blacklisted address, you can remove it and get a new one, also a suggestion from Sruthi. Here are the commands to remove the reserved IP, and to remove the cloud service association if needed:

    remove-azurereservedip
    Remove-AzureReservedIPAssociation

    My sincere thanks to Sruthi for making it so simple and preventing an unnecessary redeployment of our company's public web server.

    0 讨论(0)
  • 2021-02-05 23:37

    Add Public IP to an Existing VM

    1. Log into the portal
    2. Find the Resource Group (RG) where your VM is Located
    3. Confirm your VM has a network interface - if not, create one (it should have one)
    4. Create a Public IP Address (static or dynamic, doesn't matter) by adding one to your RG from the marketplace (do this first so it is creating while you make your NSG).
    5. Create a Network Service Group by adding one to your RG from the marketplace and associating it with your VM.
    6. Once the NSG has deployed, go back to the Overview of your PIP and click the "Associate" button in the info section of the blade.
    7. Select the Network Interface of your VM you validated in step 3. Get a cup of coffee or something, it will be a minute, but otherwise you're done.
    0 讨论(0)
  • 2021-02-05 23:43

    In order to assign existing reserved IP to an existing VM, you can use the following command:

    Set-AzureReservedIPAssociation -ReservedIPName MyReservedIP -ServiceName TestService
    
    0 讨论(0)
  • 2021-02-05 23:44
    New-AzureReservedIP -ReservedIPName "nameIP" -Location "East US" -ServiceName "azureA2vm"
    

    Get this:

    New-AzureReservedIP : A parameter cannot be found that matches parameter name 'ServiceName'.
    At line:1 char:70
    + New-AzureReservedIP -ReservedIPName "nameIP" -Location "East US" -ServiceNam ...
    +                                                                      ~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [New-AzureReservedIP], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.WindowsAzure.Commands.ServiceManagement.IaaS.NewAzureReservedIPCmdlet
    

    Check PowerShell version. Update to latest version.

    0 讨论(0)
  • 2021-02-05 23:50

    At Build 2015 they announced this is now possible and VERY easy. Simply open Azure powershell and run this:

    New-AzureReservedIP -ReservedIPName "ipname" -Location "West US" -ServiceName "somevm"
    

    If you run this it will reserve an IP named "ipname" and associate it with the already deployed instance "somevm.cloudapp.net"

    0 讨论(0)
  • 2021-02-05 23:56

    Step by step to create Reserved IP and using it on Azure VM. Here you can go

    Reserved IP Creation

    I have done the Elastic IP Automatic scheduling on AWS.Here is the reference link Elastic IP Automation on AWS script.

    Between needs to check about How can I write a script for automating the reserved IP for Azure.If you had done it earlier, Kindly share the script this will be very useful. Thanks.

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