Veeam Backup & Replication - Virtual Machine Migration from Hyper-V 2008 R2 to 2012 R2

    One of the most important features of Hyper-V 2012 is its replication feature. It allows you to make a working copy of a virtual machine (replica) on another server in a few minutes. Unlike the “classic” disaster recovery scenarios, a replica can be used to migrate a virtual machine (VM) to a new infrastructure or to another domain.



    But what if the old server is running Windows Server 2008 R2? How then to move the VM to the new Hyper-V 2012 R2? If you don’t want to pay, then you can use the standard “export / import” procedure, but such an operation may take several minutes for each VM, depending on the speed of the disks where the data is exported.



    Another way is to use Veeam Backup & Replication, which allows you to create a task for replicating VMs (Replica Job) even if the OS versions of the source and remote hosts are different.






    The first step is to install a driver on each host that includes a Change Block Tracking (CBT) mechanism. After that, you can begin to create a task for VM replication.





    Next, you need to create a name for the task, select the VM, which (s) must be copied from the source host.





    Then you need to select the destination server where replication and the location of the VM files are performed.





    Next, select the suffix for the replica name and the number of restore points, the restore point (the point may not be the very last, since our goal is to migrate the VM, and not restore the latest working version).



    After this step, you need to choose whether to use the Volume Shadow Copy (VSS) service. The service is needed to ensure data consistency and is critical when working with VMs, which use applications that conduct transactions with the database (SQL, Exchange, AD, etc. ...)





    Then select a work schedule and activate the task. The VM will become available in a few minutes on the new host (depends on its size and host performance). That's all! You can turn off the VMs on the old server, deactivate the task for replication, and turn on the VMs on the new host.



    Perfect replica


    It is clear that the classic replica is not good enough, since such an operation cannot be performed during the working day, therefore it is very important to follow the right strategy. My recommendation here is to use 2 tasks for replication: one early in the morning, and the second late at night. This will reduce the replication “window”. It is important to remember that such an operation should be done outside of working hours, possibly during the weekend, when there is more time to resolve unexpected problems.



    Replica vs Backup


    Why is a replica better than a backup? Only because the replica creates an ideal copy of the VM on the new host, and this can be great if you plan to change the main infrastructure (server and storage). The replica also makes it possible to reduce the time it takes to complete the operation, since you only need to add the newly changed data blocks when the backup job takes time to restore the VM to the new host.



    Job automation


    Another “trick” in Veeam Backup & Replication is the ability to use Windows PowerShell snap-in, which allows you to automate various processes without using a UI. The tool will have to be especially to the place when there are many customized tasks at the disposal or repeated actions are performed.



    I remind you that Windows PowerShell snap-in is a separate component that requires installation, so if it is not there, just run the installer and reinstall the necessary component.





    With PowerShell, you can create a script to automate the operations described.



    “Shutting down the VM”, “starting the replica jobs”, “starting the VM on the new server”, “deactivating the replica jobs” - all this is possible without using the main console. However, remember that for the PowerShell scripts to work correctly, the modules must be installed on the same server as Veeam Backup & Replication. It also requires the use of the same OS versions for Veeam and Hyper-V hosts (for example, Windows Server 2012 for Veeam and Windows Server 2012 R2 for the new host).



    It is also important to enable PowerShell on Hyper-V 2008 R2 and import the PowerShell library of the control module for Hyper-V, which can be found on the CodePlex website: pshyperv.codeplex.com .



    The following requirements must be observed:


    • Service Pack 1;
    • Framework .NET 4 ;
    • Windows Management Framework 3 (which contains PowerShell v3);


    Copy the HyperV folder (from the archive downloaded from CodePlex) to C: \ windows \ system32 \ windowsPowerShell \ v1.0 \ modules



    The following script will enable you to perform operations such as:
    • Shutdown VM on Hyper-V 2008 R2;
    • Running a job for replication (Replica Job) on Veeam Backup & Replication;
    • Turning on a VM on Hyper-V 2012 R2;
    • Deactivating a job for replication (Replica Job).


    Conclusion


    The script is made to do routine operations automatically, as well as use cmdlets disabled by default. Remember, to work with Windows Server 2012 R2, you must use a version of Veeam Backup & Replication no lower than v7 R2!



    Thus, we got an interesting solution for automation. When the standard functionality of Veeam Backup & Replication v7 might not be enough, PowerShell snap-in provides an opportunity for expansion. If you are interested in Veeam Backup & Replication, then download the trial version .



    Additional materials



    Also popular now: