SQL Server with Mr. Denny

Dec 10 2018   4:00PM GMT

Moving VMs in Azure with Managed Disks Between Resource Groups

Denny Cherry Denny Cherry Profile: Denny Cherry

Tags:

Azure is a great platform to use, and the new Managed Disks are fantastic as you just need to set it and forget it.  However, if you run into the problem Cloudflare being the cloudthat I can recently with moving the VM from one resource group to another, you’ll run into a stumbling block pretty fast.  I hit this because I put a VM in the wrong resource group, then the customer installed a bunch of software of the VM, then I went to move it to another resource group.  That’s when I got the lovely error that said “Operation ‘move’ is not supported on Resource ‘MyVM’ with managed disks. (Code: BadRequest)”.

This error was a bit of a problem as I didn’t want to blow away the VM.  I had to turn on a couple of Azure features in PowerShell (eventually you won’t have to do this, maybe you don’t have to do this already) and I was able to move the VM without issue.  After running the following commands (and using Get-AzureRmProviderFeature to wait for the feature to be registered), the move worked.

Register-AzureRmProviderFeature -FeatureName ManagedResourcesMove -ProviderNamespace Microsoft.Compute

Register-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute

At this point, I was able to move the VM and all it’s resources to the correct resource group using either PowerShell or the Azure Portal (I assume CLI worked as well, but I didn’t need to do more testing).

Denny

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: