How to Set up Hyper

choubertsprojects

The Best WordPress plugins!

1. WP Reset

2. WP 301 Redirects

3. WP Force SSL

Hyper is a new cryptocurrency focused on high-tech and hybrid mining methods that are more sustainable than traditional SHA256 or Scrypt mining.

Hyper-V is a virtual machine manager. It allows users to create and run multiple virtual machines on a single computer. Hyper-V is available as an installation option in Windows 10, 8, 7, Vista and XP. The “install hyper-v” command will install the Hyper-V Manager tool which can be used to manage these virtual machines.

How to Set up Hyper

Are you in charge of Hyper-V virtual machines (VMs) and want to set up a disaster recovery plan? Hyper-V replication is a good place to start. Things can, and probably will, go wrong. And if you just have a single copy of your virtual machines, you’re in for a world of trouble.

It is not necessary to have one or more clones of your VMs, particularly the most crucial ones. Microsoft developed a built-in replication functionality within Hyper-V that you may use without having to install any third-party software or appliances.

Let’s get started if you’re ready to learn how to configure Hyper-V replication and avoid potentially catastrophic data loss.

Prerequisites

This will be a hands-on presentation in this course. If you want to follow along, make sure you have the following items on hand:

Two Hyper-V host servers are required. These two hosts might be in a domain or a workgroup in Active Directory (AD). The following are the information for the two servers that will be used in this tutorial.

Hostname IP (Internet Protocol) Address Designation Location System of Operation
hyperv-ny 10.1.0.4 The main server The Main Site Datacenter edition of Windows Server 2019 (version 1809)
hyperv-wa 10.0.0.4 Server Replica Secondary Location Datacenter edition of Windows Server 2019 (version 1809)

At least one guest virtual machine must replicate on the main Hyper-V host. The main host will have one guest VM called webserver in this tutorial.

Refer to System requirements for Hyper-V on Windows Server for further information about Hyper-V system requirements.

Preparing Hyper-V Hosts for Replication

Don’t start the Hyper-V replication just yet, assuming you have all of the requirements in place. There are still a few things to complete before recreating virtual machines. The basic things to check off before everything is ready are listed below.

Allowing Replication Traffic in Hyper-V

This part only applies if your Hyper-V hosts are protected by Windows Firewall. If not, go on to the next section.

Alternatively, if you’re already using Windows Firewall and wish to turn it off, see How to Disable or Turn Off Windows Firewall (All the Ways).

Windows adds two new incoming rules to the Windows Firewall when you install the Hyper-V role on the server. These two rules determine whether or not Hyper-V replication traffic is allowed:

  • HTTP Listener (TCP-In) for Hyper-V Replica – Inbound rule for Hyper-V Replica listener to accept HTTP connection for replication (via port 80, not encrypted).
  • Replica Hyper-V HTTPS Listener (TCP-In) — An inbound rule for the Hyper-V Replica listener that allows HTTPS connections to be accepted for replication (via port 443, encrypted with certificate).

These Windows Firewalls are deactivated by default, essentially preventing Hyper-V replication traffic from reaching the host. However, the emphasis of this lesson is on Hyper-V Replication Configuration using HTTPS rather than HTTP.

Follow these procedures to activate the Hyper-V replication firewall rule.

1. Log in to the Server Replica and open PowerShell as admin.

2. In PowerShell, run the Activate-Netfirewallrule command to enable the rule.

# Enable the firewall rule for Hyper-V HTTPS replication traffic. ‘Hyper-V Replica HTTPS Listener (TCP-In)’ Enable-Netfirewallrule -DisplayName ‘Hyper-V Replica HTTPS Listener (TCP-In)’

3. Finally, execute the command below to verify that the firewall rules have been activated correctly.

Get-Netfirewallrule -DisplayName ‘Hyper-V Replica HTTPS Listener (TCP-In)’ Get-Netfirewallrule -DisplayName ‘Hyper-V Replica HTTPS Listener (TCP-In)’

