Discover and replicate Hyper-V VMs for migration to Azure Stack HCI using Azure Migrate (preview)
Applies to: Azure Stack HCI, version 23H2
This article describes the discovery and replication phase for Hyper-V virtual machine (VM) migration to Azure Stack HCI using Azure Migrate.
Important
This feature is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.
For more information on appliances for Azure Migrate and how to manage them, see Azure Migrate appliance.
Before you begin
For both the source and target appliance, make sure that your hardware has sufficient resource to support the creation of a Windows Server 2022 VM with 16 GB RAM, 80 GB of disk storage, 8 vCPUs, and an external virtual switch.
Step 1: Create and configure the source appliance
Generate the project key
In this step, you generate the key for the source appliance - see Generate the project key for specific steps.
Create the source appliance
You can install the appliance using either a template (.VHD file) or a script (.zip file) that you download to your Hyper-V server. For more information on appliances for Azure Migrate and how to manage them, see Azure Migrate appliance.
Install using a template (.VHD file)
This step applies only if you are deploying the source appliance using a .VHD file template. The source appliance is installed for you using the .VHD file. For step-by-step information, see Download the VHD.
Install using a script (.zip file)
This step applies only if you downloaded the .zip file. You use the AzureMigrateInstaller.ps1 PowerShell script to install the source appliance. For specific information, see Set up an appliance with a script.
Configure the appliance and discover VMs
Once the source appliance is installed, you are ready to Configure the appliance.
After the appliance is configured, you start the VM discovery process.
Wait until you have a green checkmark indicating discovery is finished, then go to the Azure portal to review VM inventory.
Step 2: Create and configure the target appliance
Generate target appliance key
Complete the following tasks to generate the target appliance key:
In the Azure portal, go to your Azure Migrate project and select Servers, databases and web apps.
Verify that you see a non-zero value for Discovered servers under Migration tools.
Under Migration and modernization, select Replicate.
On the Specify intent page, provide the following inputs:
- For What do you want to migrate?, select Servers or virtual machines (VM).
- For Where do you want to migrate?, select Azure Stack HCI.
- For Virtualization Type, select Hyper-V.
- For the On-premises appliance, the source appliance is pre-populated. IF you have more than one source appliance, select the applicable one from the dropdown list.
Select Download and configure in Before you start replication to Azure Stack HCI from the information block.
On the Deploy and configure the target appliance pane, provide a name for the target appliance and then select Generate key.
Copy and paste the project key to a text editor (for example, Notepad) after it is generated for future use.
Create the target appliance
You can download the appliance using either a .VHD file or a .zip file.
Under Step 2: Download Azure Migrate appliance, select either .VHD file or .zip file, and then select Download installer.
Install using a template (.VHD file)
This step applies only if you downloaded the .VHD zipped file.
Check that the zipped file is secure, before you deploy it.
On the server where you downloaded the file, open an administrator command window.
Run the following command to generate the hash for the VHD.
C:\>Get-FileHash -Path <file_location> -Algorithm <Hashing Algorithm>
Here's an example output.
C:\>Get-FileHash -Path ./AzureMigrateAppliance_v3.20.09.25.zip -Algorithm SHA256
Verify the latest appliance versions and hash values for Azure public cloud:
Scenario Download SHA256 Azure Stack HCI appliance Latest version: https://go.microsoft.com/fwlink/?linkid=2246416
6ae1144b026efb2650f5e11c007a457c351a752f942c2db827dd2903f468dccb Extract the zip file to a folder.
Now you can install the appliance using the .VHD file.
On a Hyper-V server (this could be your source server), go to the Hyper-V Manager. Select Hyper-V Manager > Connect to server.
On the Select Computer dialog box, select Another computer. Browse to the Azure Stack HCI server, and then select OK.
Map the drive on your Azure Stack HCI server where you downloaded the VHD. Connect to this drive using File Explorer. Verify that you can access the location where the VHD was downloaded on your Azure Stack HCI server.
On your Hyper-V server, from the Actions pane, select Import Virtual Machine. This starts a wizard. Go through the steps of the wizard. Accept the defaults except on the following:
- On the Locate Folder page, point to the folder that has the VHD (folder name is AzureMigrateApplianceHCI_v25.24.02.07) that you downloaded on your Azure Stack HCI server.
- On the Connect Network page, select a switch from the dropdown list for Connection. Create a VM using the VHD you downloaded, then start and sign into the VM. Make sure the VM has access to the internet.
- Finally review the settings and select Finish.
In the Hyper-V Manager, under Virtual Machines, you see the VM your created. Select and start the VM.
Once the VM starts, accept the license terms and conditions. On the Customize settings page, provide and confirm a password for the administrator account and then select Finish.
After the VM has started up, sign in to the VM as an administrator. Enter the password you provided in the previous step.
Open Azure Migrate Target Appliance Configuration Manager shortcut from the desktop.
Install using a script (.zip file)
This step applies only if you downloaded the .zip file.
Using Hyper-V Manager, create a standalone (non-HA) VM on the target Azure Stack HCI server running on Windows Server 2022 with 80 GB (min) disk storage, 16 GB (min) memory, and 8 virtual processors. Make sure that the VM has access to the internet.
In Hyper-V Manager, select the host.
Under Hyper-V settings, select Enhanced Session Mode Policy and ensure Allow enhanced session mode is enabled. For more information, see Turn on enhanced session mode on a Hyper-V host.
Sign into the VM as an administrator.
Copy and paste the downloaded .zip file to the VM virtual disk that you created and extract it as needed.
As an administrator, run the following PowerShell script from the folder of the extracted files to install the target appliance:
Set-ExecutionPolicy -ExecutionPolicy Unrestricted .\AzureMigrateInstaller.ps1 -Scenario AzureStackHCI -Cloud Public -PrivateEndpoint:$false
Restart and sign into the VM.
Register the target appliance
Sign in to the target appliance VM.
Open Azure Migrate Target Appliance Configuration Manager from the desktop shortcut.
Locate the target key that you previously generated, paste it in the field under Verification of Azure Migrate project key, and then select Verify.
Once the verification is complete, select Log in and sign in to your Azure account.
Enter the code that is displayed in your Authenticator (or similar) app for MFA authentication.
Wait until you see The appliance has been successfully registered message.
Sign in to Microsoft Azure PowerShell using the code displayed in your Authenticator app. It can take up to 10 minutes for the appliance to be registered.
After the appliance is registered, under Provide Azure Stack HCI cluster information, select Add cluster information.
For your target Azure Stack HCI cluster, enter the cluster fully qualified domain name (FQDN), domain name, username, and password, and then select Save.
Once the credentials are accepted, the status changes to Validated. Select Configure.
Wait until the configuration is complete and you see this message: Successfully configured Azure Migrate project.
Step 3: Start replication
In the Azure portal, go to your Azure Migrate project and select Servers, databases and web apps.
Under Migration and modernization, select Replicate.
On the Specify intent page:
- What do you want to migrate is automatically populated as Servers or virtual machines (VM).
- Select Azure Stack HCI for Where do you want to migrate to ?
- Select HYper-V for the Virtualization type.
- Select the source appliance as the On-premises appliance (source) used for discovery.
- When finished, select Continue.
On the Replicate page, on the Basics tab:
- This field is automatically populated. If this is not the subscription that has your target cluster, choose the Azure subscription that has the cluster.
- Select the resource group associated with your target cluster.
- For Cluster resource, select the Azure Stack HCI cluster resource.
- Verify there is a green check for the cluster. A green check indicates that all the prerequisites such as Arc Resource Bridge are configured on this cluster.
- When finished, select Next.
On the Target appliance tab, verify that the target appliance is connected - you should see a green checkmark.
Note
A green checkmark indicates that the target appliance is successfully registered and configured. If you haven't configured your target appliance yet, you will see the configuration page here instead.
Select Next.
On the Virtual machines tab, verify the VMs have been discovered and are listed. You can select up to 10 VMs from the list to migrate at one time. Select Next.
On the Target settings tab, complete these tasks:
The Storage account subscription is automatically populated. If this is not the subscription where you want to create the storage account, choose another subscription.
Note
Migration requires a storage account to be created. This account must reside in the same subscription as your Azure project.
Select the Resource group to associate with your storage account.
The VM subscription is automatically populated.
For your Cache storage account, select an existing storage account. You can also select (New) Storage account to create a new storage account with a randomly generated name.
Note
- We recommend that you create new a storage account to be used as your cache storage account. > > - Once created, the storage account location can't be changed.
Select a resource group to associate with your migrated VMs.
Select the logical network that you created as a prerequisite. The VMs will be connected to this network. If you don't see a logical network in the dropdown list, create a logical network and select Reload logical network.
Select the storage path that you created as a prerequisite. The VMs will be created at this storage path. If you don't see a storage path in the dropdown list, create a storage path and select Reload storage path.
When finished, select Next.
On the Compute tab:
On the Disks tab, select which disks you would like to replicate.
Note
Once selected, the OS disks can't be unselected.
Change the disk type if needed and select Next.
On the Review + Start replication tab, make sure that all the values are correct and then select Replicate.
Stay on this page until the process is complete (this might take 5-10 minutes). If you move away from this page, the replication artifacts won't be created fully leading to a failure in replication and eventually migration.
You are automatically taken to Servers, databases and web apps page. On the Migration tools tile, select Overview.
Go to Azure Stack HCI migration > Replications. Review the replication status. Select Refresh to see the replicated VMs appear.
As the replication continues, replication status shows progress. Continue refreshing periodically. After the initial replication is complete, hourly delta replications begin. The Migration status changes to Ready to migrate. The VMs can be migrated.
Next steps
- Complete Hyper-V VM Migration.