Veeam backup and Bare Metal Recovery of a VM
Those who aren’t lucky enough to use VMware or HyperV in their infrastructure might find it painful to provide a seamless way to manage their virtual backup and recovery strategy (i.e Ovm, kvm..etc.).
Veeam turns out to be a solid alternative that might spare the pain of reinventing the wheel along with the hours of scripting that come with it.
Today, we will demonstrate that with software like Veeam, we can restore a VM as if it was a physical machine using its Bare Metal recovery feature on a dummy virtual machine. Note that although the lab is based on VirtualBox, I have had a similar result when running it for OVM.
The following are the steps necessary to reproduce a simple DR test with VirtualBox VMs (scripting free).
- Windows Server2012 prerequisites for Veeam Installation
- VM lab setup overview
- Veeam Backup server installation
- Veeam Agent deployment
- Agent Backup job creation (Oracle DB aware)
- Run a full backup
- Create a Recovery Media using agent backup
- Proceed with a Bare Metal Recovery
Veeam 10 requires framework.net 4.7 and for that, you will need to make that windows server 2012 has the required pack (Instruction and download links are available here if you’re using an old version).
- Veeam backup server
- Veeam Oracle target
Note: Make sure you have defined the host-only adapter network in VirtualBox
- Database: I chose a 12c multi-tenant database for this lab but it doesn’t matter.
- Once subscribed for the 30 days trial, download the installer (iso) and mount in on your veeam_server VM
- Run the installer and specify the Windows builtin account as the main Veeam account.
Note: Windows 2012 R2 users will need to install the following update (KB2919355) as .NET Framework 4.7 is necessary.
- Launch Veeam Backup and replication
We will first have to create a protection group and add it to the infrastructure inventory which is just another name for Backup targets.
- Go to the inventory section under the physical infrastructure folder and click Create protection group.
- Give the protection group a name.
- Choose individual computers as a type of protection groups.
- Add the target VM you want to backup (IP address along with admin credentials)
- The next segment is basically the options available for your agent deployment on the target computer and the daily schedule of agent check.
- Review and apply
- Once the deployment is finished, close the window. The new group will be displayed in the inventory where you can click right to select details to check the agent info
- Navigate to Home tab and select windows computer under jobs>Backups menu
- Select Server for the protected type and Managed by the backup server as backup management mod
- On the computers, sections add the computer we previously created
- Select Entire computer as backup type
- Select the backup repository that will store the backup
- In this section, we will take advantage of the available Application-Aware Processing options as we have an oracle database in the target server.
Note: I added the database SYSDBA credentials and specified the schedule and retention of archive logs backups.
- Additional scheduling setting are provided before completing the job creation
Confusion over Full vs Active Full: You will notice that there are two buttons available on the backup job interface.
START (synthetic) and ACTIVE FULL (active).
- Active Full backup gets the data from the target system and is always done the first time a backup is run.
- Synthetic Full backup gets its data from existing backups stored in the backup repository and changed files in the source VM to reduce CPU/Network overhead.
hence our first backup will be de-facto run as an active full backup. The below screenshot displays the report of my first backup which was pretty fast for a 24GB target VM.
- Let’s have a closer look at the details of this job. Notice it only took 2 minutes to read 23GBs (probably because VMs were in my laptop) while most of the work was consumed by recovery media files collection. These very files will be helping us to create the Veeam recovery media (sort of bootable recovery drive)
Note: The source disks are virtual disks(vmdk) but the compression here still reached an x2 fold ratio.
The Resulting backup output is two files including both data and metadata of the backup
At this point, we have all we need to create a bootable recovery media which will allow us to restore the crashed VM
- On the inventory click on the recovery media button under our protection group (Veeam_client)
- ISO is the default image file here
- Browse a location in the backup server (local drive)
- Click next then finish
That’s where the fun begins. Now that the ISO file is ready we can finally get to the real deal and prepare our DR test.
To make it even safer we will not need to literally destroy the original VM but only switch it off to avoid IP overlap when booting the new machine.
The trick here is to fool Veeam backup tool by spinning a shell VM with similar hardware specs (disks/network adapters) than the original machine before mounting the recovery ISO in the DVD drive.
- Create a new shell virtual machine with the below specifications
- Copy the ISO file to the Host machine and mount it into the VM’s DVD drive
- Boot the new virtual machine. We will be prompted with the following boot menu that gathers both Windows and Veeam Recovery tools. We will proceed by choosing Bare Metal Recovery on our new virtual machine.
- Select network storage as our backup is located in the backup server repository
- Type the IP address and credentials of the Veeam backup server
- Select the last available backup
Attention: Make sure the new VM’s disks are as large as the original ones otherwise your restore will trigger an error (Unable to auto-match disks)
- Select Entire computer as restore mode
- After reviewing the summary click restore
- The Restore of 23GB Backup is done in only 2 minutes with an impressive I/O throughput
Sweet! now let’s check whats under the hood.
Tip: Do not accept to reboot. Just shut down the VM and un-mount the ISO before restarting the VM.
- Restart the newly restored VM. Here I used an RDP session pointing to the original IP = 192.168.56.20. After Ignoring the shutdown even tracker the database service is up and consistent (Archive mode on).
Smooth and easy. We have just demonstrated how virtual machines can be recovered through a Veeam Backup feature that is initially built to restore Bare Metal servers. Quite a simple and effective solution for shops that use non-flexible hyper-visors like OVM where recovery implementations can be tedious. Think of all the production refreshes done in a timely fashion when urgent needs emerge. On top of that, the synthetic backups will also reduce the overhead on your production system.
Furthermore, the backup used in this lab incurred no downtime (hot backup) and the Application-Aware Processing feature coupled with Microsoft VSS technology guarantee a transactionally consistent backup for windows machines(Oracle/SQL server/SharePoint).
Veeam for Linux VMs:
I have tried to deploy the Veeam agent for Linux the same way than for windows. However, you will need to install both dkms and kernel-devel packages before deploying the agent (you might need help from Veeam support if issues arise).
No comments yet.