If everything went properly, you should see something like the image below.

Enabling firewall rules for Hyper-V replication Enabling firewall rules for Hyper-V replication

Configuring Hyper-V Host Records

You may skip this step if your Hyper-V hosts can resolve each other’s names via DNS lookup.

When it is time to enable Hyper-V replication, you will specify the Server Replica’s name during the configuration. Whether Hyper-V can find the secondary server by name depends on proper name resolution.

To ensure that the Hyper-V nodes can find each other’s names in the network, you’ll need to edit the hosts file on both servers and add their respective names and IP (Internet Protocol) Addresses. To do so, proceed as follows.

  1. On the The main server, open PowerShell as admin.

2. Open the hosts file in notepad.exe and modify it using the command below.

“$env:windirsystem32driversetchosts” notepad.exe

3. Once the hosts file is open, scroll down to the bottom of the text editor and add the Server Replica’s IP (Internet Protocol) Address and name as follows.

Make sure to use your IP (Internet Protocol) Address and server name instead.

4. After editing the file, press CTRL+S or click File —> Save to save the changes.

5. Repeat the same steps on the Server Replica and add the The main server’s name and IP (Internet Protocol) Address to the Server Replica’s hosts file. The screenshot below shows the side-by-side end state of both server’s hosts files.

The hosts file is being updated. The hosts file is being updated.

Making Your Own Self-Signed Certificates

This part only applies if you’re going to employ certificate-based authentication for your Hyper-V replication (HTTPS). You may skip this part if the Hyper-V hosts are domain-joined and will utilize Kerberos authentication (HTTP).

Hyper-V replication via HTTPS requires that both the primary and replica hosts use a certificate issued by a common issuer. Hyper-V uses these certificates to authenticate the The main server to the Server Replica.

You may produce self-signed certificates for use with Hyper-V replication for free instead of purchasing certificates from an external certificate provider like DigiCert or NameCheap.

Creating Certificates using PowerShell: New-SelfSignedCertificate

Three certificates are required for certificate-based authentication between two Hyper-V hosts. For each host, a root certificate and a server certificate are required. To create these certificates, follow the procedures below.

1. Log in to PowerShell as an administrator on the main host server.

2. Next, use the PowerShell instructions below to specify the variables listed below. To understand each variable, look at the inline comments and change the values as needed.

# Configure the Variables for Certificates ## The new Root CA certificate’s name must be specified. $rootCA Name = ‘Hyper-V Root CA’ ## $rootCA Name = ‘Hyper-V Root CA’ ## $rootCA Name = Names of Hyper-V servers must be specified. @(‘hyperv-ny’,’hyperv-wa’) $hostnames ## What is the password for the PFX certificates that were exported? $CertPassword = ‘a secure password’ | ConvertTo-SecureString -Force -AsPlainText ## After generating the PFX certificate, where should it be exported? Check to see whether this folder exists. ‘C:HPVCerts’ as $CertFolder

3. To produce the root certificate, use the command below once you’ve defined the certificate variables. Using the New-SelfSignedCertificate cmdlet, this command produces a self-signed root certificate in the server’s Personal Certificate store.

## Make a Root CA certificate and save it in the ‘Personal’ certificates storage. ## Valid for a period of ten years. ‘ -Subject $rootCA Name’-FriendlyName $rootCA Name $rootCA Name $rootCA Name $rootCA Name $rootCA Name $rootCA Name $rootCA Name $rootCA Name $rootCA Name $rootCA Name $rootCA Name $root -KeyExportPolicy Exportable’-KeyUsage CertSign’-KeyLength 2048 $rootCA Name ‘ -KeyAlgorithm ‘RSA”-HashAlgorithm ‘SHA256″-Provider “Microsoft Enhanced RSA and AES Cryptographic Provider” (Get-Date). AddYears(10)

4. To make the server trust the root certificate itself, use the command below to transfer the root certificate to the Trusted Root Certification Authorities Certificate Store.

