Hello @Muniraj Devaraj
To migrate a large number of virtual machines (VMs) using automated scripts, you can use Azure Site Recovery. Site Recovery scripts are available for download at the Azure PowerShell Samples repo on GitHub.
The scripts can be used to migrate VMware, AWS, GCP VMs, and physical servers to managed disks in Azure. You can also use these scripts to migrate Hyper-V VMs if you migrate the VMs as physical servers.
To get started, you need to complete the following prerequisites:
- Ensure that the Site Recovery vault is created in your Azure subscription.
- Ensure that the Configuration Server and Process Server are installed in the source environment and the vault can discover the environment.
- Ensure that a Replication Policy is created and associated with the Configuration Server. - Ensure that you have added the VM admin account to the config server (that will be used to replicate the on premises VMs).
- Ensure that the following target artifacts in Azure are created:
- Target Resource Group
- Cache Storage Account (and its Resource Group)
- Create a standard storage account in the same region as the vault
- Target Virtual Network for failover (and its Resource Group)
- Target Subnet
- Target Virtual Network for Test failover (and its Resource Group)
- Availability Set (if needed)
- Target Network Security Group and its Resource Group
Once you have completed all the prerequisites, you need to create a CSV file that has data of each source VM that you want to migrate. All the scripts are designed to work on the same CSV file. A sample CSV template is available in the scripts folder for your reference. Once the CSV is ready, you can execute the following steps to perform migration of the on-premises VMs:
-
asr_startmigration.ps1
: Enable replications for all the VMs listed in the csv, the script creates a CSV output with the job details for each VM -
asr_replicationstatus.ps1
: Check the status of replication, the script creates a csv with the status for each VM -
asr_updateproperties.ps1
: Once the VMs are replicated/protected, use this script to update the target properties of the VM (Compute and Network properties) -
asr_propertiescheck.ps1
: Verify if the properties are appropriately updated -
asr_testmigration.ps1
: Start the test failover of the VMs listed in the csv, the script creates a CSV output.
I hope that this response has addressed your query and helped you overcome your challenges. If so, please mark this response as Answered. This will not only acknowledge our efforts but also assist other community members who may be looking for similar solutions.