Hi @SafiyullahSA
Welcome to Microsoft Q&A, Thanks for asking question here...!
When dealing with VMs in an availability set in Azure, there are some limitations and considerations when trying to move VMs between resource groups.
Moving a VM to Another Resource Group Availability Set Constraints: A VM that is part of an availability set cannot be moved to another resource group independently of the availability set. The VM and the availability set must be moved together, or the VM must be removed from the availability set first.
Removing a VM from an Availability Set Standalone VM: To make a VM standalone (i.e., no longer part of an availability set), you would need to delete the VM while retaining its disks and then recreate the VM without specifying an availability set. However, this process involves downtime and reconfiguration.
Steps:
1.Delete the VM (retain the disks).
2.Create a new VM using the retained disks, without specifying an availability set.
Moving the Availability Set and VM Together Move Entire Availability Set: If you want to avoid reconfiguring the VM, you can move the entire availability set along with the VM to the new resource group.
Steps:
1.Go to the Azure portal.
2.Select the resource group containing the availability set and VM.
3 Choose the option to move resources.
4.Select both the availability set and the VM to move to the target resource group.
Using Azure Site Recovery (ASR): ASR for Resource Group Move: Using Azure Site Recovery (ASR) can be a viable solution for moving a VM between resource groups, but it comes with additional steps and considerations.
Steps:
1.Enable ASR: Set up ASR for the VM to replicate it to a different region or resource group. 2.Failover: Perform a failover to the target resource group.
3.Disable Replication: Once the VM is running in the target resource group, disable replication if no longer needed.
Summary
Remove VM from Availability Set: Involves deleting and recreating the VM without an availability set.
Move Availability Set and VM Together: Move the entire availability set with the VM to the new resource group.
Azure Site Recovery (ASR): Set up ASR, perform failover, and disable replication as a potential solution.
Each method has its pros and cons, including potential downtime and complexity. The choice depends on your specific requirements, including tolerance for downtime and the effort you're willing to invest in reconfiguration or setting up ASR.
Please let me know if anything required.