## Go to the ‘Trusted Root Certification Authorities’ store and copy the Root CA from the ‘Personal’ store. $rootStore = [System.Security.Cryptography.X509Certificates.X509Certificates.X509Certificates.X509Certificates.X509 .X509Store] ::new(“Root”,”LocalMachine”) $rootStore. Open(“ReadWrite”) $rootStore. $rootStore.Add($rootCA) Close()

5. Next, run the command below to export the root certificate to a file using the Export-PfxCertificate cmdlet. You need to export the certificate so that you can copy it to the Server Replica later on.

## Create a backup of the Root CA -FilePath “$CertFolder$($rootCA Name).pfx” -Password $rootCA | Export-PfxCertificate -FilePath “$CertFolder$($rootCA Name).pfx” -Force $CertPassword

The Root Certificate is exported. The Root Certificate is exported.

6. Create server certificates that are signed by the root certificate you just made. To produce server certificates for each Hyper-V host and export each certificate to a file, use the command below.

$hostnames | $name = $ ## $name = $ ## $name = $ ## $name = $ ## $name = $ ## $name = $ Make the certification. -FriendlyName New-SelfSignedCertificate -KeyExportPolicy Exportable’-CertStoreLocation “Cert:LocalMachineMy”‘-Signer $name’-Subject $name’-Subject $name’-Subject $name’-Subject $name’-Subject $name’-Subject $name’-Subject $name’-Subject $name’-Sub ‘ $rootCA’-KeyLength 2048′-KeyAlgorithm ‘RSA”-HashAlgorithm ‘SHA256″-Provider “Microsoft Enhanced RSA and AES Cryptographic Provider” (Get-Date). ## ## ## ## ## ## ## ## ## ## ## ## The certificate should be exported. -FilePath “$CertFolder$($name).pfx” -Password Export-PfxCertificate -FilePath “$CertFolder$($name).pfx” -Force $CertPassword

The server certificates are generated and exported. The server certificates are generated and exported.

7. Finally, copy the root certificate file (Hyper-V Root CA.pfx) and the Server Replica certificate file (hyperv-wa.pfx) to the Server Replica.

The certificate files are copied to the replica host. The certificate files are copied to the replica host.

The Certificates are Installed on the Replica Host

The identical root certificate and server certificate must also be present in the replica host for certificate-based authentication to operate across the two Hyper-V hosts. To install the root and server certificates, follow the procedures below.

1. Log in to PowerShell as an administrator on the replica server.

Use the Import- PfxCertificate command to import the root certificate into the Trusted Root Certification Authorities repository. Make any required changes to the variable values.

## The Root CA certificate’s name must be specified. ## Where to get the PFX certificate files. $rootCA Name = ‘Hyper-V Root CA’ $CertFolder = ‘C:HPVCerts’ ## $CertFolder = ‘C:HPVCerts’ What is the password for the PFX certificates that were exported? ConvertTo-SecureString -Force -AsPlainText $CertPassword = ‘this is a strong password’ | ConvertTo-SecureString -Force -AsPlainText $CertPassword = ‘this is a strong password’ Import-PfxCertificate “$CertFolder$($rootCA Name).pfx” -CertStoreLocation Cert:LocalMachineRoot -Password ## Import the Root CA Import-PfxCertificate “$CertFolder$($rootCA Name).pfx” -CertStoreLocation Cert:LocalMachine $CertPassword

The root certificate is being imported. The root certificate is being imported.

Related: [Tutorial] Managing Certificates with Windows Certificate Manager and PowerShell

3. Run the command below to install the server certificate into the Personal Certificate store.

Import-PfxCertificate “$CertFolder$($env:COMPUTERNAME).pfx” -CertStoreLocation Cert:LocalMachineMy -Password Import-PfxCertificate “$CertFolder$($env:COMPUTERNAME).pfx” -CertStoreLocation Cert:LocalMachine $CertPassword

