Migrate classic Azure resources to new Azure resource manager

会有一股神秘感。 提交于 2019-12-12 02:51:53

问题


After switching to the new Azure portal, I see all resources of mine are listed as classic resources. I am googling around to see if it's possible to have classic VM and migrate it to ARM and just hadn't seen anything that stated it was possible.

I tried deleting the class VM but keep the VHD to check if I can attach it to the ARM VM. The result said it doesn't work.

Is there any way that can be used to achieve this ?


回答1:


Unfortunately (and strangely!) there isn't a way to do this via the portal and you have to drop down to Powershell instead (or xplat / Rest)

When I have exported VMs from v1 to v2 I typically make the original vhd file accessible via a blob share (this can be done temporarily for the duration of this command)

You can then deploy a new VM using that vhd as a source image's URI, using

Set-AzureRmVMOSDisk -VM $vm -Name $vmname -VhdUri $uri -CreateOption FromImage -Windows 

Alternatively you can copy the vhd to v2 storage and use Attach instead of FromImage

If you wrap that around a standard VM Create script, you should be good to go!




回答2:


There is a set of powershell scripts to assist in migrating classic vms to the new resource group model - asm-arm

They require the Azure and AzureRM powershell modules - msdn link to installation instructions



来源:https://stackoverflow.com/questions/36057736/migrate-classic-azure-resources-to-new-azure-resource-manager

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!