Lab answer key: Migrating Hyper-V VMs to Azure by using Azure Migrate
This exercise should take approximately 120 minutes to complete.
Note: You may need to install the latest version of the Microsoft Edge browser. To update the Microsoft Edge browser, select the three dots (ellipsis) icon in the upper-right corner of the window. Select Help and feedback from the dropdown menu, then select About Microsoft Edge. Edge will automatically check for updates and download any available updates, once the update is downloaded, click on the Restart
Exercise 1: Prepare the lab environment
Task 1: Deploy an Azure VM by using an Azure Resource Manager template
- Connect to SEA-SVR2 and then, if needed, sign in with the credentials provided by the instructor.
- On SEA-SVR2, start Microsoft Edge, go to the Azure portal at
https://portal.azure.com/, and sign in by using the credentials of a user account with the Owner role in the subscription you’ll be using in this lab. - In the Azure portal search box, enter Deploy a custom template, and then select Deploy a custom template from the results.
- On the Custom deployment page, select Build your own template in the editor.
- On the Edit template page, select Load file, load C:\Labfiles\Lab07\azuredeploy.json, and then select Save.
-
On the Custom deployment page, specify the following settings (leave others with their default values):
Setting Value Subscription the name of the Azure subscription you are using in this lab Resource group the name of a new resource group AZ801-L0701-RG Region the name of an Azure region into which you can provision Azure VMs Virtual Network Name az801l07a-hv-vnet Host Network Interface1Name az801l07a-hv-vm-nic1 Host Network Interface2Name az801l07a-hv-vm-nic2 Host Virtual Machine Name az801l07a-hv-vm Host Virtual Machine Size Standard_D4s_v5 Host Admin Username Student Host Admin Password Pa55w.rd1234 _artifacts Location https://raw.githubusercontent.com/MicrosoftLearning/AZ-801-Configuring-Windows-Server-Hybrid-Advanced-Services/master/Allfiles/Labfiles/Lab07/[!NOTE] Keep the D4s capacity required by the nested Hyper-V host. Use Standard_D4s_v5 first. If the deployment fails because the size is unavailable or Azure lacks capacity, select Standard_D4s_v6 and redeploy to the same resource group. If necessary, retry with Standard_D4s_v7. If a retry fails because an existing or partially deployed resource causes a conflict, delete AZ801-L0701-RG. Restart Task 1 from Deploy a custom template, reload C:\Labfiles\Lab07\azuredeploy.json, verify _artifacts Location, recreate AZ801-L0701-RG, and deploy again with the selected VM size.
-
On the Custom deployment page, select Review + create, and then select Create.
Note: Wait for the deployment to complete. The deployment might take about 10 minutes.
Task 2: Deploy Azure Bastion
Note: Azure Bastion allows connections to Azure VMs without public endpoints while providing protection against brute-force exploits that target operating-system credentials.
- On SEA-SVR2, in the browser window displaying the Azure portal, open a PowerShell session on the Cloud Shell pane.
-
From the PowerShell session on the Cloud Shell pane, run the following commands to add a subnet named AzureBastionSubnet to the virtual network named az801l07a-hv-vnet you created earlier in this exercise:
$resourceGroupName = 'AZ801-L0701-RG' $vnet = Get-AzVirtualNetwork -ResourceGroupName $resourceGroupName -Name 'az801l07a-hv-vnet' $subnetConfig = Add-AzVirtualNetworkSubnetConfig ` -Name 'AzureBastionSubnet' ` -AddressPrefix 10.0.7.0/24 ` -VirtualNetwork $vnet $vnet | Set-AzVirtualNetwork - Close the Cloud Shell pane.
-
From the Azure portal, create an Azure Bastion instance with the following settings:
Setting Value Subscription the name of the Azure subscription you are using in this lab Resource group AZ801-L0701-RG Name az801l07a-bastion Region the same Azure region to which you deployed the resources in the previous tasks of this exercise Tier Basic Virtual network az801l07a-hv-vnet Subnet AzureBastionSubnet (10.0.7.0/24) Public IP address Create new Public IP name az801l07a-hv-vnet-ip Note: The bastion must be created in the same Azure region as the virtual network.
Note: Wait for the deployment to complete before you proceed to the next task. The deployment might take about 5 minutes.
Task 3: Deploy a nested VM in the Azure VM
- In the Azure portal, browse to the az801l07a-hv-vm virtual machine page.
-
From the az801l07a-hv-vm page, connect to the operating system running within the virtual machine via Azure Bastion by using the following credentials:
Setting Value User Name Student Password Pa55w.rd1234 - Within the Remote Desktop session to az801l07a-hv-vm, in the Server Manager window, select Local Server, select the On link next to the IE Enhanced Security Configuration label. In the IE Enhanced Security Configuration dialog box, select both Off options, and then select OK.
- From the Remote Desktop session, open File Explorer and browse to the F: drive. Create two folders F:\VHDs and F:\VMs.
- Within the Remote Desktop session to az801l07a-hv-vm, start Microsoft Edge, complete the initial setup, go to Windows Server Evaluations, provide the requested information, download the Windows Server 2022 VHD file, and copy it to the F:\VHDs folder.
- Within the Remote Desktop session to az801l07a-hv-vm, select Start, select Windows Administrative Tools, and then select Hyper-V Manager.
- In the Hyper-V Manager console, select the az801l07a-hv-vm node.
- Select New and then, in the cascading menu, select Virtual Machine. This will start the New Virtual Machine Wizard.
- On the Before You Begin page of the New Virtual Machine Wizard, select Next >.
-
On the Specify Name and Location page of the New Virtual Machine Wizard, specify the following settings and select Next >:
Setting Value Name az801l07a-vm1 Store the virtual machine in a different location selected Location F:\VMs - On the Specify Generation page of the New Virtual Machine Wizard, ensure that the Generation 1 option is selected, and then select Next >.
- On the Assign Memory page of the New Virtual Machine Wizard, set Startup memory to 2048, and then select Next >.
- On the Configure Networking page of the New Virtual Machine Wizard, in the Connection drop-down list, select NestedSwitch, and then select Next >.
- On the Connect Virtual Hard Disk page of the New Virtual Machine Wizard, select the option Use an existing virtual hard disk, set location to the VHD file you downloaded to the F:\VHDs folder, and then select Next >.
- On the Summary page of the New Virtual Machine Wizard, select Finish.
- In the Hyper-V Manager console, select the newly created virtual machine, and then select Start.
- In the Hyper-V Manager console, verify that the virtual machine is running, and then select Connect.
- In the Virtual Machine Connection window to az801l07a-vm1, on the Hi there page, select Next.
- In the Virtual Machine Connection window to az801l07a-vm1, on the License terms page, select Accept.
- In the Virtual Machine Connection window to az801l07a-vm1, on the Customize settings page, set the password of the built-in Administrator account to Pa55w.rd, and then select Finish.
- In the Virtual Machine Connection window to az801l07a-vm1, in the Action menu, select Ctrl + Alt + Delete and then, when prompted, sign in by using the newly set password.
-
In the Virtual Machine Connection window to az801l07a-vm1, select Start. In the Start menu, select Windows PowerShell and then, in the Administrator: Windows PowerShell window, run the following to set the computer name.
Rename-Computer -NewName 'az801l07a-vm1' -Restart
Exercise 2: Prepare for assessment and migration by using Azure Migrate
Task 1: Configure Hyper-V environment
-
Within the Remote Desktop session to az801l07a-hv-vm, in the browser window, go to https://aka.ms/migrate/script/hyperv, and download the Azure Migrate configuration PowerShell script.
Note: The script performs the following tasks:
- Checks that you’re running the script on a supported PowerShell version
- Verifies that you have administrative privileges on the Hyper-V host
- Allows you to create a local user account that the Azure Migrate service uses to communicate with the Hyper-V host (This user account is added to Remote Management Users, Hyper-V Administrators, and Performance Monitor Users groups on the Hyper-V host.)
- Checks that the host is running a supported version of Hyper-V, and the Hyper-V role
- Enables the WinRM service, and opens ports 5985 (HTTP) and 5986 (HTTPS) on the host (This is required for metadata collection.)
- Enables PowerShell remoting on the host
- Checks that the Hyper-V Integration Services is enabled on all VMs managed by the host
- Enables CredSSP on the host if needed
- Within the Remote Desktop session to az801l07a-hv-vm, select Start and then select Windows PowerShell ISE.
-
In the Administrator: Windows PowerShell ISE window, on the console pane, run the following commands to copy the script to the C:\Labfiles\Lab07 folder and remove the Zone.Identifier alternate data stream, which, in this case, indicates that the file was downloaded from the Internet:
New-Item -ItemType Directory -Path C:\Labfiles\Lab07 -Force Copy-Item -Path "$env:USERPROFILE\Downloads\MicrosoftAzureMigrate-Hyper-V.ps1" -Destination 'C:\Labfiles\Lab07' Unblock-File -Path C:\Labfiles\Lab07\MicrosoftAzureMigrate-Hyper-V.ps1 Set-Location -Path C:\Labfiles\Lab07 -
In the Administrator: Windows PowerShell ISE window, open the MicrosoftAzureMigrate-Hyper-V.ps1 script residing in the C:\Labfiles\Lab07 folder and run it. When prompted for confirmation, enter Y and press Enter, with the exception of the following prompts, in which case, enter N and press Enter:
- Do you use SMB share(s) to store the VHDs?
- Do you want to create non-administrator local user for Azure Migrate and Hyper-V Host communication?
Task 2: Create an Azure Migrate project
- Within the Remote Desktop session to az801l07a-hv-vm, in the browser window, go to the Azure portal at
https://portal.azure.com/, and sign in by using the credentials of a user account with the Owner role in the subscription you are using in this lab. - In the Azure portal, in the Search resources, services, and docs text box, on the toolbar, search for and select Azure Migrate, and then, on the Azure Migrate | Get Started page, select Create Project.
-
On the Create Project page, specify the following settings (leave others with their default values) and select Create:
Setting Value Subscription the name of the Azure subscription you are using in this lab Resource group the name of a new resource group AZ801-L0702-RG Migrate project az801l07a-migrate-project Geography the name of your country or a geographical region
Task 3: Implement the target Azure environment
- Within the Remote Desktop session to az801l07a-hv-vm, in the Azure portal, in the Search resources, services, and docs text box, on the toolbar, search for and select Virtual networks. On the Virtual networks page, select + Create on the command bar.
-
On the Basics tab of the Create virtual network page, specify the following settings (leave others with their default values) and select IP Addresses:
Setting Value Subscription the name of the Azure subscription you are using in this lab Resource group the name of a new resource group AZ801-L0703-RG Name az801l07a-migration-vnet Region the name of the Azure region into which you deployed the virtual machine earlier in this lab -
On the IP addresses tab of the Create virtual network page, select the ellipsis symbol (…) next to the + add a subnet button, from the dropdown list select Delete address space, select Add an IP address space.
-
On the Add an IP address space page, specify the following settings (leave others with their default values) and select Add:
Setting Value Starting Address 10.7.0.0 Address space size /16 (65536 Addresses) - On the IP addresses tab of the Create virtual network page, select + Add a subnet.
-
On the Add a subnet page, specify the following settings (leave others with their default values) and select Add:
Setting Value Name subnet0 Starting Address 10.7.0.0 Subnet size /24 (256 Addresses) - Back on the IP addresses tab of the Create virtual network page, select Review + create.
- On the Review + create tab of the Create virtual network page, select Create.
- In the Azure portal, browse back to the Virtual networks page, and then, select + Create on the command bar.
-
On the Basics tab of the Create virtual network page, specify the following settings (leave others with their default values) and select IP Addresses:
Setting Value Subscription the name of the Azure subscription you are using in this lab Resource group AZ801-L0703-RG Name az801l07a-test-vnet Region the name of the Azure region into which you deployed the virtual machine earlier in this lab -
On the IP addresses tab of the Create virtual network page, select the ellipsis symbol (…) next to the + add a subnet button, from the dropdown list select Delete address space, select Add an IP address space.
-
On the Add an IP address space page, specify the following settings (leave others with their default values) and select Add:
Setting Value Starting Address 10.7.0.0 Address space size /16 (65536 Addresses) - On the IP addresses tab of the Create virtual network page, select + Add a subnet.
-
On the Add a subnet page, specify the following settings (leave others with their default values) and select Add:
Setting Value Name subnet0 Starting Address 10.7.0.0 Subnet size /24 (256 Addresses) - Back on the IP addresses tab of the Create virtual network page, select Review + create.
- On the Review + create tab of the Create virtual network page, select Create.
- In the Azure portal, search for and select Storage accounts. Then, on the Storage accounts page, select + Create on the command bar.
- On the Basics tab of the Create a storage account page, specify the following settings (leave others with their default values):
| Setting | Value |
|---|---|
| Subscription | the name of the Azure subscription you are using in this lab |
| Resource group | AZ801-L0703-RG |
| Storage account name | any globally unique name between 3 and 24 characters in length consisting of letters and digits |
| Location | the name of the Azure region in which you created the virtual network earlier in this task |
| Performance | Standard |
| Redundancy | Locally redundant storage (LRS) |
- On the Basics tab of the Create a storage account page, select the Data protection tab.
- On the Data protection tab of the Create a storage account page, clear the Enable soft delete for blobs and Enable soft delete for containers checkboxes, and then select Review.
- On the Review tab, select Create.
Exercise 3: Assess Hyper-V for migration by using Azure Migrate
Task 1: Deploy and configure the Azure Migrate appliance
- Within the Remote Desktop session to az801l07a-hv-vm, in the browser window, in the Azure portal, search for and select Azure Migrate.
-
On the **Azure Migrate Get Started** page, select All projects in the menu on the left, and select the az801l07a-migrate-project project. - On the az801l07a-migrate-project | Overview page, , select Start Discovery, select Using appliance, and then select For Azure.
- On the Discover page, in the Are your servers virtualized? drop-down list, select Yes, with Hyper-V.
-
On the Discover page, in the Name your appliance text box, type az801l07a-vma1 and select the Generate key button.
Note: Wait for the key generation to complete and record its value. You will need it later in this exercise.
-
On the Discover page, in the Download Azure Migrate appliance text box, select the .VHD file option, select Download and then, when prompted, set the download location to the F:\VMs folder.
Note: Wait for the download to complete. This might take about 5 minutes.
-
Once the download completes, extract the content of the downloaded .ZIP file into the F:\VMs folder.
Note: As Microsoft Edge doesn’t prompt by default, you may need to manually copy the .VHD file to the F:\VMs folder.
- Within the Remote Desktop session to az801l07a-hv-vm, switch to the Hyper-V Manager console, select the AZ801L07A-VM1 node, and then select Import Virtual Machine. This will start the Import Virtual Machine wizard.
- On the Before You Begin page of the Import Virtual Machine wizard, select Next >.
- On the Locate Folder page of the Import Virtual Machine wizard, specify the location of the extracted Virtual Machines folder and select Next >.
- On the Select Virtual Machine page of the Import Virtual Machine wizard, select Next >.
- On the Choose Import Type page of the Import Virtual Machine wizard, select Register the virtual machine in-place (use the existing unique ID), and then select Next >.
-
On the Configure Processor page of the Import Virtual Machine wizard, set Number of virtual processors to 4, and then select Next >.
Note: In a lab environment, you can ignore any error messages referring to the change of the number of virtual processors. In production scenarios, you should ensure that the virtual appliance has the sufficient number of compute resources assigned to it.
- On the Connect Network page of the Import Virtual Machine wizard, in the Connection drop-down list, select NestedSwitch, and then select Next >.
-
On the Summary page of the Import Virtual Machine wizard, select Finish.
Note: Wait for the import to complete.
- In the Hyper-V Manager console, select the newly imported virtual machine, select Rename, and then set its name to az801l07a-vma1.
- Set the memory size of the virtual machine to 4096 MB, and uncheck the Enable Dynamic memory checkbox.
- In the Hyper-V Manager console, select the newly imported virtual machine, and then select Start.
- In the Hyper-V Manager console, verify that the virtual machine is running, and then select Connect.
- In the Virtual Machine Connection window to the virtual appliance, on the License terms page, select Accept.
- In the Virtual Machine Connection window to the virtual appliance, on the Customize settings page, set the password of the built-in Administrator account to Pa55w.rd, and then select Finish.
-
In the Virtual Machine Connection window to the virtual appliance, in the Action menu, select Ctrl + Alt + Delete and then, when prompted, sign in by using the newly set password.
Note: Within the Virtual Machine Connection window to the virtual appliance, a browser window displaying Appliance Configuration Manager will automatically open.
- On the Appliance Configuration Manager page, select the I agree button and wait for the setup prerequisites to be successfully verified.
- On the Appliance Configuration Manager page, in the Check latest updates and register appliance section, in the Register Hyper-V appliance by pasting the key here text box, paste the key you copied into Notepad earlier in this exercise, select Verify.
- In the Azure user login and appliance registration status section, select Login. In the Continue with Azure Login window, select Copy code & Login. This will automatically open a new browser tab prompting you to enter the copied code.
- On the Enter code pane in the newly opened browser tab, paste the code you copied onto the Clipboard, and then select Next. When prompted, sign in by providing the credentials of a user account with the Owner role in the subscription you are using in this lab.
- When prompted Are you trying to sign in to Microsoft Azure PowerShell?, select Continue, and then close the newly opened browser tab.
- In the browser window, on the Appliance Configuration Manager page, verify that registration was successful.
-
On the Appliance Configuration Manager page, in the Manage credentials and discovery sources section, select Add credentials. On the Add credentials pane, specify the following settings, and then select Save:
Setting Value Friendly Name az801l07ahvcred User Name Student Password Pa55w.rd1234 -
Within the browser window, on the Appliance Configuration Manager page, in the Provide Hyper-V host/cluster details section, select Add discovery source. On the Add discovery source pane, select the Add single item option. Ensure that the Discovery source drop-down list is set to Hyper-V Host/Cluster. In the Map credentials drop-down list, select the az801l07ahvcred entry, in the IP address /FQDN text box, type 10.0.2.1, and then select Save.
Note: 10.0.2.1 is the IP address of the network interface of the Hyper-V host attached to the internal switch.
-
On the Appliance Configuration Manager page, in the Step 3: Provide server credentials to perform guest discovery of installed software, dependencies and workloads section, Disable the Guest discovery is enabled by default toggle button, and then select Start discovery.
Note: It might take about 15 minutes per host for metadata of discovered servers to appear in the Azure portal.
Task 2: Configure, run, and view an assessment
-
From the Virtual Machine Connection window to the virtual appliance, switch to the Remote Desktop session to az801l07a-hv-vm. In the browser window displaying the Azure portal, browse back to the **Azure Migrate az801l07a-migrate-project** page and select Refresh. In the Overview tab, under Assessments, select Create assessment. - On the Basics tab of the Create assessment page, enter az801l07a-assessment as the Assessment name, and select Add workloads.
- In the Select workloads page, select the az801l07a-vm1 checkbox, select Add, and select Next.
-
On the General tab of the Create assessment page, specify the following settings (leave others with their default values) and select Next:
Setting Value Target location the name of the Azure region you are using in this lab Currency US Dollar ($) Offer Pay-As-You-Go Default savings option None Discount 0 Uptime 31 Day(s) per month and 24 Hour(s) per day Sizing criteria As on premises Comfort factor 1 Note: Considering the limited time inherent to the lab environment, the only viable option in this case is an As on-premises assessment.
- In the Advanced tab, under Infrastructure settings, select Edit defaults.
-
Ensure that Azure VM is selected under Target services, select Edit defaults, specify the following parameters and select Save:
Setting Value VM series Dsv4_series Storage type Premium managed disks VM security type Standard - In the Server (Machine) settings page, select Save.
-
Select Review + Create assessment, and select Create
Note: In real-world scenarios, you should consider installing the Dependency agent to provide more insights into server dependencies during the assessment stage.
Exercise 4: Migrate Hyper-V VMs by using Azure Migrate
Task 1: Prepare for migration of Hyper-V VMs
-
Within the Remote Desktop session to az801l07a-hv-vm, in the browser window displaying the Azure portal, browse back to the **Azure Migrate az801l07a-migrate-project** page. -
On the **Azure Migrate az801l07a-migrate-project** page, under Execute on the left menu, select Migrations, and then select Start execution. -
On the Specify intent page, specify the following settings:
Setting Value What do you want to migrate? Servers or virtual machines (VMs) Where do you want to migrate to? Azure VM How will you select workloads? From replication provider (Hyper-V) [!NOTE] This provider registration is separate from the Azure Migrate appliance registration that you completed in Exercise 3. You must install the replication provider on az801l07a-hv-vm, which is the Hyper-V host, before Azure Migrate can replicate its virtual machines.
- A message indicates that no Hyper-V hosts are registered with the project. In that message, select the link to set up the replication provider.
-
On the provider setup page, specify the following settings, and then select Create resources:
Setting Value Target region the name of the Azure region you are using in this lab Confirm that the target region for migration is selected Note: This step automatically triggers provisioning of an Azure Site Recovery vault.
-
In Prepare Hyper-V host servers, select the Download the Hyper-V replication provider link to download the
AzureSiteRecoveryProvider.exesoftware installer.
Note: If you receive a browser notification that says AzureSiteRecoveryProvider.exe can’t be downloaded securely, display the context-sensitive menu of the Download link and then, in the menu, select Copy link. Open another tab in the same browser window, paste the link you copied, and then press Enter.
- In the same section, select the blue Download button to download the
.VaultCredentialsregistration key file. You need both downloaded files to register the Hyper-V host. - Once the download completes, select the Open file link in the browser Downloads section. This will start the Azure Site Recovery Provider Setup (Hyper-V server) wizard.
- On the Microsoft Update page of the Azure Site Recovery Provider Setup (Hyper-V server) wizard, select Off, and then select Next.
- On the Provider installation page of the Azure Site Recovery Provider Setup (Hyper-V server) wizard, select Install.
- When installation completes, select Register. This starts the Microsoft Azure Site Recovery Registration Wizard.
- On the Vault Settings page of the Microsoft Azure Site Recovery Registration Wizard, select Browse, browse to the Downloads folder, select the vault credentials file, and then select Open.
- Back on the Vault Settings page of the Microsoft Azure Site Recovery Registration Wizard, select Next.
- On the Proxy Settings page of the Microsoft Azure Site Recovery Registration Wizard, accept the default settings and select Next.
- On the final Registration page of the Microsoft Azure Site Recovery Registration Wizard, select Finish.
- Return to the provider setup page in the Azure portal, and then select Finalize registration.
-
Wait for confirmation that registration is finalized.
Note: It might take up to 15 minutes for the discovery of virtual machines to complete.
Task 2: Configure replication of Hyper-V VMs
-
Within the Remote Desktop session to az801l07a-hv-vm, in the browser window displaying the Azure portal, browse back to the **Azure Migrate az801l07a-migrate-project** page. -
On the **Azure Migrate az801l07a-migrate-project** page, under Execute on the left menu, select Migrations, and then select Start execution. -
On the Specify intent page, specify the following settings, and then select Continue:
Setting Value What do you want to migrate? Servers or virtual machines (VMs) Where do you want to migrate to? Azure VM How will you select workloads? From an assessment Assessment az801l07a-assessment Discovery method az801l07a-vma1 -
On the Workloads page, select the checkbox next to az801l07a-vm1, and then select Next.
-
On the Target settings page, specify the following settings (leave others with their default values), and then select Next:
Setting Value Subscription the name of the Azure subscription you are using in this lab Resource group AZ801-L0703-RG Cache Storage Account the name of the storage account you created earlier in this lab Virtual Network az801l07a-migration-vnet Subnet subnet0 Availability options No infrastructure redundancy required Secure Boot Disabled -
On the Compute tab of the Execute migration page, ensure that Standard_D2s_v5 is selected in the Azure VM Size drop-down list. In the OS Type drop-down list, select Windows, and then select Next.
[!NOTE] Use Standard_D2s_v5 first. If the size is unavailable or Azure lacks capacity in the target region, use Standard_D2s_v6. If that size is also unavailable, use Standard_D2s_v7.
- On the Disks tab of the Execute migration page, accept the default settings, and then select Next.
- On the Tags tab of the Execute migration page, accept the default settings, and then select Next.
- On the Review + Start execution tab of the Execute migration page, review the settings, and then select Execute migration.
- To monitor the initial replication, return to Execute > Migrations, and then select View by workloads if that view isn’t already displayed.
- Locate az801l07a-vm1 and review its Execution stage and Execution status. During initial replication, the execution stage is Preparation.
- Select az801l07a-vm1 in the Workload column and verify that Migration status is Healthy. Review any issues listed on this page before continuing.
-
Wait until the execution stage changes to Testing. This indicates that initial replication is complete and delta replication is in progress. This might take an additional 15 minutes.
Note: Refresh the Migrations page periodically to update the execution stage and status.
Task 3: Perform migration of Hyper-V VMs
- On the Execute > Migrations page, select az801l07a-vm1 in the Workload column.
- On the az801l07a-vm1 page, select Test migration.
-
On the Test migration page, in the Virtual network drop-down list, select az801l07a-test-vnet and then select Test migration.
Note: Wait for the test migration to complete. This might take about 5 minutes.
-
In the Azure portal, in the Search resources, services, and docs text box, on the toolbar, search for and select Virtual machines and then, on the Virtual machines page, note the entry representing the newly replicated virtual machine az801l07a-vm1-test.
Note: Initially, the virtual machine will have the name consisting of the asr- prefix and randomly generated suffix, but will be renamed eventually to az801l07a-vm1-test.
- Return to Execute > Migrations, and then select az801l07a-vm1 in the Workload column.
- On the az801l07a-vm1 page, select Clean up test migration from the menu bar.
- On the Test migrate cleanup page, select Testing is complete. Delete test virtual machine, and then select Cleanup Test.
- After the test migration cleanup completes, select Migrate from the menu bar on the az801l07a-vm1 page.
- On the Migrate page, ensure that Yes is selected in the Shutdown virtual machines and perform a planned migration with no data loss? drop-down list, and then select Migrate.
-
To monitor the migration, return to Execute > Migrations and review the Execution stage and Execution status for az801l07a-vm1. The workload is tracked in the Completion stage after migration.
Note: Select az801l07a-vm1 in the Workload column to review Migration status and any reported issues.
Task 4: Remove Azure resources deployed in the lab
- On SEA-SVR2, in the browser window displaying the Azure portal, open the Azure Cloud Shell pane by selecting the Cloud Shell button in the Azure portal.
-
If prompted to select either Bash or PowerShell, select PowerShell.
Note: If this is the first time you’re starting Cloud Shell and you’re presented with the You have no storage mounted message, select the subscription you are using in this lab, and then select Create storage.
-
From the Cloud Shell pane, run the following command to list all the resource groups you created in this lab:
Get-AzResourceGroup -Name 'AZ801-L070*'Note: Verify that the output contains only the resource groups you created in this lab. These groups will be deleted in this task.
-
From the Cloud Shell pane, run the following command to display the resource locks created during the migration:
Get-AzResourceLock -ResourceGroupName 'AZ801-L0703-RG' -
From the Cloud Shell pane, run the following command to remove the locks created by Azure Site Recovery:
Get-AzResourceLock -ResourceGroupName 'AZ801-L0703-RG' | Where-Object Notes -like '*Azure Site Recovery*' | Remove-AzResourceLock -Force -
From the Cloud Shell pane, run the following to delete the resource groups you created in this lab:
Get-AzResourceGroup -Name 'AZ801-L070*' | Remove-AzResourceGroup -Force -AsJobNote: The
-Forceparameter suppresses confirmation prompts but doesn’t override resource locks. The command executes asynchronously (as determined by the-AsJobparameter), so while you will be able to run another PowerShell command immediately after within the same PowerShell session, it will take a few minutes before the resource groups are actually removed.