0
votes

Not that long ago I have started using Azure to host some Ubuntu VM's. I have begun with a personal account with a free trial to poke around with it. After a month, my trial had run out of credits. I had to setup another account registered for a company (rather than individual). Therefore, now, I have to move all VM's from the old account to the new one.

I had tried a couple of things, but apparently Azure portal does not support it. So, I have ended up spinning a new virtual machine with Windows and PowerShell with a hope that I can download VHD files from the old account and then create actual storage disks from them. However, I am stuck on Save-AzureRmVhd command as it is just resulting in:

Save-AzureRmVhd : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:1
+ Save-AzureRmVhd -Source $sourceVHD -LocalFilePath $destinationVHD
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Save-AzureRmVhd], ParameterBindingException
    + FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.Azure.Commands.Compute.StorageServices.SaveAzureVhdCommand

It's pretty much my first time using PowerShell, but I think I have used the command correctly, following this: https://msdn.microsoft.com/en-us/library/mt622705.aspx.

The exact command I'm using (with paths specified as variables):

Save-AzureRmVhd -Source $sourceVHD -LocalFilePath $destinationVHD

tl;dr How to move VM's storage disks between Azure accounts when the source has a disabled subscription (ended free trial)?

1
If your source subscription is disabled, I don't see how you can access any of it. You might want to try opening a support/billing ticket (which is free to do), and see if you can re-enable your trial account for a few days. Then you can do a direct copy of your vhd blob from source to destination storage account.David Makogon
Also, can you update your question with the exact command you're executing?Gaurav Mantri
@GauravMantri UpdatedMaciej Szpakowski
Looking at the documentation, I believe you would either need to provide -ResourceGroupName parameter or -StorageKey parameter. I don't see that in your command.Gaurav Mantri

1 Answers

-1
votes

I managed to solve the problem myself.

First of all, a disk has to be detached from the VM to enable download option. Then there are two ways of doing this.

  1. Use azure portal: go into the storage account > choose desired vhds from the list > choose desired blob from the list > click Download button
  2. Use PowerShell: Save-AzureRmVhd -ResourceGroupName $resourceGroup -Source $sourceVHD -LocalFilePath $destinationVHD

Also from what I see It's impossible to download a blob from a read-only account (e.g. after free-trial expired). So it's essential to upgrade it to pay as you go for the time of download.

Thanks for help everyone!