Tutorial: Discover Hyper-V VMs with Server Assessment
As part of your migration journey to Azure, you discover your on-premises inventory and workloads.
This tutorial shows you how to discover on-premises Hyper-V virtual machines (VMs) with the Azure Migrate: Server Assessment tool, using a lightweight Azure Migrate appliance. You deploy the appliance as a Hyper-V VM, to continuously discover machine and performance metadata.
In this tutorial, you learn how to:
- Set up an Azure account
- Prepare the Hyper-V environment for discovery.
- Create an Azure Migrate project.
- Set up the Azure Migrate appliance.
- Start continuous discovery.
Tutorials show the quickest path for trying out a scenario, and use default options.
If you don't have an Azure subscription, create a free account before you begin.
Before you start this tutorial, check you have these prerequisites in place.
|Hyper-V host||Hyper-V hosts on which VMs are located can be standalone, or in a cluster.
The host must be running Windows Server 2019, Windows Server 2016, or Windows Server 2012 R2.
Verify inbound connections are allowed on WinRM port 5985 (HTTP), so that the appliance can connect to pull VM metadata and performance data, using a Common Information Model (CIM) session.
|Appliance deployment||Hyper-v host needs resources to allocate a VM for the appliance:
- Windows Server 2016
-16 GB of RAM
- Eight vCPUs
- Around 80 GB of disk storage.
- An external virtual switch.
- Internet access on for the VM, directly or via a proxy.
|VMs||VMs can be running any Windows or Linux operating system.|
Before you start, you can review the data that the appliance collects during discovery.
Prepare an Azure user account
To create an Azure Migrate project and register the Azure Migrate appliance, you need an account with:
- Contributor or Owner permissions on an Azure subscription.
- Permissions to register Azure Active Directory apps.
If you just created a free Azure account, you're the owner of your subscription. If you're not the subscription owner, work with the owner to assign the permissions as follows:
In the Azure portal, search for "subscriptions", and under Services, select Subscriptions.
In the Subscriptions page, select the subscription in which you want to create an Azure Migrate project.
In the subscription, select Access control (IAM) > Check access.
In Check access, search for the relevant user account.
In Add a role assignment, click Add.
In Add role assignment, select the Contributor or Owner role, and select the account (azmigrateuser in our example). Then click Save.
In the portal, search for users, and under Services, select Users.
In User settings, verify that Azure AD users can register applications (set to Yes by default).
Alternately, the tenant/global admin can assign the Application Developer role to an account to allow the registration of AAD App(s). Learn more.
Prepare Hyper-V hosts
Set up an account with Administrator access on the Hyper-V hosts. The appliance uses this account for discovery.
- Option 1: Prepare an account with Administrator access to the Hyper-V host machine.
- Option 2: Prepare a Local Admin account, or Domain Admin account, and add the account to these groups: Remote Management Users, Hyper-V Administrators, and Performance Monitor Users.
Set up a project
et up a new Azure Migrate project.
In the Azure portal > All services, search for Azure Migrate.
Under Services, select Azure Migrate.
In Overview, select Create project.
In Create project, select your Azure subscription and resource group. Create a resource group if you don't have one.
Wait a few minutes for the Azure Migrate project to deploy.
The Azure Migrate: Server Assessment tool is added by default to the new project.
Set up the appliance
This tutorial sets up the appliance on a Hyper-V VM, as follows:
- Provide an appliance name and generate an Azure Migrate project key in the portal.
- Download a compressed Hyper-V VHD from the Azure portal.
- Create the appliance, and check that it can connect to Azure Migrate Server Assessment.
- Configure the appliance for the first time, and register it with the Azure Migrate project using the Azure Migrate project key.
If for some reason you can't set up the appliance using a template, you can set it up using a PowerShell script. Learn more.
Generate the Azure Migrate project key
- In Migration Goals > Servers > Azure Migrate: Server Assessment, select Discover.
- In Discover machines > Are your machines virtualized?, select Yes, with Hyper-V.
- In 1:Generate Azure Migrate project key, provide a name for the Azure Migrate appliance that you will set up for discovery of Hyper-V VMs.The name should be alphanumeric with 14 characters or fewer.
- Click on Generate key to start the creation of the required Azure resources. Please do not close the Discover machines page during the creation of resources.
- After the successful creation of the Azure resources, an Azure Migrate project key is generated.
- Copy the key as you will need it to complete the registration of the appliance during its configuration.
Download the VHD
In 2: Download Azure Migrate appliance, select the .VHD file and click on Download.
Check that the zipped file is secure, before you deploy it.
On the machine to which you downloaded the file, open an administrator command window.
Run the following PowerShell command to generate the hash for the ZIP file
C:\>Get-FileHash -Path <file_location> -Algorithm [Hashing Algorithm]
- Example usage:
C:\>Get-FileHash -Path ./AzureMigrateAppliance_v3.20.09.25.zip -Algorithm SHA256
Verify the latest appliance versions and hash values:
Create the appliance VM
Import the downloaded file, and create the VM.
- Extract the zipped VHD file to a folder on the Hyper-V host that will host the appliance VM. Three folders are extracted.
- Open Hyper-V Manager. In Actions, click Import Virtual Machine.
- In the Import Virtual Machine Wizard > Before you begin, click Next.
- In Locate Folder, specify the folder containing the extracted VHD. Then click Next.
- In Select Virtual Machine, click Next.
- In Choose Import Type, click Copy the virtual machine (create a new unique ID). Then click Next.
- In Choose Destination, leave the default setting. Click Next.
- In Storage Folders, leave the default setting. Click Next.
- In Choose Network, specify the virtual switch that the VM will use. The switch needs internet connectivity to send data to Azure.
- In Summary, review the settings. Then click Finish.
- In Hyper-V Manager > Virtual Machines, start the VM.
Verify appliance access to Azure
Configure the appliance
Set up the appliance for the first time.
If you set up the appliance using a PowerShell script instead of the downloaded VHD, the first two steps in this procedure aren't relevant.
In Hyper-V Manager > Virtual Machines, right-click the VM > Connect.
Provide the language, time zone, and password for the appliance.
Open a browser on any machine that can connect to the VM, and open the URL of the appliance web app: https://appliance name or IP address: 44368.
Alternately, you can open the app from the appliance desktop by clicking the app shortcut.
Accept the license terms, and read the third-party information.
In the web app > Set up prerequisites, do the following:
- Connectivity: The app checks that the VM has internet access. If the VM uses a proxy:
- Click on Set up proxy to and specify the proxy address (in the form http://ProxyIPAddress or http://ProxyFQDN) and listening port.
- Specify credentials if the proxy needs authentication.
- Only HTTP proxy is supported.
- If you have added proxy details or disabled the proxy and/or authentication, click on Save to trigger connectivity check again.
- Time sync: Time is verified. The time on the appliance should be in sync with internet time for VM discovery to work properly.
- Install updates: Azure Migrate Server Assessment checks that the appliance has the latest updates installed.After the check completes, you can click on View appliance services to see the status and versions of the components running on the appliance.
- Connectivity: The app checks that the VM has internet access. If the VM uses a proxy:
Register the appliance with Azure Migrate
Paste the Azure Migrate project key copied from the portal. If you do not have the key, go to Server Assessment> Discover> Manage existing appliances, select the appliance name you provided at the time of key generation and copy the corresponding key.
Click on Log in. It will open an Azure login prompt in a new browser tab. If it doesn't appear, make sure you've disabled the pop-up blocker in the browser.
On the new tab, sign in by using your Azure username and password.
Sign-in with a PIN isn't supported.
After you successfully logged in, go back to the web app.
If the Azure user account used for logging has the right permissions on the Azure resources created during key generation, the appliance registration will be initiated.
After appliance is successfully registered, you can see the registration details by clicking on View details.
Delegate credentials for SMB VHDs
If you're running VHDs on SMBs, you must enable delegation of credentials from the appliance to the Hyper-V hosts. To do this from the appliance:
On the appliance VM, run this command. HyperVHost1/HyperVHost2 are example host names.
Enable-WSManCredSSP -Role Client -DelegateComputer HyperVHost1.contoso.com, HyperVHost2.contoso.com, HyperVHost1, HyperVHost2 -Force
Alternatively, do this in the Local Group Policy Editor on the appliance:
- In Local Computer Policy > Computer Configuration, click Administrative Templates > System > Credentials Delegation.
- Double-click Allow delegating fresh credentials, and select Enabled.
- In Options, click Show, and add each Hyper-V host you want to discover to the list, with wsman/ as a prefix.
- In Credentials Delegation, double-click Allow delegating fresh credentials with NTLM-only server authentication. Again, add each Hyper-V host you want to discover to the list, with wsman/ as a prefix.
Start continuous discovery
Connect from the appliance to Hyper-V hosts or clusters, and start VM discovery.
In Step 1: Provide Hyper-V host credentials, click on Add credentials to specify a friendly name for credentials, add Username and Password for a Hyper-V host/cluster that the appliance will use to discover VMs. Click on Save.
If you want to add multiple credentials at once,click on Add more to save and add more credentials. Multiple credentials are supported for Hyper-V VMs discovery.
In Step 2: Provide Hyper-V host/cluster details, click on Add discovery source to specify the Hyper-V host/cluster IP address/FQDN and the friendly name for credentials to connect to the host/cluster.
You can either Add single item at a time or Add multiple items in one go. There is also an option to provide Hyper-V host/cluster details through Import CSV.
- If you choose Add single item, you need to specify friendly name for credentials and Hyper-V host/cluster IP address/FQDN and click on Save.
- If you choose Add multiple items (selected by default), you can add multiple records at once by specifying Hyper-V host/cluster IP address/FQDN with the friendly name for credentials in the text box.Verify the added records and click on Save.
- If you choose Import CSV, you can download a CSV template file, populate the file with the Hyper-V host/cluster IP address/FQDN and friendly name for credentials. You then import the file into the appliance, verify the records in the file and click on Save.
On clicking Save, appliance will try validating the connection to the Hyper-V hosts/clusters added and show the Validation status in the table against each host/cluster.
- For successfully validated hosts/clusters, you can view more details by clicking on their IP address/FQDN.
- If validation fails for a host, review the error by clicking on Validation failed in the Status column of the table. Fix the issue, and validate again.
- To remove hosts or clusters, click on Delete.
- You can't remove a specific host from a cluster. You can only remove the entire cluster.
- You can add a cluster, even if there are issues with specific hosts in the cluster.
You can revalidate the connectivity to hosts/clusters any time before starting the discovery.
Click on Start discovery, to kick off VM discovery from the successfully validated hosts/clusters. After the discovery has been successfully initiated, you can check the discovery status against each host/cluster in the table.
This starts discovery. It takes approximately 2 minutes per host for metadata of discovered servers to appear in the Azure portal.
Verify VMs in the portal
After discovery finishes, you can verify that the VMs appear in the portal.
- Open the Azure Migrate dashboard.
- In Azure Migrate - Servers > Azure Migrate: Server Assessment page, click the icon that displays the count for Discovered servers.