Azure Migration 2/4: Deploying a Replication Appliance on a physical Windows Server

Hi, This is the second article about using Azure Migration to migrate PCs. I will introduce how to deploy a 【Replication Appliance】 on a physical machine. Then I will write another article about the steps of replication and migration using the Replication Appliance I built in this article. After that, we need to delete apps of Replication Appliance from the physical machine.

So, we will eventually have four articles about Azure Migrate.
1. [Azure Migration 1/4: Using Azure Migrate discovery and assessment function](https://qiita.com/SatoshiKaneshiro/items/319180e3f1141fcde113) **(Published)**
1. Azure Migration 2/4: Deploying a Replication Appliance on a physical Windows server **(this article)** 
1. Azure Migration 3/4: Replicating and migrating a physical PC to Azure VM
1. Azure Migration 4/4: Clean up about replication appliance-relevant apps and Azure Migrate Project Resources

OK, now let us get started.

---
### ■ Agentless migration and Agent-based migration

We can use Azure Migration to migrate **VMs on VMware** or **VM on Hyper-V** and **physical machines** to Azure VM. Even **VMs from other public clouds (like AWS and GCP)** are also supported by Azure Migration.

**Below, you can find further details in the accompanying documents**

https://learn.microsoft.com/en-us/azure/migrate/migrate-support-matrix-vmware-migration

https://learn.microsoft.com/en-us/azure/migrate/migrate-support-matrix-hyper-v-migration

https://learn.microsoft.com/en-us/azure/migrate/migrate-support-matrix-physical-migration


Azure Migration provides two migration types that depend on the target PCs' environment. One is **Agentless migration**, and the other is **Agent-based migration**.

VMs on VMware can use Agentless migration, meaning Replication Appliance is unnecessary, and the migration process is more straightforward than Agent-based migration. Still, the VMs and VMware environment must meet some pre-requirements.<br>※Hyper-V doesn't need Replication Appliance, eith. But its migration is different from VMs on VMware.

If the requirements can not be met or the targets are physical machines, then we can only use the Agent-based migration, which means a Replication Appliance installation is needed.

---

### ■ Replication Appliance

In this article, we plan to migrate a physical PC to Azure VM, so we need a Replication Appliance to provide mediation between Target PCs and Azure Migrate.

**Here is the document about Replication Appliance↓**
※including requirements, access information, and images.

https://learn.microsoft.com/en-us/azure/migrate/migrate-replication-appliance#overview

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/76fdde3f-fa0d-6b2e-0feb-dc0102ac73ba.png)
|:-:|

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/51104d1f-1ebb-9ce1-0ee3-4f4d2aaa8484.png)
|:-:|

### ■**Network Diagram**

Here is the network diagram. Azure migration resources on Azure were deployed when I wrote the first article about Azure Migration. My home network and PCs are used as the on-premises environment, and it connects with Azure through an S2S VPN connection. 

Replication Appliance-relevant apps will be installed on a PC running Windows Server 2016 (highlighted in red) on the on-premises side.

Please remember that Replication Appliance (RA) needs internet access to communicate with Azure Migrate Cloud, even if you are about to use Private Link.

|![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/4a1b76aa-cb22-0de2-9f8f-0363ed7d44d4.png)
|:-:|

### ■ **Procedure**

Below is the main procedure for deploying a RA.
※Most of the operations occur on the Windows Server.
**1. Register a RA on Azure Migration and download the installer of RA**
**2. Install RA on a PC running Windows Server**
**3. Finish the registration of RA on Azure Migration**

Some of the detailed operations of Azure Portal will be skipped. If you have any problem with the procedures, please refer to my 1st article of Azure Migration → [here](https://qiita.com/SatoshiKaneshiro/items/319180e3f1141fcde113) 

---

#### Part 1. Register a RA on Azure Migration

**Recommend directly operating the steps below on the RA Windows Server because an installer that is approximately 500MB needs to be downloaded and installed on it.** 

1. Open Azure Portal and access the Azure Migration Project
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/b0d67bec-2161-bc7e-8f67-dd069ec77739.png)

