Azure VNET Migration from Classic to Resource Manager

Recently I was consulting for an Mining company who had a number of resources in Azure classic portal that they needed to migrate to Resource Manager portal. During the migration although I was following the Microsoft provided guidelines, I noticed that there were lots of important information missing which should form the steps of migration. So I decided to make this post to help out others..

Below are a list of procedure to Migrate Azure VM’s that are part of a VNET, from classic to resource manager.

Ensure that you are an Administrator or co-administrator on the Subscription of Azure Portal. When you are made an admin or co-admin in the Portal, you become admin on the subscription across the board, since the subscription is tied to both of the portal. Think of the portal as your management front plane.

The procedures are taken from the link from Microsoft, however i have divided it up a little bit better for understanding purpose. Here is the Microsoft Link

First you need to log in to both portal and select the subscription and VNET that you wanting to Migrate.
To Log in to ARM Portal, supply below command

Login-AzureRmAccount

If you need to view all the available subscription you have, supply below command but you can view it from portal anyway,

Get-AzureRMSubscription | Sort Name | Select Name

Now Select the Subscription that where the VNET resides that you want to migrate,
Select-AzureRmSubscription –SubscriptionName "My Azure Subscription"

Now Register with the migration provider, supply below command

“Register-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastructureMigrate”

you may receive error message that reads, AzureRMResource provider is not a valid name or command, something along those lines…

That means, your azure powershell needs RM modules, you can download and install RM modules from this link

https://www.powershellgallery.com/items
or
LINK to download ARM Modules

You need to install, compute, network, Resource modules. Once the modules are installed, Try registering for the migration resource provider again. Migration resource provider registration can take up to 5 minutes, it will come back with Registered.

To check if you are registered you can supply below command

Get-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastructureMigrate

Now log in to the Azure classic model, by supplying below code

Add-AzureAccount

If you know the subscription where your VNET resides then choose it, otherwise get available subscription by supplying below command

Get-AzureSubscription | Sort SubscriptionName | Select SubscriptionName

Now select the subscription by supplying below command

Select-AzureSubscription –SubscriptionName “your Azure Subscription”

In my case, all my Virtual Machines are in a VNET, so I will be performing a VNET migration, please note, VNET migration doesn’t require any downtime as it is just a delta copy to the management plane.

First Select your VNET Name, supply below command

$vnetName = “myVnet”

Now Validate if you can move the VNET by supplying below command

Move-AzureVirtualNetwork -Validate -VirtualNetworkName $vnetName

In my case, I got error validation failed, but it didn’t show why the validation failed, so i changed the validation command with below, which shows the reasons for the error in a predefined location so you can examine the error.

I did a little digging around and found this link

Supply the below command & Press enter
$a = Move-AzureVirtualNetwork -Validate -VirtualNetworkName $vnetName
and now supply the below command & press enter again
$a.ValidationMessages > c:\temp\export.txt (the location is your preferred location and the txt file name is your prefered txt file name)

Error message

VM in HostedService nmlinffsproxy contains Extension BGInfo version 1.* which is an XML extension. XML extensions are not supported in Azure Resource
Manager. It is recommended to uninstall it from the VM. Alternatively, it will be automatically uninstalled during migration.

FIX
To mitigate the above error message, go to Azure ARM portal and find the VM, then click on the VM, then click on extension on the right hand side, then remove the bginfo extension as shown below

Error message

VM NML in HostedService nmlinfsproxy is currently configured with the Azure Backup service and therefore currently not supported for Migration. To migrate
this VM, please follow the procedure described athttps://aka.ms/vmbackupmigration.

Fix
To fix the above error message, open the Classic portal, then go to recovery services, then go inside the recovery services item and select on protected item tab on top as shown below and click stop protection.

After this, you also have to go to the ARM portal and find the VM and remove the VMSNAPSHOT extension from the extension section.

Error

VM NMLA in Cloud Service nmlidfsproxy has Microsoft.Azure.Security.Monitoring extension installed which is currently unsupported for migration. This could be
due to a security center security policy configured for this subscription or VM. Please turn off the security center policy and remove this extension before attempting
migration. To learn how to turn off the security center policy, visit

Fix

To fix the above issue, you have to open the VM in ARM portal and remove azure.security extension from the VM just the previous way from the extension section.

After fixing all the above error and warning message, please rerun validation again,
This time validation should pass.
Once validation passed you should run the prepare command as shown below

Move-AzureVirtualNetwork -Prepare -VirtualNetworkName $vnetName

If validation command passes successfully then prepare command will also pass successfully.

Now run the commit command to commit the move of the vnet by using the below command

Move-AzureVirtualNetwork -Commit -VirtualNetworkName $vnetName

Now, I have noticed that when you run the commit command, you may receive an error message saying commit was failed but a lot of the time it’s a false fail. The way to check it is , if you open ARM portal and search for one of the classic VM you will see there are 2 VM entity one is stamped as (classic) and one is stamped as ARM. This means commit is successful. But if you don’t see 2 VM example then you should abort the commit by using the below command

Move-AzureVirtualNetwork -Abort -VirtualNetworkName $vnetName

And then you should call Microsoft support.

My next post talks about a list of cloud services migration command that is used for moving cloud services from ASM to ARM

5 Responses to Azure VNET Migration from Classic to Resource Manager

  1. […] to Resource manager portal. This is the migration path & step by step process that I followed My previous post that explains the step by step process  Mircosoft link that has some steps […]

  2. […] to Resource manager portal. This is the migration path & step by step process that I followed My previous post that explains the step by step process  Mircosoft link that has some steps […]

  3. […] to Resource manager portal. This is the migration path & step by step process that I followed My previous post that explains the step by step process  Mircosoft link that has some steps […]

  4. […] to Resource manager portal. This is the migration path & step by step process that I followed My previous post that explains the step by step process  Mircosoft link that has some steps […]

  5. […] to Resource manager portal. This is the migration path & step by step process that I followed My previous post that explains the step by step process  Mircosoft link that has some steps […]

Leave a Reply

Your email address will not be published. Required fields are marked *