question

Jaganljpmail-3347 avatar image
0 Votes"
Jaganljpmail-3347 asked kobulloc-MSFT answered

Move virtual Machines to a new Subscription Within the same Tenant

Hello,

We have existing VM's in a Subscription, created another Subscription within the same Tenant and want to move Virtual machines and its resources to the New Subscription created. Tried using Azure Resource mover to move VM resources to the New Subscription Resource group in validation fails pointing to the Nics of the VMs and fails to go to next step.

let us know if this is a known issue with moving VM resources to a New Subscription within the same Tenant.

Thanks,

azure-virtual-machinesazure-resource-mover
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
1 Vote"
AndreasBaumgarten answered Jaganljpmail-3347 commented

Hi @Jaganljpmail-3347 ,

moving a VM with NIC should be possible to move between subscriptions.
Is the NIC linked to a Public IP?
There is a limitation with moving Public IPs between subscriptions:
- Public IPs with Basic SKU could be moved between subscriptions
- Public IPs with Standard SKU can't be moved between subscriptions

Here you can find details which resource types supporting the move operation: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/move-support-resources


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @AndreasBaumgarten,

No the Nic linked to a private IP

Thanks,

0 Votes 0 ·
Jaganljpmail-3347 avatar image
0 Votes"
Jaganljpmail-3347 answered Jaganljpmail-3347 commented


Hello @AndreasBaumgarten,

No the Nic linked to a private IP,

Thanks,

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @Jaganljpmail-3347 ,

do you have a detailed error message?

We have moved a couple of VMs without any issues between subscriptions.


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

0 Votes 0 ·

Hi @AndreasBaumgarten,

Below is raw Error and attached are snippets using Azure Resource mover.


Raw Error:133950-01.png

{


"code": "MissingMoveDependentResources",
"target": "Microsoft.Network/networkInterfaces",
"message": "The move resources request does not contain all the dependent resources. Please check details for missing resource Ids.",
"details": [
{
"code": "0",
"message": "/subscriptions/resourcegroups/resourcegroup name/providers/Microsoft.Network/virtualnetworks/ -vNet"
" message": "/subscriptions/resourcegroups/resourcegroup name/providers/Microsoft.Network/networksecuritygroups/ -nsg"
" message": "/subscriptions/resourcegroups/resourcegroup name/providers/Microsoft.Network/routetables/ -rt"
"message": "/subscriptions/resourcegroups/resourcegroup name/providers/Microsoft.Network/NetworkInterface/ -nic"


0 Votes 0 ·
01.png (22.2 KiB)
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered Jaganljpmail-3347 commented

Hi @Jaganljpmail-3347 ,

it looks like you are not moving the vNet together with your VM?

Than there is no option to move the VM with the Azure Resource Mover this way.

But there is an option:

  • Delete the VM (VM only! Not the disk!)

  • Move the disk to the other subscription

  • Create a new VM in the other subscription using the existing (moved) disk


Second option: You can use Azure Site Recovery to "move" the VM between the subscriptions.
https://azure.microsoft.com/en-us/blog/cross-subscription-dr/


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @ AndreasBaumgarten,

Using Azure Resource Mover, once to select source/target subscription/RG's it does show you vNet to add the resource. It only lists the resouces i.e (vm,nic,osdisk) ones shown in the Snip earlier.

Other option you recommended is delete VM only not the disk, doing this will loose anything done by User profile linked to this VM? will all the softwares installed in it be intact?


IFor Second option I believe we are not licensed to do that, just to see the options I did go to Source and target where in target Subscription , it would not list the RGs created under that subscription.

Is there a commandline or powershell approach for this? I really wish this process flow is much clear





0 Votes 0 ·
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered Jaganljpmail-3347 commented

Hi @Jaganljpmail-3347 ,

if you delete the VM and not the disk everything is stored on the disk. If you move the disk to another subscription the content of the disk will be the same. You won't loose any content of the disk when disk is moved from subscription A to B.

Regarding Azure Site Recovery maybe this will help: https://docs.microsoft.com/en-us/azure/site-recovery/azure-to-azure-common-questions#how-do-i-get-started-with-azure-vm-disaster-recovery


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AndreasBaumgarten,

I am trying to be more granular with the steps deleting vm and assigning os disk to new VM created.

Delete original VM object and leave other objects in place i.e nic, os disk
Create VM, may use original vm name or can we change it?
Within the Disk section add existing OS disk from original VM
From Network select the target network and subnet

Please let me if I am missing any other steps or if you have more details on this.

Thanks,

0 Votes 0 ·
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered AndreasBaumgarten edited

Hi @Jaganljpmail-3347 ,

  • Delete original VM object and leave other objects in place i.e nic, os disk

  • Move disk to the other subscription

  • In Azure Portal navigate to the disk (in the new subscription) and select Create VM

  • Create VM, may use original vm name or can we change it? - use the original name

  • From Network select the target network and subnet

You can try this first if you are not sure how and if this will work:

  • Create a new small VM just for testing

  • Follow the steps and verify if everything is working as expected

  • Delete the test VM

Before moving the "productive VM" -> Backup VM!


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten





5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

kobulloc-MSFT avatar image
0 Votes"
kobulloc-MSFT answered

Adding options for anyone else who may be looking to move VMs to a new subscription:

135019-image.png



image.png (267.2 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.