The server certificate is being imported. The server certificate is being imported.

4. Finally, deactivate the checking for certificate revocation in the Hyper-V registry. Hyper-V will not attempt to validate the certificate’s revocation information, since the self-signed certificate lacks them. Use the PowerShell command New-ItemProperty to create a new item property.

## Turn off the Hyper-V Certificate Revocation Check feature. HKLM:SOFTWAREMicrosoftWindows NTCurrentVersionVirtualizationReplication -Name “DisableCertRevocationCheck” -Value 1 -PropertyType DWORD -Force DWORD -Force DWORD -Force

Get-ChildItem: Listing Files, Registry, and Certificates is related to Get-ChildItem: Listing Files, Registry, and Certificates.

Hyper-V Replication Configuration

You’ve completed the preparation of your Hyper-V hosts. You may now enable Hyper-V replication and begin duplicating virtual machines.

Enabling the Host as a Server Replica

Before a Hyper-V host can host VM replicas, the host must be enabled as a Server Replica first. To do so, proceed as follows.

  1. Open the Hyper-V Manager on the replica host. To do so, use PowerShell to execute the virtmgmt.msc command.
  2. While in the Hyper-V Manager window, right-click the Server Replica name and click Hyper-V settings.

Toggle the Hyper-V options on. Toggle the Hyper-V options on.

3. On the left pane of the Hyper-V settings window, select Replication Configuration.

On the right pane, check the box that says Enable this computer as a Server Replica. Doing so will enable all the other configuration options below.

Check the User certificate-based Authentication (HTTPS) box in the Authentication and ports section. 443 is the default port number.

Allowing the server to act as a replica Allowing the server to act as a replica

4. Select Certificate from the Authentication and Ports section. Confirm that the certificate is correct in the Windows Security pop-up window, then click OK.

The server certificate must be chosen. The server certificate must be chosen.

After you’ve selected the certificate, the Specify the certificate box should now display the certificate information.

Details of the certificate Details of the certificate

Note: If there is no valid certificate or the certificate has not been installed properly, you may see an error similar to the one shown below. If that’s the case, you’ll need to reinstall the certificate.

There is no valid certificate, according to the error. There is no valid certificate, according to the error.

5. Select Allow replication from any authenticated server under Authorization and storage. As long as the certificate-based authentication is effective, any Hyper-V server may replicate VMs to this server.

Select Enable replication from the selected servers and enter each server’s information instead to allow just particular servers to replicate.

Enter or explore the place where the replica files will be stored. The storage location in this case is C:Hyper-VVirtual Hard Disks. Make sure you choose a place that has enough storage space for the VM replica files.

To save the changes, click OK at the end.

Authorization and storage options Authorization and storage options

Replication of Virtual Machines Enabled

You’ve made the replica host accept inbound Hyper-V replication for VMs so far. You’re now ready to activate replication for a VM. To continue, follow the instructions below.

1. Open the Hyper-V Manager window on the main host.

2. Next, in the left pane, choose Hyper-V server. Select the VM you want to replicate from the list of VMs and click Enable replication in the Actions window.

Choosing a virtual machine for Hyper-V replication Choosing a virtual machine for Hyper-V replication

3. On the Enable Replication for <VM name> windows that popped up, click Next on the Before you begin page.

4. On the Specify Server Replica page, type the Server Replica’s hostname in the Server Replica box, and click Next.

Specifying the target Server Replica Specifying the target Server Replica

5. Now, on the Specify Connection Parameters page, change the Server Replica port number to 443.

Select User certificate-based authentication from the Authentication Type drop-down menu (HTTPS).

At this time, you’ll see that the certificate information is blank. Click Select Certificate to select a certificate.

Specifying the authentication type and port Specifying the authentication type and port

6. On the Pick certificate dialog box, click to select the certificate that carries the primary host’s server name that you previously established. Click OK after choosing the certificate.

The server certificate must be chosen. The server certificate must be chosen.

