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
@@ -23,15 +23,16 @@ These steps show you how to use CLI commands to migrate infrastructure as a serv
23
23
24
24
> [!NOTE]
25
25
> All the operations described here are idempotent. If you have a problem other than an unsupported feature or a configuration error, we recommend that you retry the prepare, abort, or commit operation. The platform will then try the action again.
26
-
>
27
-
>
26
+
>
27
+
>
28
28
29
29
<br>
30
30
Here is a flowchart to identify the order in which steps need to be executed during a migration process
31
31
32
32

33
33
34
34
## Step 1: Prepare for migration
35
+
35
36
Here are a few best practices that we recommend as you evaluate migrating IaaS resources from classic to Resource Manager:
36
37
37
38
* Read through the [list of unsupported configurations or features](migration-classic-resource-manager-overview.md). If you have virtual machines that use unsupported configurations or features, we recommend that you wait for the feature/configuration support to be announced. Alternatively, you can remove that feature or move out of that configuration to enable migration if it suits your needs.
@@ -41,21 +42,21 @@ Here are a few best practices that we recommend as you evaluate migrating IaaS r
41
42
> Application Gateways are not currently supported for migration from classic to Resource Manager. To migrate a classic virtual network with an Application gateway, remove the gateway before running a Prepare operation to move the network. After you complete the migration, reconnect the gateway in Azure Resource Manager.
42
43
>
43
44
>ExpressRoute gateways connecting to ExpressRoute circuits in another subscription cannot be migrated automatically. In such cases, remove the ExpressRoute gateway, migrate the virtual network and recreate the gateway. Please see [Migrate ExpressRoute circuits and associated virtual networks from the classic to the Resource Manager deployment model](../expressroute/expressroute-migration-classic-resource-manager.md) for more information.
44
-
>
45
-
>
45
+
>
46
+
>
46
47
47
48
## Step 2: Set your subscription and register the provider
48
49
For migration scenarios, you need to set up your environment for both classic and Resource Manager. [Install the Azure classic CLI](/cli/azure/install-classic-cli) and [select your subscription](/cli/azure/authenticate-azure-cli).
49
50
50
51
Sign-in to your account.
51
52
52
-
```azurecli
53
+
```azurecli-interactive
53
54
azure login
54
55
```
55
56
56
57
Select the Azure subscription by using the following command.
57
58
58
-
```azurecli
59
+
```azurecli-interactive
59
60
azure account set "<azure-subscription-name>"
60
61
```
61
62
@@ -68,98 +69,100 @@ azure account set "<azure-subscription-name>"
68
69
69
70
Register with the migration resource provider by using the following command. Note that in some cases, this command times out. However, the registration will be successful.
Please wait five minutes for the registration to finish. You can check the status of the approval by using the following command. Make sure that RegistrationState is `Registered` before you proceed.
76
77
77
-
```azurecli
78
+
```azurecli-interactive
78
79
azure provider show Microsoft.ClassicInfrastructureMigrate
79
80
```
80
81
81
82
Now switch CLI to the `asm` mode.
82
83
83
-
```azurecli
84
+
```azurecli-interactive
84
85
azure config mode asm
85
86
```
86
87
87
88
## Step 3: Make sure you have enough Azure Resource Manager Virtual Machine vCPUs in the Azure region of your current deployment or VNET
88
89
For this step you'll need to switch to `arm` mode. Do this with the following command.
89
90
90
-
```azurecli
91
+
```azurecli-interactive
91
92
azure config mode arm
92
93
```
93
94
94
95
You can use the following CLI command to check the current number of vCPUs you have in Azure Resource Manager. To learn more about vCPU quotas, see [Limits and the Azure Resource Manager](../azure-resource-manager/management/azure-subscription-service-limits.md#managing-limits).
95
96
96
-
```azurecli
97
+
```azurecli-interactive
97
98
azure vm list-usage -l "<Your VNET or Deployment's Azure region"
98
99
```
99
100
100
101
Once you're done verifying this step, you can switch back to `asm` mode.
101
102
102
-
```azurecli
103
+
```azurecli-interactive
103
104
azure config mode asm
104
105
```
105
106
106
107
## Step 4: Option 1 - Migrate virtual machines in a cloud service
108
+
107
109
Get the list of cloud services by using the following command, and then pick the cloud service that you want to migrate. Note that if the VMs in the cloud service are in a virtual network or if they have web/worker roles, you will get an error message.
108
110
109
-
```azurecli
111
+
```azurecli-interactive
110
112
azure service list
111
113
```
112
114
113
115
Run the following command to get the deployment name for the cloud service from the verbose output. In most cases, the deployment name is the same as the cloud service name.
114
116
115
-
```azurecli
117
+
```azurecli-interactive
116
118
azure service show <serviceName> -vv
117
119
```
118
120
119
121
First, validate if you can migrate the cloud service using the following commands:
120
122
121
-
```shell
123
+
```azurecli-interactive
122
124
azure service deployment validate-migration <serviceName> <deploymentName> new "" "" ""
123
125
```
124
126
125
127
Prepare the virtual machines in the cloud service for migration. You have two options to choose from.
126
128
127
129
If you want to migrate the VMs to a platform-created virtual network, use the following command.
128
130
129
-
```azurecli
131
+
```azurecli-interactive
130
132
azure service deployment prepare-migration <serviceName> <deploymentName> new "" "" ""
131
133
```
132
134
133
135
If you want to migrate to an existing virtual network in the Resource Manager deployment model, use the following command.
134
136
135
-
```azurecli
137
+
```azurecli-interactive
136
138
azure service deployment prepare-migration <serviceName> <deploymentName> existing <destinationVNETResourceGroupName> <subnetName> <vnetName>
137
139
```
138
140
139
141
After the prepare operation is successful, you can look through the verbose output to get the migration state of the VMs and ensure that they are in the `Prepared` state.
140
142
141
-
```azurecli
143
+
```azurecli-interactive
142
144
azure vm show <vmName> -vv
143
145
```
144
146
145
147
Check the configuration for the prepared resources by using either CLI or the Azure portal. If you are not ready for migration and you want to go back to the old state, use the following command.
146
148
147
-
```azurecli
149
+
```azurecli-interactive
148
150
azure service deployment abort-migration <serviceName> <deploymentName>
149
151
```
150
152
151
153
If the prepared configuration looks good, you can move forward and commit the resources by using the following command.
152
154
153
-
```azurecli
155
+
```azurecli-interactive
154
156
azure service deployment commit-migration <serviceName> <deploymentName>
155
157
```
156
158
157
159
## Step 4: Option 2 - Migrate virtual machines in a virtual network
160
+
158
161
Pick the virtual network that you want to migrate. Note that if the virtual network contains web/worker roles or VMs with unsupported configurations, you will get a validation error message.
159
162
160
163
Get all the virtual networks in the subscription by using the following command.
161
164
162
-
```azurecli
165
+
```azurecli-interactive
163
166
azure network vnet list
164
167
```
165
168
@@ -171,46 +174,47 @@ In the above example, the **virtualNetworkName** is the entire name **"Group cla
171
174
172
175
First, validate if you can migrate the virtual network using the following command:
Check the configuration for the prepared virtual machines by using either CLI or the Azure portal. If you are not ready for migration and you want to go back to the old state, use the following command.
Check the configuration for the prepared storage account by using either CLI or the Azure portal. If you are not ready for migration and you want to go back to the old state, use the following command.
0 commit comments