How to configure Hyper-V Replication on Windows Server 2012 R2 (Explained)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello friends the snick from adobe solutions and today i'm going to show you how you can enable hyper-v replication on Windows Server 2012 r2 basically the hyper-v replication was introduced in Windows Server 2012 with the hyper-v ro installed and if you want some more information about it you can try to find there are a few good articles over the internet on TechNet for example regarding the hyper-v replication and what it can do but just in general it is a way for us to to configure our business continuity and disaster recovery and help in the event of any disaster that can happen within our environment for example so it's always a good idea for us to replicate the machines between sites if that's possible for you because in that case if something happens yeah we in one of the sites you can always power on the Virtual Machines the replicated virtual machines on the on the other host and bear in mind that I'm talking about huge disaster where you cannot power on the servers in your core in your site that experienced the disaster recovery because after all when you power on the replica machines and they will be start they will start working as a normal servers they will continue your operation and if the other machine is the primary machines start as well it can make some issues for your environment so bear in mind that this replication needs to be done it needs to be utilized only in the event of a critical disaster for example your hosts is not working at all in the primary site and you would you have a lot of downtime fixing that or your hosts cannot be fixed for example so I'm going to start by logging into one of my hyper-v hosts and so within that host I have configured three machines three virtual machines two of them are the domain controllers that I've cloned in one of my previous videos and I've configured one additional machine which is the file server for that domain which I'm going to replicate to my other host so I think that I should mention that it's always a good idea for you to replicate machines that are only important for you to replicate because for example you can of course replicate all the all the roles within your environment but if you think for a moment a domain controller replication for example first it's not always a good idea for you to bring a domain controller from a replica or bring it for or restore it from a snapshot because that can make huge issues with with the database of the of the domain controller and can add additional problems when other domain controllers are trying to speak that which is back in time basically so you need to try and identify in your environment what could be a proper server that you can replicate and you can power on later and most of all most of you you should know that it's always a good idea to have at least one or two domain controllers per site and that does not include always virtual machines it's always a good idea if you can of course you have a physical domain controller within a site if the site is is large enough of course if it's a small site it can be left without any any disease but in this case I'm going to use my file server which I don't have any information on it at the moment this is just for testing purposes of course but I'm going to use this file server to replicate so I can show you what's the the general idea behind the replication and how you can you can achieve that so there are a few prerequisites that we need to configure in order for us to enable the replication between the two hosts and the first one is to enable the replication on the replica server so if I go here under hyper-v settings and go into replication configuration I can see that there is an option for me to enable this computer as a replica server this is not enabled by default and you need to enable that after you install your hyper-v and please note that if you enable this server as a replica that means that it will be able to receive replica machines from other hyper-v hosts if you are sending this for example like I'm sending my machine to my first host this option does not need to be enabled but just in case I'm going to enable that and when you enable that you have several additional options that you need to configure and you need to configure the authentication and ports basically you have two options here first is to use the Kerberos which is a building protocol used by Active Directory and you can specify a custom port or you can choose the port of 80 which is the default one and the other and the other option that you have is to use HTTPS but this option you need to add a certificate and of course you can use a self-signed certificate but this certification is to be imported in both machines or you can use a third-party certificate for that it depends on your environment but just for this testing lab I'm going to use the normal one Kerberos which does not require any additional certificates or configurations to be done the other option is to allow only a specific server to replicate you receive replicas from and this can be added of course you can choose what is the primary server that you are going to do add and note that hyper-v replication does not require the computers to be domain to being in one domain so you can specify primary servers from different domains and different trust groups and in there you can specify where to store the replicas the replicas files and what does me that means is when the primary server sends a replica this is the default location that all the virtual disks will go all the configurations for the virtual machine all the snapshots if you configure snapshots to replicate as well so I'm going to choose to a lower application from any authenticated server and I'm going to choose a different location you need to be more careful with the replication because the storage can grow a lot with replication both on the replica server and bolt on the primary server so I had issues in the past where by using dynamically expanding disks on the virtual machines with enabled replication caused a lot of issues for the hosts because as the disk grow and if they are over provisioned they can grow on the replicas server as well which can cause problems for the virtual machines to run on that host and a you have a problem with virtual machines going into safe state or post state or be you have more serious problems with the host running out of space if you are using the C Drive where the operating system is and the host just not functioning at all and you have problems with all the virtual machines so what I recommend doing here is storing the virtual machines because the default location is the C Drive it's always a good idea to store the virtual machines away from the C Drive store them on a different partition and this is a general rule not only for hyper-v always try to move important applications important roles that you are running for example if you have a sequel server or hyper-v in this case or any other applications that require space try to move the databases or try to move the files and this is during the initial set up to other partitions so here I can create a new folder for example and name it replica and select that folder so here I have enabled if I click apply and another perico's it it will tell me is that I need to enable the in bulk DCP exception for port 80 this is our next break we see that we need to configure and it's good of Microsoft of showing this because you can enable the hyper-v replica and if you do not configure the port port 80 to listen and to be allowed it will fail to replicate the machine so this is always nothing that you need to check before you start the initial virtual machine replication I'm going to click OK to this message and I'm going to open my control panel and from there Administrative Tools I'm going to open Windows Firewall with advanced security in there I can check the inbound rules and if you scroll down you should see the hyper-v replicas port there it is Kappa B replica HTTP listener and as I am using the HTTP port 80 to listen I'm going to enable only this row if you are using the HTTP with certificate you need to enable the other port so I'm going to enable the rule and now my server is okay for me to replicate a virtual machine and what I'm going to do is I'm going to hop on to my first host and in there I'm going to configure the same settings I did on the second one and I did this on the second one I'm going to replicate my file server to my first host so basically I don't need the settings to be enabled on the second host but this is just for testing purposes so I just wanted to show you how you can do it so I'm going to click and enable the server in the replica server use Kerberos once again and once again I'm going to specify a different location for my virtual machines in here I'm going to add another replica folder okay apply it will say that I need to enable the port once again okay so I'm going to go to control panel and open Windows Firewall with advanced security inbound rules and once again hyper-v replica listener port enable the rule and I'm good to go with the hyper-v replication so I'm going to switch now to my second host I'm going to right click on the virtual machine that I want to replicate and right before the bottom held option you will see enable replication option if you fire up this option it will bring up another wizard which in here you can configure all the settings for your hyper-v replication so I'm going to click Next to this message and in here I need to specify the replica server and my replica server will be my first host I have configured the settings there it should be good to go and I'm going to browse and you can see that it's looking within my active directory for the replica server so this is going to be NLB I'm not able to write this time host 1 okay so my replica server is enemy hole 0 1 I'm going to click Next it's going to search for that host it's going to verify the configuration to see if the hosts are compatible and can work together to host a replica between them let's see if that will be successful okay now now that it found the host it found the port that it is going to use and so right on the bottom because as I said usually you use the replica the replica hyper-v replica settings if your have hosts in different locations of course you can configure them to be intra site replication what that means is that the host can be within one building for example within one side and you can do land replication between them so you can have another way of securing yourself if something happens with a single host only but if you have a problem with the site you still have a problem so this compressed data that is transmitted over the network will help you to lower the bandwidth of replicating the virtual machines but after all you need to consider because if you have virtual machines that are for example half of terabyte 500 gigabytes in size you can have bigger machines it will take a lot of bandwidth so you need to plan before that to see if your network will function within the if you decide of course to replicate the initial replicas over the network so this option I will leave enabled and click Next and here you can specify which VHDs which virtual disks of my virtual machine I want to replicate I have only one in this case so I'm going to select that and click Next and here you can specify the check the frequency of your replication so you have three options you have every 30 seconds the virtual machines from from this host host to will send information to you the other host and as you can understand this will take more bandwidth but if you have a lot of changes going on to the virtual machines that you're replicating it's always a good idea for you to lower the frequency and if you have a good bandwidth of course because if you have a lot of changes for example a lot of changes are going on Virtual Machine maybe five minutes can be a lot of data loss for you if something happens with that virtual machine so you can specify 30 seconds you can specify 15 minutes if that machine is not used you can specify 15 minutes so you can still have the replication look you can lower the bandwidth between the sites and the bandwidth traffic and that way you can be sure that 15 minutes of data loss cannot be so critical for your environment so I'm going to stick with the five minutes and click Next and here you have to to configure the additional recovery points so as I mentioned you can of course go ahead and replicate snapshots of the virtual machines you need to consider the environment that you have the virtual machines if you maintain snapshots of the virtual machines you can configure them to be replicated as well but I don't have this I don't have any snapshots so it's going to maintain only the latest recovery option I don't have any snapshots but you can configure them so you can configure the additional snapshots as well so I'm going to stick with the default one and click Next and as I said there are several methods of initial replications the first method I mentioned is send the initial copy over the network and you need to consider that because it will take some some of your bandwidth traffic and if you have a lot of during the day for example if you have a lot of a lot of people working and you have a lot of applications that are network dependent it's not always a good idea to send the initial replication over the network immediately like you can see the initial replication for example you can configure the replication to be sent overnight so that when no one is working on-site you can configure to start the replication for example at let's say let's say 8 p.m. so that way it cannot affect your working hours and it will send the replication traffic and again depending on your bandwidth it can take a lot of time to replicate the virtual machines so you need to be careful with this because for example if you start that at 8 p.m. and you can you can say to yourself well it's ok I will send it during the night but your traffic is for example 10 megabits and your machine is 500 gigabytes you can end up in the morning and you can see that the the replication is at 20% and your bandwidth is pretty poor between the sides and people start working and they cannot log into their applications and they come in to you and say what's going on I cannot work today and you need to be careful with that of course you can send the initial replica using external media so you can attach for example a hard drive and you can export basically the virtual machine into that hard drive and you can go ahead and travel to the other side and you can add the the the exported virtual machine and it will start replicating only the changes that happen between that time when you exported the virtual machine and the time that you added the virtual machine to the other host so this is another way to do it but it could be key because you can you can lose the hard drive something can happen with that hard drive it can get stolen and it's not always the best idea the third option that you have is use an existing virtual machine on the replica server so personally in the production environment I haven't used this option and you need you to bear in mind that the replication between the hosts can can stop for some reason maybe you have a network outage in one of the sides and then you have the problem or where you have you already replicated the machines but the replication stop the internet stopped at the site the replication stopped and you need to re-enable that replication but there is a specific time frame that you can you can start another with synchronization between the virtual machines there are in the past I have few problems with the replication not working for a few days and then it will say that it cannot resynchronize at all and you need to start it from a new one you need to remove the replicas and then create another replica so this is this is another option that you can use to reschedule the replicas and you can have if you have for example a virtual machine that you had replicated in the past but it's not working anymore with this option it will find the virtual machine and it will try to synchronize the latest changes to it but as I said I'm going to use the initial copy over the network start the replication immediately click Next it will show me a small summary and I'm going to click finish okay so we took configure the settings and we'll say that the replication enabled successfully I'm going to close that and I can see that it's currently setting sending the initial replica over the network so I'm going to switch my hosts and I'm going to log in once again and I can see that it automatically created the replica between my two hosts and if I go ahead and open my partition where I specified the replica I can see that it started replicating all the changes so you can see that currently the virtual disk is being replicated let me just lower that down so you can see the percentage the virtual disk is being replicated and it's happening really fast because my environment is on a single location so it's not travelling to a one connection it's basically in a single site but just for testing purposes so I can show you and yeah let me just yep it's happening really fast so I'm going to leave it to finish okay and you can see that right on the bottom when you when you highlight the virtual machine right on the bottom you have several tabs and the last step is replication and during the the initial replication it's saying that the replication State is sending initial replication it's saying that it's with warnings and now that it finished it fully finished synchronizing the virtual machine it's showing that the replication health is normal it's enabled at the moment the replication mole is replicas you can see which is the primary server and which is the replica server you can see the last synchronization date and time and if you have problems with the synchronization they will appear under the status and every five minutes or every thirty seconds or 15 minutes depending on your configuration you will see that the hyper-v is sending information to the replica server and it's synchronizing basically the two machines and if you have any problems with with with the virtual machine you can always if you right-click on the virtual machine you you will see a tap replication and in here you can see our replication help and it will provide you more information on what is the state of the develop the replicas maybe you can you will need to maybe that the replication was post and you will need to resume that you have when you right click and replica you have the option to resume replication you have NT to basically say what is the state what it will need to do maybe it needs to fully as we synchronize the virtual machines and it will take a lot of time and depending of course on your network it needs to resynchronize the to machine so basically this is a general overview of how you can enable hyper-v replication between two hosts and I hope that it can help you within your day-to-day job and thank you very much for viewing and see you soon
Info
Channel: NLB Solutions
Views: 48,839
Rating: undefined out of 5
Keywords: HyperV Replication, Hyper-V Replication, Hyper V replication, Hyper-V Windows Server 2012 R2, How to configure Hyper-V, How to enable Hyper V, Configure Hyper-V 2012 R2, Enable Hyper-V 2012 R2, What is Hyper-V Replication, Windows Server 2012 Hyper V, Windows Server 2012 R2 Hyper-V Replica, Hyper-V Replica 2012 R2
Id: 6C1tokQitYM
Channel Id: undefined
Length: 27min 13sec (1633 seconds)
Published: Sat Mar 26 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.