2. Move to [Migration Tools] and click [Discover]
If Azure Migration Assessment's discovery has been made once or more, the number of discovered PCs could be displayed in the [Discovered servers] in both Assessment tools and Migration tools. 
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/41621d73-2040-4668-ccd1-4cc8510742f4.png)

2. Choose "Physical or other (AWS, GCP, Xen, etc.)"
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/b951a558-c0fc-a259-4b23-7d8d47301d1b.png)

2. Choose the target region where the migrated Azure VMs will be located, then don't forget to check the checkbox and click [Create resources]
<font color="Red"> **Attention!**
Once the target region is fixed, it can not be changed later. So **choose it carefully**.</font>
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/38935e06-4818-a009-502c-b5df464648d8.png)

2. Choose "Install a replication appliance" and click "Download" in Step.1 to download the installer in the local folder.  <font color="Red">(Not the Step.2's Download button)</font>
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/81de6f52-99cb-b2af-da6e-6c29e490a0af.png)

2. Click the Download button in Step 2 to download the registration key, which is necessary while installing the RA.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/e515d370-aa16-2124-cbc5-196bc1b95288.png)

Registering a RA on Azure Migration is over here, and we will talk about how to install a RA in the following procedure.

---

#### Part 2. Install RA on a PC running Windows Server

The operations below should be done on a PC running Windows Server.
Further details about the requirements of RA can be found in the document below.
<font color="Red">**Attention!**
The locale of the Windows Server must be **English**. Installing the English language package on other locale OS doesn't work.</font>

Referring to the requirement mentioned below, the version of Windows Server should be 2022 or 2018 R2, which looks wired. I tried it on Windows Server 2016, and it does work. And 2019 will work well, either.

https://learn.microsoft.com/en-us/azure/migrate/migrate-replication-appliance#appliance-requirements

---

1. Double-click the installer
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/b86f8ed9-4b6c-9f90-4862-cb0346e48235.png)

2. Choose "Install the configuration server and process server" and click [Next]
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/d43d6d26-9838-f434-6bbb-07680f71c981.png)

3. Installer needs to install MySQL. If MySQL has been installed on the PC, check "I accept the third party license agreement" and click "Next".
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/e34703e3-4732-486b-7f9c-30f9ea1fc02b.png)

 **#3-1: If you want to install MySQL, follow the steps below.**
I. Click "Direct Download Link" to download MySQL's installer.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/222bb07c-8891-ccb6-60da-864933b03743.png)

II. Move the installer to C:\temp\ASRSetup\  (Create the folders if they don't exist)
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/edbe7f39-9fa2-a89a-e483-924c6a7473ad.png)

III. Do Step 3, and the RA installer will install MySQL automatically.<br>

