|
| 1 | +--- |
| 2 | +title: Migrating from NIC to IP-based backend pools |
| 3 | +titleSuffix: Azure Load Balancer |
| 4 | +description: This article covers migrating a load balancer from NIC-based backend pools to IP-based backend pools for virtual machines and virtual machine scale sets. |
| 5 | +services: load-balancer |
| 6 | +author: mbender-ms |
| 7 | +ms.author: mbender |
| 8 | +ms.service: load-balancer |
| 9 | +ms.topic: how-to |
| 10 | +ms.date: 09/22/2022 |
| 11 | +ms.custom: template-how-to |
| 12 | +--- |
| 13 | + |
| 14 | +# Migrating from NIC to IP-based backend pools |
| 15 | + |
| 16 | +In this article, you'll learn how to migrate a load balancer with NIC-based backend pools to use IP-based backend pools with virtual machines and virtual machine scale sets |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F). |
| 21 | +- An existing standard Load Balancer in the subscription, with NIC-based backend pools. |
| 22 | + |
| 23 | +## What is IP-based Load Balancer |
| 24 | + |
| 25 | +IP-based load balancers reference the private IP address of the resource in the backend pool rather than the resource’s NIC. IP-based load balancers enable the pre-allocation of private IP addresses in a backend pool, without having to create the backend resources themselves in advance. |
| 26 | + |
| 27 | +## Migrating NIC-based virtual machine backend pools too IP-based |
| 28 | + |
| 29 | +To migrate a load balancer with NIC-based backend pools to IP-based with VMs (not virtual machine scale sets instances) in the backend pool, you can utilize the following migration REST API. |
| 30 | + |
| 31 | +```http |
| 32 | +
|
| 33 | +POST URL: https://management.azure.com/subscriptions/{sub}/resourceGroups/{rg}/providers/Microsoft.Network/loadBalancers/{lbName}/migrateToIpBased?api-version=2022-01-01 |
| 34 | +
|
| 35 | +``` |
| 36 | +### URI Parameters |
| 37 | + |
| 38 | +| Name | In | Required | Type | Description | |
| 39 | +|---- | ---- | ---- | ---- | ---- | |
| 40 | +|Sub | Path | True | String | The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. | |
| 41 | +| Rg | Path | True | String | The name of the resource group. | |
| 42 | +| LbName | Path | True | String | The name of the load balancer. | |
| 43 | +| api-version | Query | True | String | Client API Version | |
| 44 | + |
| 45 | +### Request Body |
| 46 | + |
| 47 | +| Name | Type | Description | |
| 48 | +| ---- | ---- | ---- | |
| 49 | +| Backend Pools | String | A list of backend pools to migrate. Note if request body is specified, all backend pools will be migrated. | |
| 50 | + |
| 51 | +A full example using the CLI to migrate all backend pools in a load balancer is shown here: |
| 52 | + |
| 53 | +```azurecli-interactive |
| 54 | +
|
| 55 | +az rest –m post –u “https://management.azure.com/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup/providers/Microsoft.Network/loadBalancers/MyLB/migrateToIpBased?api-version=2022-01-01” |
| 56 | +
|
| 57 | +``` |
| 58 | + |
| 59 | + |
| 60 | +A full example using the CLI to migrate a set of specific backend pool in a load balancer is shown below. To migrate a specific group of backend pools from NIC-based to IP-based, you can pass in a list of the backend pool names in the request body: |
| 61 | + |
| 62 | +```azurecli-interactive |
| 63 | +
|
| 64 | +az rest –m post –u “https://management.azure.com/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup/providers/Microsoft.Network/loadBalancers/MyLB/migrateToIpBased?api-version=2022-01-01” |
| 65 | +
|
| 66 | +-b {\"Pools\":[\"MyBackendPool\"]} |
| 67 | +``` |
| 68 | +## Upgrading LB with virtual machine scale sets attached |
| 69 | + |
| 70 | +To upgrade a NIC-based load balancer to IP based load balancer with virtual machine scale sets in the backend pool, follow the following steps: |
| 71 | +1. Configure the upgrade policy of the virtual machine scale sets to be automatic. If the upgrade policy isn't set to automatic, all virtual machine scale sets instances must be upgraded after calling the migration API. |
| 72 | +1. Using the Azure’s migration REST API, upgrade the NIC based LB to an IP based LB. If a manual upgrade policy is in place, upgrade all VMs in the virtual machine scale sets before step 3. |
| 73 | +1. Remove the reference of the load balancer from the network profile of the virtual machine scale sets, and update the VM instances to reflect the changes. |
| 74 | + |
| 75 | +A full example using the CLI is shown here: |
| 76 | + |
| 77 | +```azurecli-interactive |
| 78 | +
|
| 79 | +az rest –m post –u “https://management.azure.com/subscriptions/MySubscriptionId/resourceGroups/MyResourceGroup/providers/Microsoft.Network/loadBalancers/MyLB/migrateToIpBased?api-version=2022-01-01” |
| 80 | +
|
| 81 | +az virtual machine scale sets update --resource-group MyResourceGroup --name MyVMSS --remove virtualMachineProfile.networkProfile.networkInterfaceConfigurations[0].ipConfigurations[0].loadBalancerBackendAddressPools |
| 82 | +
|
| 83 | +``` |
| 84 | + |
| 85 | +## Next Steps |
0 commit comments