You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Prepare target Azure Local instance and logical network
11
+
12
+
On the target Azure Local instance, provision a static Azure Arc logical network to support the migration. This setup requires defining the following:
13
+
14
+
- IP address space
15
+
- Gateway address
16
+
- DNS servers
17
+
- an IP pool range (optional)
18
+
19
+
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).
20
+
21
+
Ensure that the static IP addresses you plan to migrate are available in the static logical network and not assigned to another VM. If an IP address is already in use, the migration fails with the error: **The address is already in use.** To avoid this:
22
+
23
+
1. Go to the target static logical network.
24
+
1. Check which IP addresses are in use.
25
+
1. Remove any NICs assigned to the static IPs you want to migrate.
26
+
27
+
:::image type="content" source="../migrate/media/migrate-maintain-ip-addresses/connected-devices.png" alt-text="Screenshot of Connected Devices page.":::
- Ensure the VMs are powered on throughout the replication process and up to planned failover (migration).
11
+
12
+
- For VMware VMs, ensure that **VMware Tools** are installed.
13
+
14
+
- 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).
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.
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 and Linux VMs.
16
16
17
17
## About the static IP migration package
18
18
19
-
Download the [Windows static IP migration package](https://aka.ms/hci-migrate-static-ip-download) (.zip format).
19
+
For Windows VMs, this article supports guest operating systems from Windows Server 2012 R2 and later. For Linux VMs, it supports Ubuntu, Red Hat Enterprise Linux, CentOS, and Debian distributions.
20
20
21
-
The .zip file includes the following scripts:
21
+
Download the [static IP migration package](https://aka.ms/hci-migrate-static-ip-download) (.zip format). The .zip file includes different scripts for Windows and Linux VMs.
22
+
23
+
# [Windows](#tab/windows)
24
+
25
+
The following scripts are included for Windows:
22
26
23
27
-**Prepare-MigratedVM.ps1** – Prepares the VM for static IP migration using the `-StaticIPMigration` cmdlet, which runs the *Initialize-StaticIPMigration.ps1* script.
24
28
@@ -28,88 +32,115 @@ The .zip file includes the following scripts:
28
32
29
33
-**Set-StaticIPConfiguration.ps1** - Runs at VM startup to apply the network interface configuration file generated.
30
34
31
-
-**Utilities.psm1** - Contains helper functions for the scripts.
35
+
-**Utilities.psm1** - This script contains helper functions for the scripts.
32
36
33
-
> [!NOTE]
34
-
> Static IP address migration is currently available only for Windows VMs, and is not supported for Linux VMs.
37
+
# [Linux](#tab/linux)
35
38
36
-
## Prerequisites
39
+
The following scripts are included for Linux:
37
40
38
-
Before you begin, prepare the source and target environments for IP migration.
41
+
-**prepare_migrated_vm.sh** – Prepares the VM for static IP migration using the `-o StaticIPMigration` option. It executes the *initialize_static_ip_migration.sh* script.
39
42
40
-
### Prepare source VMs for IP migration
43
+
-**initialize_static_ip_migration.sh** - Collects the VM's network interface information into a configuration file (*interface_configurations* in the local directory) and installs a cron job to execute the *set_static_ip_configuration.sh script*.
41
44
42
-
To migrate VMs with static IPs from the source system (Hyper-V or VMware), follow these steps:
45
+
-**set_static_ip_configuration.sh** - Runs at VM startup to apply the network interface configuration file generated.
43
46
44
-
1. Ensure the VMs are powered on throughout the replication process and up to planned failover (migration).
47
+
-**utilities.sh** – This script contains helper functions for the scripts.
45
48
46
-
1. For VMware VMs, ensure that **VMware Tools** are installed.
49
+
---
47
50
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).
51
+
## Prerequisites
49
52
50
-
1. For Linux VMs, ensure that **Linux Integration Services** are installed.
53
+
# [Windows](#tab/windows)
51
54
52
-
1. Ensure the preparation script is run on the source VM by an account with administrator privileges to create scheduled tasks.
55
+
Before you begin, prepare the source and target environments for IP migration.
53
56
54
-
### Prepare target Azure Local instance and logical network
57
+
### Prepare source VMs for IP migration
55
58
56
-
On the target Azure Local instance, 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.
59
+
To migrate Windows VMs with static IPs from the source system (Hyper-V or VMware), make sure the following requirements are met.
57
60
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).
Ensure that the static IP addresses you plan to migrate are available in the static logical network and not assigned to another VM. If an IP address is already in use, the migration will fail with the error: "The address is already in use." To avoid this, go to the target static logical network, check which IP addresses are in use, and remove any NICs assigned to the static IPs you want to migrate.
63
+
-Ensure the preparation script is run on the source VM by an account with administrator privileges to create scheduled tasks.
61
64
62
-
:::image type="content" source="./media/migrate-maintain-ip-addresses/connected-devices.png" alt-text="Screenshot of Connected Devices page." lightbox="./media/migrate-maintain-ip-addresses/connected-devices.png":::
### (Optional) Prepare to deploy IP migration at scale using group policy
65
68
66
-
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:
69
+
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:
67
70
68
71
- The source VMs must have internet access to download the static IP migration package directly to their local file system.
69
72
70
73
- 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.
71
74
72
-
## Set up IP migration manually
75
+
# [Linux](#tab/linux)
76
+
77
+
Before you begin, prepare the source and target environments for IP migration.
78
+
79
+
### Prepare source VMs for IP migration
80
+
81
+
To migrate Linux VMs with static IPs from the source system (Hyper-V or VMware), make sure the following requirements are met.
- For Linux VMs, ensure that **Linux Integration Services** are installed.
86
+
87
+
- Ensure the preparation script is run on the source VM by an account with administrator privileges to create scheduled tasks. For Linux VMs, the account should also have the appropriate privileges to run network administration commands (such as `ip`, `resolvectl`, and its variants).
Follow these steps to set up IP migration. The steps are different for Windows and Linux VMs.
96
+
97
+
# [Windows](#tab/windows)
98
+
99
+
For Windows VMs, you can set up IP migration manually or by using group policy.
100
+
101
+
### Set up IP migration manually
102
+
103
+
To set up IP migration manually for Windows VMs:
73
104
74
105
1. Download the .zip file and install the static IP migration package contents onto a local folder on the VM.
75
106
76
-
1. Open a PowerShell console and run the *Prepare-MigratedVM.ps1* script with the following command:
107
+
1. Open PowerShell as an administrator and run the *Prepare-MigratedVM.ps1* script with the following command:
77
108
78
109
```powershell
79
110
.\Prepare-MigratedVM.ps1 -StaticIPMigration
80
111
```
81
112
82
-
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).
113
+
1. In the 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).
83
114
84
115
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.
85
116
86
117
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.
87
118
88
119
:::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":::
89
120
90
-
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.
121
+
Failure to correctly assign the network interfaces to their corresponding logical networks results in incorrect IP address information displayed in Azure Local and Azure portal.
91
122
92
123
1. On the **Migrate** view, under **Shut down virtual machines**, select **Yes, shut down virtual machines (ensures no data loss)**.
93
124
94
125
:::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":::
95
126
96
127
1. After the VM is migrated, check the migrated VM to verify that the static IP settings were migrated over.
97
128
98
-
## Set up IP migration using group policy
129
+
### Set up IP migration using group policy
99
130
100
131
Follow these steps to set up static IP migration at scale on domain-joined VMs using group policy.
101
132
102
133
- Review the prerequisites listed for static IP migrations using group policy.
103
134
104
-
### Create a group policy object
135
+
#### Create a group policy object
105
136
106
137
1. Open the Group Policy Management Console for your Active Directory (AD) environment.
107
138
108
139
1. In your AD forest, navigate to the location that contains the VMs you want to migrate with preserved static IPs.
109
140
110
141
1. Right-click and select **Create a GPO on this domain, and Link it here**.
111
142
112
-
1. When prompted, assign a descriptive name to this GPO:
143
+
1. When prompted, assign a descriptive name to this Group Policy Object (GPO):
113
144
114
145
:::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":::
115
146
@@ -121,7 +152,7 @@ Follow these steps to set up static IP migration at scale on domain-joined VMs u
121
152
122
153
1. Right-click the blank area under **Scheduled Tasks** and select **New > Immediate Task (At least Windows 7)**.
123
154
124
-
### Define the scheduled task
155
+
#### Define the scheduled task
125
156
126
157
1. Select **New > Immediate Task**. When the Scheduled Task Wizard opens, configure each tab as follows:
127
158
@@ -133,7 +164,7 @@ Follow these steps to set up static IP migration at scale on domain-joined VMs u
133
164
134
165
1. Select **Run whether user is logged on or not**.
135
166
136
-
1. Select**Run with highest privileges**.
167
+
1. Select**Run with highest privileges**.
137
168
138
169
1. Under **Configure for**, select **Windows Vista or Windows Server 2008** for configuration:
139
170
@@ -164,11 +195,11 @@ Follow these steps to set up static IP migration at scale on domain-joined VMs u
164
195
165
196
1. Select **OK** to finalize the scheduled task configuration.
166
197
167
-
### Apply the group policy object
198
+
#### Apply the group policy object
168
199
169
200
1. Link the GPO to the desired Organizational Unit (OU):
170
201
171
-
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**.
202
+
1. If the GPO isn't already linked, right-click the desired OU in the Group Policy Management Console and select **Link an existing GPO**.
172
203
173
204
1. Select the GPO you created.
174
205
@@ -180,24 +211,66 @@ Follow these steps to set up static IP migration at scale on domain-joined VMs u
180
211
181
212
1. Ensure that a scheduled task named `Set-StaticIpConfiguration` has been created to run on restart.
182
213
214
+
# [Linux](#tab/linux)
215
+
216
+
For Linux VMs, follow these steps to set up IP migration manually.
217
+
218
+
### Set up IP migration manually
219
+
220
+
To set up IP migration manually for Linux VMs:
221
+
222
+
1. Download the .zip file and install the static IP migration package contents onto a local folder on the VM.
223
+
224
+
1. Open a terminal session and run the *prepare_migrated_vm.sh* script with the following commands:
1. In the 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).
232
+
233
+
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.
234
+
235
+
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.
236
+
237
+
:::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":::
238
+
239
+
Failure to correctly assign the network interfaces to their corresponding logical networks results in incorrect IP address information displayed in Azure Local and Azure portal.
240
+
241
+
1. On the **Migrate** view, under **Shut down virtual machines**, select **Yes, shut down virtual machines (ensures no data loss)**.
242
+
243
+
:::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":::
244
+
245
+
1. After the VM is migrated, check the migrated VM to verify that the static IP settings were migrated over.
246
+
247
+
---
248
+
183
249
## Known limitations
184
250
185
251
These are the known limitations and display issues when migrating static IP addresses:
186
252
187
253
### Old network adapter information in Device Manager
188
254
189
-
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.
255
+
After migration, Device Manager may still display the old network adapter information from pre-migration. While this doesn't affect the new network adapter created post-migration and won't cause IP conflicts, the script doesn't currently delete this old registration, so it remains visible.
190
256
191
257
### Multiple IP addresses on a single network adapter
192
258
193
-
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.
259
+
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, Azure Local VMs enabled by Azure Arc in Azure Local display only one IP address per network adapter in Azure Local portal. This is a known display issue in the Azure Local portal and does not affect the actual functionality of the IP addresses on the migrated VM.
194
260
195
261
### Multiple network adapters and types
196
262
197
-
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.
263
+
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 Azure Local 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 Azure Local 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.
198
264
199
265
:::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":::
200
266
267
+
### IPv6 static IP addresses not supported
268
+
269
+
Azure Local VMs currently only support IPv4 addresses. NICs configured with IPv6 addresses will not be migrated, as IPv6 is not supported.
270
+
271
+
## Logs
272
+
273
+
When configuring static IP migration for VMs using the *Prepare-MigratedVM.ps1* or *prepare_migrated_vm.sh* script, logs are automatically created in the script's directory.
0 commit comments