IaaS Migration from Azure Service Manager to Azure Resource Manager

By introduction of the New Azure Portal, Azure deployment model also changed from Azure Service Manager to Azure Resource Manager. Because of this change we have to manage two types of IaaS VMs, Virtual Machine (classic) & Virtual Machine (ARM). If someone wants to move the classic VMs to ARM model, yes we can achieve it now.

Microsoft has introduce a tool called MigAz to accomplish this. Lets look at high level understanding about it. By using this tool it create a JSON ARM template based on the ASM resources and we can use that JSON template to deploy the same infrastructure in ASM.

For this demo I used a single IIS VM deployed as a ASM model and we can do same to any multi tier IaaS architectures too.

IIS running on ASM VM

First create a VM in classic model (ASM) and install IIS. Then I check the server is running.

2

Lets start the migration by installing migAz tool

Run the MigAz tool. we can get it from the GitHub. Run the migAz.exe.

3

Click the Sign In and add Azure credentials then select the subscription.

Next select the resources want to migrate and select output location for the JSON template.

Click Export objects to create the JSON files.

6

It export two JSON files as below.

copyblobdetail.json – Include the details of the storage account(s) eg:- Storage Key, Storage Account Name

</p>
<p>{<br />
  &quot;SourceSA&quot;: &quot;classicvm4797&quot;,<br />
  &quot;SourceContainer&quot;: &quot;vhds&quot;,<br />
  &quot;SourceBlob&quot;: &quot;classicvm-os-8235.vhd&quot;,<br />
  &quot;SourceKey&quot;: &quot;&lt;KEY&gt;&quot;,<br />
  &quot;DestinationSA&quot;: &quot;classicvm4797v2&quot;,<br />
  &quot;DestinationContainer&quot;: &quot;vhds&quot;,<br />
  &quot;DestinationBlob&quot;: &quot;classicvm-os-8235.vhd&quot;,<br />
  &quot;DestinationKey&quot;: &quot;&lt;KEY&gt;&quot;,<br />
  &quot;Status&quot;: &quot;&quot;,<br />
  &quot;TotalBytes&quot;: 0,<br />
  &quot;BytesCopied&quot;: 0,<br />
  &quot;StartTime&quot;: &quot;2016-11-13 15:21:53Z&quot;,<br />
  &quot;EndTime&quot;: &quot;&quot;,<br />
  &quot;SnapshotTime&quot;: &quot;11/13/2016 9:51:50 AM&quot;<br />
}</p>
<p>

export.json – It include the JSON template of the environment

8

9

Open PowerShell ISE and login to azure tenant, then select the subscription.

<br />
Login-AzureRmAccount<br />

10

Create a new  resource group in the subscription.

<br />
New-AzureRmResourceGroup -Name ASM-ARM-Mig -Location southeastasia<br />

11

Now lets use the export.json file to deploy the resources to RG we created previously

<br />
New-AzureRmResourceGroupDeployment -Name mig-asm -ResourceGroupName ASM-ARM-Mig -TemplateFile .\export.json -Verbose<br />

At some point at the deployment of the template you will get an error message as follows and fail the deployment. DON’T BE PANIC !!!!!

12

If you closely read the error message you will find it says DiskBlobNotFound  and give the blob URL, we get this because we export the VMs configuration and create the storage account  in ARM model but we didn’t copy the blobs to new storage account.

13

So lets copy the blobs from ASM storage account to ARM storage account.For this we can use  BlobCopy.ps1 PowerShell script comes with migAz.

<br />
.\BlobCopy.ps1 -ResourcegroupName ASM-ARM-Mig -DetailsFilePath C:\Users\localadmin\Desktop\migaz\copyblobdetails.json -StartType StartBlobCopy -Verbose<br />

14

Blob was copied

15

Now lets redeploy the export.json and it works perfectly.

16

ARM resource group shows relevant resources

18

Lets see the IIS still works as before, I enter the public IP of the ARM VM and it works.

19

17

Additional Resources 

Migrate Azure IaaS Solutions from ASM to ARM Using migAz, Part 1

Migrate Azure IaaS Solutions from ASM to ARM Using migAz, Part 2

, , , , ,

Post navigation