Skip to content

Commit 456ded9

Browse files
authored
Merge pull request #234270 from divargas-msft/patch-7
[Doc-a-thon] Updating migration-classic-resource-manager-cli.md
2 parents 2d762b0 + 073626b commit 456ded9

File tree

1 file changed

+33
-29
lines changed

1 file changed

+33
-29
lines changed

articles/virtual-machines/migration-classic-resource-manager-cli.md

Lines changed: 33 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: virtual-machines
77
ms.subservice: classic-to-arm-migration
88
ms.workload: infrastructure-services
99
ms.topic: how-to
10-
ms.date: 01/23/2023
10+
ms.date: 04/12/2023
1111
ms.author: oriwolman
1212
ms.custom: devx-track-azurecli compute-evergreen, devx-track-arm-template
1313
---
@@ -23,15 +23,16 @@ These steps show you how to use CLI commands to migrate infrastructure as a serv
2323

2424
> [!NOTE]
2525
> 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+
>
2828
2929
<br>
3030
Here is a flowchart to identify the order in which steps need to be executed during a migration process
3131

3232
![Screenshot that shows the migration steps](./media/migration-classic-resource-manager/migration-flow.png)
3333

3434
## Step 1: Prepare for migration
35+
3536
Here are a few best practices that we recommend as you evaluate migrating IaaS resources from classic to Resource Manager:
3637

3738
* 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
4142
> 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.
4243
>
4344
>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+
>
4647
4748
## Step 2: Set your subscription and register the provider
4849
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).
4950

5051
Sign-in to your account.
5152

52-
```azurecli
53+
```azurecli-interactive
5354
azure login
5455
```
5556

5657
Select the Azure subscription by using the following command.
5758

58-
```azurecli
59+
```azurecli-interactive
5960
azure account set "<azure-subscription-name>"
6061
```
6162

@@ -68,98 +69,100 @@ azure account set "<azure-subscription-name>"
6869
6970
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.
7071

71-
```azurecli
72+
```azurecli-interactive
7273
azure provider register Microsoft.ClassicInfrastructureMigrate
7374
```
7475

7576
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.
7677

77-
```azurecli
78+
```azurecli-interactive
7879
azure provider show Microsoft.ClassicInfrastructureMigrate
7980
```
8081

8182
Now switch CLI to the `asm` mode.
8283

83-
```azurecli
84+
```azurecli-interactive
8485
azure config mode asm
8586
```
8687

8788
## Step 3: Make sure you have enough Azure Resource Manager Virtual Machine vCPUs in the Azure region of your current deployment or VNET
8889
For this step you'll need to switch to `arm` mode. Do this with the following command.
8990

90-
```azurecli
91+
```azurecli-interactive
9192
azure config mode arm
9293
```
9394

9495
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).
9596

96-
```azurecli
97+
```azurecli-interactive
9798
azure vm list-usage -l "<Your VNET or Deployment's Azure region"
9899
```
99100

100101
Once you're done verifying this step, you can switch back to `asm` mode.
101102

102-
```azurecli
103+
```azurecli-interactive
103104
azure config mode asm
104105
```
105106

106107
## Step 4: Option 1 - Migrate virtual machines in a cloud service
108+
107109
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.
108110

109-
```azurecli
111+
```azurecli-interactive
110112
azure service list
111113
```
112114

113115
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.
114116

115-
```azurecli
117+
```azurecli-interactive
116118
azure service show <serviceName> -vv
117119
```
118120

119121
First, validate if you can migrate the cloud service using the following commands:
120122

121-
```shell
123+
```azurecli-interactive
122124
azure service deployment validate-migration <serviceName> <deploymentName> new "" "" ""
123125
```
124126

125127
Prepare the virtual machines in the cloud service for migration. You have two options to choose from.
126128

127129
If you want to migrate the VMs to a platform-created virtual network, use the following command.
128130

129-
```azurecli
131+
```azurecli-interactive
130132
azure service deployment prepare-migration <serviceName> <deploymentName> new "" "" ""
131133
```
132134

133135
If you want to migrate to an existing virtual network in the Resource Manager deployment model, use the following command.
134136

135-
```azurecli
137+
```azurecli-interactive
136138
azure service deployment prepare-migration <serviceName> <deploymentName> existing <destinationVNETResourceGroupName> <subnetName> <vnetName>
137139
```
138140

139141
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.
140142

141-
```azurecli
143+
```azurecli-interactive
142144
azure vm show <vmName> -vv
143145
```
144146

145147
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.
146148

147-
```azurecli
149+
```azurecli-interactive
148150
azure service deployment abort-migration <serviceName> <deploymentName>
149151
```
150152

151153
If the prepared configuration looks good, you can move forward and commit the resources by using the following command.
152154

153-
```azurecli
155+
```azurecli-interactive
154156
azure service deployment commit-migration <serviceName> <deploymentName>
155157
```
156158

157159
## Step 4: Option 2 - Migrate virtual machines in a virtual network
160+
158161
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.
159162

160163
Get all the virtual networks in the subscription by using the following command.
161164

162-
```azurecli
165+
```azurecli-interactive
163166
azure network vnet list
164167
```
165168

@@ -171,46 +174,47 @@ In the above example, the **virtualNetworkName** is the entire name **"Group cla
171174

172175
First, validate if you can migrate the virtual network using the following command:
173176

174-
```shell
177+
```azurecli-interactive
175178
azure network vnet validate-migration <virtualNetworkName>
176179
```
177180

178181
Prepare the virtual network of your choice for migration by using the following command.
179182

180-
```azurecli
183+
```azurecli-interactive
181184
azure network vnet prepare-migration <virtualNetworkName>
182185
```
183186

184187
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.
185188

186-
```azurecli
189+
```azurecli-interactive
187190
azure network vnet abort-migration <virtualNetworkName>
188191
```
189192

190193
If the prepared configuration looks good, you can move forward and commit the resources by using the following command.
191194

192-
```azurecli
195+
```azurecli-interactive
193196
azure network vnet commit-migration <virtualNetworkName>
194197
```
195198

196199
## Step 5: Migrate a storage account
200+
197201
Once you're done migrating the virtual machines, we recommend you migrate the storage account.
198202

199203
Prepare the storage account for migration by using the following command
200204

201-
```azurecli
205+
```azurecli-interactive
202206
azure storage account prepare-migration <storageAccountName>
203207
```
204208

205209
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.
206210

207-
```azurecli
211+
```azurecli-interactive
208212
azure storage account abort-migration <storageAccountName>
209213
```
210214

211215
If the prepared configuration looks good, you can move forward and commit the resources by using the following command.
212216

213-
```azurecli
217+
```azurecli-interactive
214218
azure storage account commit-migration <storageAccountName>
215219
```
216220

0 commit comments

Comments
 (0)