Backing Up, Restoring and Migrating VM


Advertisements

In this chapter, we will discuss how to back up, restore and migrate a virtual machine.

Duplicating a VM

To duplicate or clone a machine means making an exact copy of it. Most of the hypervisors support this feature. By duplicating a machine, we copy down every detail, including the name of the machine and the different network addresses attached to the machine.

Duplicating a machine and putting it in to function is not always the best option because a duplicate name or IP in network can be a problem. We make duplication generally for backup purposes.

Most hypervisors can clone while the machine is turned off. If the hypervisor accepts to clone while it is on, it is recommend to turn it off, because the process can crash the machine. In practice, we have discussed “How cloning is done in VMware Workstation”, please refer to the previous chapters.

Backing Up and Recovering a VM

There are three methods for backing up virtual machines.

Method 1

The most common one is to install traditional backup software on the guest VM. If Windows OS is used on our VM, we can use “Backup and restore” to back up the machine, which is found in the “Control Panel”.

Backup

For Linux OS, we can use many open source tools depending on our needs, like “Bacula”, “rsync”, etc.

Method 2

Another strategy or method is to copy all of the files that define a VM. Therefore, we will have to go out and find all of the individual files that define our virtual machine and copy them to an alternate location. Some of these files are going to be large.

Example: Here, we have created several VM machines with VirtualBox as shown in the following illustration. Their names are – “AC2”, “Kali2016.1”, “test”, “Windows 2012”.

AC2

To find the files that we have to copy or to backup, we have to right click on the VM machine. Go to “Storage” then move your mouse over the virtual HDD and it will show the full path where the VDI files are found.

Go to Storage

Logs

We will save all these files to another location.

Method 3

The third option to backup and restore VM machines is to use third party software. One of the best is VEEAM, which can be found on the following URL - https://www.veeam.com/

VEEAM

Converting a Physical Server into a Virtual Server

In this section, we will see how to convert a physical machine into a virtual machine. This is often called as P2V in many literatures.

VMware puts out a product that is called vCenter Converter, which will convert from a physical machine specifically into a VMware virtual machine. The software can be downloaded from - https://www.vmware.com/products/converter.html

P2V

Microsoft has a product called Disk2vhd, which will convert a physical hard drive into a VHD formatted virtual hard drive. It can be downloaded from the following link – https://technet.microsoft.com/en-us/sysinternals/ee656415.aspx

We just have to install the software on the physical server and click “Create” as shown in the screenshot below. A VHDX file will be created which could be imported in a Hypervisor.

Disk2vhd

Both of these products will convert machines, while the server is running and is free. All the vendors of hypervisors have some P2V tool and they are typically free. From the vendor’s point of view, they would very much like you to convert your physical machines into virtual machines that are optimized for their hypervisor.

Converting a Virtual Server into a Physical Server

To convert a virtual server to a physical server also commonly called as V2P is certainly less common than a P2V conversion. However sometimes, it is needed in development-based environments. It does happen where a product needs to be tested in the virtual server than to a physical server, or to clone a production machine and move it to test.

Hypervisor vendors do not offer such a tool. However, you have to request the hardware vendor, if they could offer such tools.

Advertisements