Migrating (or using) old VHD on a Classic Storage Account to be used with new (non-Classic) VM

僤鯓⒐⒋嵵緔 提交于 2019-12-11 07:58:26

问题


I find the storage options confusing so far. It seems like I can have a disk as a VHD (stored as a "Page Blob") on a Storage Account (Classic or New) or I can create a "Disk" directly. I'm not sure what the benefits of each option are.

My problem is that I had an old Classic VM that had a data disk stored as a VHD (page blob) on a Classic Storage Account. I created a new VM now (not classic) and I want to attach that same VHD, but I don't see any way to do so. If I click create new data "Disk" then I have an option to copy a snapshot but I cannot see any snapshots from my old Classic Storage Account, I am able to see snapshots from my new Storage Accounts though, so I thought I need to migrate.

I found this answer on SO which suggests that it's possible to migrate using Powershell, by following instructions on this page.

Based on those instructions, I executed the following commands:

Connect-AzureRmAccount
Select-AzureRmSubscription –SubscriptionName "Visual Studio Premium with MSDN"  
Register-AzureRmResourceProvider -ProviderNamespace Microsoft.ClassicInfrastructureMigrate // wait 5 minutes till it registers
Add-AzureAccount
Select-AzureSubscription –SubscriptionName "Visual Studio Premium with MSDN"
$storageAccountName = "<Name of Classic Storage Account>"
Move-AzureStorageAccount -Validate -StorageAccountName $storageAccountName // validation passes
Move-AzureStorageAccount -Prepare -StorageAccountName $storageAccountName // throws an an exception:

Move-AzureStorageAccount : InternalError : The server encountered an internal error. Please retry the request.
At line:1 char:5
+     Move-AzureStorageAccount -Prepare -StorageAccountName $storageAcc ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Move-AzureStorageAccount], ComputeCloudException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.StorageServices.MoveStorageAccountComm
   and

So, how should I proceed? My goal is to get my old VHD with my data working with the new VM. Ideally, I'd like to migrate it to the new model (whichever it is).

来源:https://stackoverflow.com/questions/52240150/migrating-or-using-old-vhd-on-a-classic-storage-account-to-be-used-with-new-n

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