Skip to content

Commit 725f9c0

Browse files
authored
Merge pull request #16564 from v-sissondan/ip-migration
Azure Migrate - maintain static IP addresses
2 parents b9bf437 + dea8c0a commit 725f9c0

File tree

9 files changed

+208
-5
lines changed

9 files changed

+208
-5
lines changed

azure-local/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ items:
590590
href: migrate/migrate-vmware-migrate.md
591591
- name: Enable guest management
592592
href: migrate/migrate-enable-guest-management.md
593+
- name: Maintain static IP addresses
594+
href: migrate/migrate-maintain-ip-addresses.md
593595
- name: FAQ
594596
href: migrate/migrate-faq.yml
595597
- name: Troubleshoot
113 KB
Loading
53 KB
Loading
205 KB
Loading
134 KB
Loading
30.6 KB
Loading
107 KB
Loading

azure-local/migrate/migrate-faq.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
author: alkohli
77
ms.author: alkohli
88
ms.service: azure-local
9-
ms.date: 12/10/2024
9+
ms.date: 01/23/2025
1010

1111
title: FAQ - Migration of Hyper-V and VMware VMs to Azure Local using Azure Migrate (preview)
1212

@@ -86,7 +86,7 @@ sections:
8686
8787
### My source VMs use static IP addresses. Are these addresses preserved when I migrate my VMs to Azure Local?
8888
89-
Currently both VMware and Hyper-V migrations only support VMs configured with DHCP. For a source VM with a static IP address, first migrate it to the target Azure Local system. After the migration, connect to the VM using Hyper-V Manager and manually change the IP configuration.
89+
In this release, static IP addresses can be preserved during migration for Windows VMs on VMware and Hyper-V. Linux VMs are not supported. For more details, see [Maintain static IP addresses](migrate-maintain-ip-addresses.md).
9090
9191
### I use DHCP reservation for IP addresses for my source VMs. Does migration ensure that the MAC address is preserved so that my migrated VM can get the same IP address?
9292
@@ -114,12 +114,12 @@ sections:
114114
115115
Within the Azure Migrate portal, you can select up to 10 machines at once for replication. To replicate more machines, add in batches of 10 (agentless migration overview).
116116
117-
Each Azure migrate appliance supports replication of 52 disks in parallel (scheduling logic).
117+
Each Azure Migrate appliance supports replication of 52 disks in parallel (scheduling logic).
118118
119-
For example, if you selected to replicate 100 VMs (in batches of 10), with each VM containing two disks each, resulting in 200 (100 x 2) disks in total. The Azure migrate appliance starts replicating 52 disks in parallel. As soon as one disk finishes initial replication, the next disk immediately takes its spot in the queue, while still continuously replicating the remaining 52 disks. This continues with all the remaining disks until all 200 disks have been replicated.
119+
For example, if you selected to replicate 100 VMs (in batches of 10), with each VM containing two disks each, resulting in 200 (100 x 2) disks in total. The Azure Migrate appliance starts replicating 52 disks in parallel. As soon as one disk finishes initial replication, the next disk immediately takes its spot in the queue, while still continuously replicating the remaining 52 disks. This continues with all the remaining disks until all 200 disks have been replicated.
120120
121121
## [Hyper-V VMs only](#tab/hyper-v-vms)
122122
123-
### I have a VM running on an older Hyper-V servers - for example, Windows Server 2012 or Windows Server 2008 R2. Can I migrate this VM to Azure Local?
123+
### I have a VM running on an older Hyper-V server - for example, Windows Server 2012 or Windows Server 2008 R2. Can I migrate this VM to Azure Local?
124124
125125
Yes. The migration solution discovers VMs on all the Windows Server hosts starting from Windows Server 2012 R2 and up to Windows Server 2022.
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
---
2+
title: Maintain static IP addresses during migration (preview)
3+
description: Learn how to maintain static IP addresses for VMs during migration.
4+
author: alkohli
5+
ms.topic: how-to
6+
ms.date: 01/23/2025
7+
ms.author: alkohli
8+
ms.reviewer: alkohli
9+
---
10+
11+
# Maintain static IP addresses during migration (preview)
12+
13+
[!INCLUDE [applies-to](../includes/hci-applies-to-23h2.md)]
14+
15+
This article explains how to preserve static IP addresses during virtual machine (VM) migration to Azure Local using Azure Migrate. It provides detailed instructions for running the static IP migration scripts on Windows VMs, and supporting guest operating systems from Windows Server 2012 R2 and later. This applies to both Hyper-V migration and VMware migration.
16+
17+
## About the static IP migration package
18+
19+
Download the [Windows static IP migration package](https://aka.ms/hci-migrate-static-ip-download) (.zip format).
20+
21+
The .zip file includes the following scripts:
22+
23+
- **Prepare-MigratedVM.ps1** – Prepares the VM for static IP migration using the `-StaticIPMigration` cmdlet, which runs the *Initialize-StaticIPMigration.ps1* script.
24+
25+
Logs are automatically created in the script's directory.
26+
27+
- **Initialize-StaticIPMigration.ps1** - Collects the VM network interface information into a configuration file (*InterfaceConfigurations.json* in the local directory) and sets up a scheduled task to run the *Set-StaticIPConfiguration.ps1* script.
28+
29+
- **Set-StaticIPConfiguration.ps1** - Runs at VM startup to apply the network interface configuration file generated.
30+
31+
- **Utilities.psm1** - Contains helper functions for the scripts.
32+
33+
> [!NOTE]
34+
> Static IP address migration is currently available only for Windows VMs, and is not supported for Linux VMs.
35+
36+
## Prerequisites
37+
38+
Before you begin, prepare the source and target environments for IP migration.
39+
40+
### Prepare source VMs for IP migration
41+
42+
To migrate VMs with static IPs from the source system (Hyper-V or VMware), follow these steps:
43+
44+
1. Ensure the VMs are powered on throughout the replication process and up to planned failover (migration).
45+
46+
1. For VMware VMs, ensure that **VMware Tools** are installed.
47+
48+
1. For Hyper-V VMs, ensure that **Hyper-V Integration Services** are installed. For more information, see [Manage Hyper-V Integration Services](/windows-server/virtualization/hyper-v/manage/manage-hyper-v-integration-services).
49+
50+
1. For Linux VMs, ensure that **Linux Integration Services** are installed.
51+
52+
1. Ensure the preparation script is run on the source VM by an account with administrator privileges to create scheduled tasks.
53+
54+
### Prepare target VMs for IP migration
55+
56+
On the target system, provision a static Azure Arc logical network to support the migration. This setup requires defining the IP address space, gateway address, DNS servers, and optionally an IP pool range.
57+
58+
For detailed guidance on creating and configuring static or dynamic Azure Arc logical networks, see [Create logical networks for Azure Local](../manage/create-logical-networks.md?tabs=azurecli).
59+
60+
### (Optional) Prepare to deploy IP migration at scale using group policy
61+
62+
To use this method, you need domain administrator privileges and access to the Group Policy Editor. Additionally, one of the following conditions must be met:
63+
64+
- The source VMs must have internet access to download the static IP migration package directly to their local file system.
65+
66+
- The source VMs must have read-only access to a remote file share hosting the static IP migration package, which must be prepared and downloaded to the remote share in advance.
67+
68+
## Set up IP migration manually
69+
70+
1. Download the .zip file and install the static IP migration package contents onto a local folder on the VM.
71+
72+
1. Open a PowerShell console and run the *Prepare-MigratedVM.ps1* script with the following command:
73+
74+
```powershell
75+
.\Prepare-MigratedVM.ps1 -StaticIPMigration 
76+
```
77+
78+
1. In Azure portal, create a migration project, trigger discovery, and replicate the VM. For more information, see [Create an Azure Migrate project](migration-options-overview.md).
79+
80+
1. Before you select the VMs to migrate, use the Replication Wizard to assign and configure the correct logical networks for each network interface on the source VM.
81+
82+
1. In the **Replications > General > Compute and Network** section, select **VM**. On this tab, ensure that the network interfaces are assigned to the correct logical network. DHCP network interfaces are assigned to dynamic logical networks, and static network interfaces are assigned to static logical networks.
83+
84+
:::image type="content" source="./media/migrate-maintain-ip-addresses/compute-network.png" alt-text="Screenshot of Compute and Network page." lightbox="./media/migrate-maintain-ip-addresses/compute-network.png":::
85+
86+
Failure to correctly assign the network interfaces to their corresponding logical networks results in incorrect IP address information displayed in Azure Arc and Azure portal.
87+
88+
1. On the **Migrate** view, under **Shut down virtual machines**, select **Yes, shut down virtual machines (ensures no data loss)**.
89+
90+
:::image type="content" source="./media/migrate-maintain-ip-addresses/shut-down-vms.png" alt-text="Screenshot of Shut down VMs panel." lightbox="./media/migrate-maintain-ip-addresses/shut-down-vms.png":::
91+
92+
1. After the VM is migrated, check the migrated VM to verify that the static IP settings were migrated over.
93+
94+
## Set up IP migration using group policy
95+
96+
Follow these steps to set up static IP migration at scale on domain-joined VMs using group policy.
97+
98+
- Review the prerequisites listed for static IP migrations using group policy.
99+
100+
### Create a group policy object
101+
102+
1. Open the Group Policy Management Console for your Active Directory (AD) environment.
103+
104+
1. In your AD forest, navigate to the location that contains the VMs you want to migrate with preserved static IPs.
105+
106+
1. Right-click and select **Create a GPO on this domain, and Link it here**.
107+
108+
1. When prompted, assign a descriptive name to this GPO:
109+
110+
:::image type="content" source="./media/migrate-maintain-ip-addresses/group-policy-management.png" alt-text="Screenshot of the GPO menu item." lightbox="././media/migrate-maintain-ip-addresses/group-policy-management.png":::
111+
112+
1. Edit the GPO:
113+
114+
1. Right-click the newly created GPO and select **Edit**.
115+
116+
1. In the Group Policy Management Editor, go to **Computer Configuration > Preferences > Control Panel Settings > Scheduled Tasks**.
117+
118+
1. Right-click the blank area under **Scheduled Tasks** and select **New > Immediate Task (At least Windows 7)**.
119+
120+
### Define the scheduled task
121+
122+
1. Select **New > Immediate Task**. When the Scheduled Task Wizard opens, configure each tab as follows:
123+
124+
1. On the **General** tab, under **Action**, select  **Create** and enter a descriptive name for the task.
125+
126+
1. Under **Security Options**, select the following settings:
127+
128+
1. When running the task, use the following user account **NT AUTHORITY\SYSTEM**.
129+
130+
1. Select **Run whether user is logged on or not**.
131+
132+
1. Select**Run with highest privileges**.
133+
134+
1. Under **Configure for**, select **Windows Vista or Windows Server 2008** for configuration:
135+
136+
:::image type="content" source="./media/migrate-maintain-ip-addresses/ip-migration-properties.png" alt-text="Screenshot of IP migration properties dialog box." lightbox="././media/migrate-maintain-ip-addresses/ip-migration-properties.png":::
137+
138+
1. On the **Actions** tab, select  **New** under the **Actions** tab.
139+
140+
1. Under **Action**, select **Start a program**.
141+
142+
1. Under **Settings**:
143+
144+
1. Run *Program/script: Type powershell.exe*.
145+
146+
1. If your VMs can access the download link for the .zip file, add the following arguments, replacing the parameters in brackets:
147+
148+
```azurepowershell
149+
-ExecutionPolicy Bypass -Command "Invoke-WebRequest -Uri [download link] -OutFile [path to static IP migration package] ; Expand-Archive Path [path to static IP migration package] -DestinationPath C:\StaticIp ; & C:\StaticIp\Prepare-MigratedVM.ps1 -StaticIPMigration
150+
``` 
151+
1. (Alternate) If you have a remote share hosting the .zip file, add the following arguments, replacing the parameters in brackets:
152+
153+
```azurepowershell
154+
-ExecutionPolicy Bypass -Command "Copy-Item -Path [ZIP file path in remote share] -Destination [path to static IP migration package] -Force ; Expand-Archive -Path [path to static IP migration package] DestinationPath C:\StaticIp ; & C:\StaticIp\Prepare-MigratedVM.ps1 -StaticIPMigration
155+
```
156+
157+
1. Select an **Action**, **Program/script**, add optional **arguments**, and optional **Start in** information as shown:
158+
159+
:::image type="content" source="./media/migrate-maintain-ip-addresses/start-program.png" alt-text="Screenshot of Action page." lightbox="./media/migrate-maintain-ip-addresses/start-program.png":::
160+
161+
1. Select **OK** to finalize the scheduled task configuration.
162+
163+
### Apply the group policy object
164+
165+
1. Link the GPO to the desired Organizational Unit (OU):
166+
167+
1. If the GPO is not already linked, right-click the desired OU in the Group Policy Management Console and select **Link an existing GPO**.
168+
169+
1. Select the GPO you created.
170+
171+
1. Wait for replication to complete. After 10-20 minutes, the group policy object replicates to the respective domain controllers. You can also force the policy update by running the `gpupdate` cmdlet in PowerShell on a specific VM.
172+
173+
1. Verify the changes:
174+
175+
1. Check the VM to confirm that an interface configuration file has been created under *C:\StaticIp\IpConfigurations.json*.
176+
177+
1. Ensure that a scheduled task named `Set-StaticIpConfiguration` has been created to run on restart.
178+
179+
## Known limitations
180+
181+
These are the known limitations and display issues when migrating static IP addresses:
182+
183+
### Old network adapter information in Device Manager
184+
185+
After migration, Device Manager may still display the old network adapter information from pre-migration. While this does not affect the new network adapter created post-migration and will not cause IP conflicts, the script doesn't currently delete this old registration, so it remains visible.
186+
187+
### Multiple IP addresses on a single network adapter
188+
189+
When the source VM has multiple static IP addresses assigned to a single network adapter, those IP addresses are correctly assigned on the migrated VM. However, Arc VMs in Azure Local will display only one IP address per network adapter in Arc portal. This is a known display issue in the Arc portal and does not affect the actual functionality of the IP addresses on the migrated VM.
190+
191+
### Multiple network adapters and types
192+
193+
If the source VM has multiple network adapters with a mix of DHCP and static configurations, the migrated VM will preserve the correct number of network adapter, network adapter types, and static IP addresses on the static network adapter. However, the Arc portal view of the migrated VM may incorrectly display duplicate or inaccurate IPs on the network adapters. This is a known display issue in the Arc portal and doesn't impact the functionality of the IP addresses on the migrated VM. See the example below of a migrated VM with a DHCP network adapter and a static network adapter.
194+
195+
:::image type="content" source="./media/migrate-maintain-ip-addresses/display-issue.png" alt-text="Screenshot of network adapters." lightbox="./media/migrate-maintain-ip-addresses/display-issue.png":::
196+
197+
198+
## Next steps
199+
200+
- Read [Overview of Azure Migrate based migration for Azure Local](migration-azure-migrate-overview.md).
201+
- Read [Overview of Azure Migrate based VMware migration for Azure Local](migration-azure-migrate-vmware-overview.md)

0 commit comments

Comments
 (0)