7. You should now see the certificate details, as seen below, once you’ve chosen the certificate. To continue, click Next.

Confirming the Details of the certificate Confirming the Details of the certificate

8. Next, select which Virtual Hard Disks (VHD) to include in the replication. If there is more than one VHD, make sure to select the VHD containing the VM’s System of Operation. The example below only has one VHD. After making your selection, click Next.

Choosing which VHDs to copy Choosing which VHDs to copy

9. On the next page, choose the replication interval from the dropdown list. This value determines how frequently Hyper-V sends changes to the Server Replica. The default interval is 5 minutes. Other available options are 30 seconds and 15 minutes. Click Next.

Choosing an interval for Hyper-V replication Choosing an interval for Hyper-V replication

10. Select the option to Maintain just the most recent recovery point on the Configure Additional Recovery Points screen.

Choosing this option, Hyper-V will only maintain the VM’s latest recovery point or state on the Server Replica. This option uses the least storage space but only enables a single point in time recovery. Click Next to proceed.

Choosing which recovery points to keep Choosing which recovery points to keep

11. On the Choose Initial Replication Method, there are three options on how you want to send the initial copy of the VHD to the Server Replica:

  • Over the network, send the first copy. The VHD is copied across the network using this option.
  • Send initial copy using external media. Choosing this option allows you to save the VHD copy to external storage, such as an external hard drive. You can then physically transport the storage and attach it to the Server Replica for copying.
  • Use an existing virtual machine on the Server Replica as the initial copy. This option is applicable only if you’ve already restored a copy of the VM to the Server Replica.

In the actual world, the choice you pick is determined by your evaluation. However, for the sake of this tutorial, choose Send first copy across the network.

Select Start replication immediately when you’ve done setup to begin the replication process right away.

Choosing a replication technique for the first time Choosing a replication technique for the first time

12. Review the replication setup on the Summary screen before clicking Finish to finish.

Putting the replication setup together Putting the replication setup together

13. Wait for the notification confirming that Replication has been activated successfully. To return to the Hyper-V Manager window, click Close.

Hyper-V replication replicates the virtual machine, its configuration, and VHDs. But the resulting replica on the Server Replica is not connected. As you can see below, you still need to configure the replica VM’s network connection.

Confirming that replication has been turned on. Confirming that replication has been turned on.

Examining the Replication’s Health

So you’ve enabled Hyper-V replication for the VM you’ve chosen. How do you know if the Hyper-V replication is still running, finished, or failed? Fortunately, Hyper-V allows you to monitor the replication status directly from the Hyper-V Manager.

Follow these steps to verify the health of the VM replication.

Right click the VM name on the primary host Hyper-V Manager window —> Replication —> View Replication Health.

Checking the replication health of the VM Checking the replication health of the VM

You’ll receive a Replication State notice at first, as seen in the picture below, indicating that replication is still in process.

The first replication is in the works. The first replication is in the works.

You should receive a notice similar to the one below after Hyper-V replication is complete.

And that's it! You've successfully set up Hyper-V replication for your VM. That’s all there is to it! Your VM’s Hyper-V replication has been set up successfully.

That’s all there is to it! Your VM’s Hyper-V replication has been set up successfully.

Related: PowerShell Getting Started Guide for Managing Hyper-V VMs

Conclusion

Finally, system administrators should think about setting up Hyper-V replication when planning and performing disaster recovery. It may be less costly than losing data or experiencing lengthy service outages. Consider what would happen if your payroll server went down.

Have you experimented with Hyper-V replication? What were your thoughts on it? Would you suggest it to others, or do you feel there are any reasons why businesses should avoid it?

Hyper is a technology that enables virtualization of the computer. Hyper-v is a Windows 11 feature that allows you to create and run virtual machines. Reference: hyper-v windows 11.

Related Tags

  • enable hyper-v
  • enable hyper-v windows 10
  • what is hyper-v
  • how do you set up a virtual machine on windows 10
  • hyper-v manager

Table of Content