=========
4. Locate the registration key(a .VaultCredentials file) that is downloaded in Part 1-Step 6.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/ef8a1c47-88c3-5740-2f0c-598efbaa6781.png)<br>
5. To connect to Azure Site Recovery(ASR) through a proxy server, choose the second option and provide the server's information. Here I will connect to ASR directly, so I choose the upper option and click [Next].
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/460549fe-95f7-9089-e337-6ba35e376508.png)
6. The installer will verify the connection to ASR.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/37f040fe-a585-35ca-de76-8ba35087c8b2.png)
7. Then, the installer will check pre-requirements automatically. If there is no failure in the result, click [Next] to move on.
※Having a warning on the three items below doesn't mean failure. It just means that the performance on this PC may be lower than on PCs that meet all the pre-requirements.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/01b38e67-25ff-454d-f1b5-86dec4ad74cf.png)
8. Set MySQL root user's password and click [Next].
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/d71eb7c2-d797-2d24-ef55-e0c034a95a72.png)
9. Considering choose "Yes" when migrating a VM on VMware to Azure VM. I chose "No" this time because the source is a physical PC.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/510086e8-b21c-ffbe-89a0-22b73e573d85.png)
10. Set the install location and click [Next].
It still works even if the destination disk's free space is lower than 600GB, which the installer recommends, but the performance as a RA may be lower than normal.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/597c6c0c-e64a-32d6-5ff9-7e6bba96ce9a.png)
11. Set the NIC(Network Interface Card) for each purpose. Selecting the same NIC works.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/cc2f125c-eec8-4a07-983e-9aa1b22f8fe9.png)
12. Click [Install]
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/fa8dd441-57d0-27cc-cbf4-cb061d541ae7.png)
13. It takes a few minutes(approximately over 20 minutes) to finish installing all components.
※Perhaps, it is because the PC's CPU and Memory do not meet the requirements, so it takes more time.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/0468884c-ec60-8097-7d5c-c217fdb772a0.png)
14. After installation is finished, click [Finish].
※Double-clicking each component's status can confirm its logs.  
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/19f8ed81-bbd4-5659-f360-db5956d10dba.png)
15. Click [Yes] to copy the Configuration Server Connection Passphrase to the clipboard.
※This Passphrase is necessary to register target PCs to Azure Migrate through this RA.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/eaf2b4f8-daeb-74c2-6fa3-d022682b2b44.png)
16. Create a new text file and save the passphrase.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/db5d16fa-612d-62b6-d32f-109fc67a7b61.png)
17. After the installer is closed, the Azure Site Recovery Configuration Server's configure window will be opened automatically. The same window can be opened by double-clicking the icon named "hostconfigwxcommon."
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/fd057a61-0e0f-e6ee-dc2d-2fb4e975b416.png)
18. Create accounts (one or more) with administrator permission that can access the target PCs. (This time, I created an account) 
※These accounts are necessary when replicating and migrating target PCs, and I will talk about them in the next article.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/e4489449-de49-9597-b1bc-50da132bc275.png)
19. Click [Close] when finishing registering accounts.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/efc34ebd-17ef-e41e-6833-1746eaa13209.png)

It's all about installing a RA on a Windows Server PC. It is a long trip, and there will be some trouble during the installation. Azure Migrate provides troubleshooting for each part of the migration, and the solution can be found here in most cases. I will explain how to access the troubleshooting links at the end of this article.

---

#### Part 3. Check the RA status on Azure Migration

After finishing the installation of RA on the Windows Server PC, finally, we need to register the RA on Azure Migrate to complete the work.

Let's move back to Azure Migrate on Azure Portal.

1. Click the [Discover] in [Migration tools] 
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/f5693c1e-0078-f5f6-0dc4-63e4de8dbcee.png)

2. Choose the same options in the first two boxes, as I have explained in Part 1. Then, the name of the RA(Windows Server PC) should be listed in the last box if the installation finished successfully in Part 2.
※If the name doesn't exist in the list, restart the RA(Windows Server PC), wait for about 5 minutes, and then click the [Refresh] on Azure Migrate to try again. 
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/c5bb0f08-bfe3-5191-d0bc-722fefca8bd1.png)

**＜Refresh icon＞**
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/c179e250-d341-6ed5-ddad-7242e6bf705d.png)
3. Choose the RA(Windows Server PC)'s name and click [Finalize registration].
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/6a9a4704-c113-ceb6-53d1-0235884be06b.png)
4. A message will be displayed next to the box if the registration is finished successfully.
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/80b3b403-926c-eacc-d99c-5a6feb8cedc8.png)


All operations have been finished now. The Windows Server PC with the Replication Appliance has been appropriately connected to Azure Migration and recognized by Azure Migrate.

The next article is about how to replicate and migrate a physical PC to Azure VM through the Replication Appliance I deployed in this article.

### See you next time!

---

### Part: Troubleshooting links

Troubleshooting tips about each part of Azure Migration can be found in the links below. 

**Click [Diagnose and solve problems] from the side menu.**
![image.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/2985687/26999c13-df2c-4fd8-4b65-3da2e9fcc98b.png)