You are on page 1of 13

Bacula Systems White Paper

Windows Hyper-V Backup and Recovery


using Bacula Enterprise
Bacula Systems User’s Guide
This document is intended to provide insight into the considerations and processes
required to implement Hyper-V server backup using Bacula Enterprise

Version 1.0, November 12, 2020


Copyright ©2008-2020, Bacula Systems S.A.
All rights reserved.
Overview
Hyper-V is a Microsoft program for virtualization of servers and operating systems
based on a hypervisor for 64-bit systems on computers with AMD-based processors
or with Intel virtualization technologies.
Its use allows you to make the most of hardware resources and also offers the
following benefits:
◾ Rational use of the computing resources of the physical servers
◾ Centralized administration of servers and virtual machines
◾ Easy administration and efficient management of resources
◾ Tools to prepare and configure new operation environments in production
seamlessly
◾ Facilities to allocate resources to virtual machines without affecting services,
which allows adjusting the infrastructure to changes in the requirements of
organizations
◾ Savings of the operating costs
Because the services that are offered by the Hyper-V virtualization platforms are
critical for operation processes, having a reliable Hyper-V backup policy is essential
to guarantee the availability of the service. Professional IT environments using
Hyper-V virtual machines need to have Hyper-V backup software that is able to
manage Hyper-V-based data with complete convenience and reliability. Bacula’s
Hyper-V backup solution delivers Full level Hyper-V VM backups using the VSS
API. Its Hyper-V backup technology is highly scalable, flexible and made for the
most demanding enterprise environments. When used with Bacula Enterprise Global
Endpoint Deduplication technology and the “bothsides” FileSet option, the amount
of data transfer and storage use is minimized, usually to a great extent. Bacula
Enterprise also has the capability to make incremental backups of the host computer.

Functionality
Bacula Enterprise provides the following Hyper-V backup software functionality:
◾ Administration of Hyper-V VM backups and restores from a centralized ad-
ministration console, either through CLI or GUI interface or web interface
◾ Backup of the Hyper-V VM without affecting their service and operation
◾ Ease of replication and remote Hyper-V backup through the WAN or through
the Internet to the cloud
◾ Advanced levels of security and protection while Hyper-V backup using EFS
Bacula’s Hyper-V Backup Module’s Key Benefits:
◾ Full image level Hyper-V VM backup
◾ Support for Hyper-V Cluster Shared Volumes
◾ Restores complete Hyper-V virtual machine image

Windows Hyper-V Backup and Recovery using Bacula Enterprise 1 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
◾ Restores disk images
◾ VSS-based snapshots for quiescing VSS-based applications

◾ Hyper-V backup includes the server data


◾ Rapid Hyper-V virtual machine restores
◾ Compression of the backups of Hyper-V virtual machines using Delta

◾ Encryption of backup Hyper-V at the storage level, in process of data trans-


mission and during the execution of operations

1 Bacula Windows Hyper-V Plugin


Bacula Enterprise enables you to back up a large number of different components
on Windows machines. One of these components is the Microsoft Hyper-V Server,
which is the subject of this whitepaper.

Backing up and restoring Hyper-V virtual machine is supported with Full level back-
ups. It is not possible to do Incremental or Differential backups because Microsoft
does not support that backup level for the Hyper-V Server product. However, use
of Bacula Enterprise Global Endpoint Deduplication with the ’bothsides FileSet’
option can significantly minimize data transfer and storage. Global Endpoint Dedu-
plication is an especially advanced deduplication engine that assesses data at the
block level, then writes only new blocks and references Bacula volumes to blocks
recorded in Bacula’s Deduplication engine which makes your Hyper-V backup tool
run faster. As well as saving storage extremely effectively, network bandwidth usage
benefits greatly, achieved by only sending unknown blocks to the Storage Daemon
from the File Daemon while backing up Hyper-V VMs. Use of the Global Endpoint
Deduplication plugin and the bothsides FileSet option permits to minimize the
data transfer and the storage.

2 Backup
When correctly configured (Bacula Systems’ high quality support is ready to help),
then the backup job will include the Hyper-V server data. The Hyper-V server data
files backup will include the Hyper-V server data. The Hyper-V server data files
backed up will appear in a bconsole command or bat command restore like:
/@HYPERV/
...
etc

A complete example of the Job setup for Hyper-V Server data looks as shown in
example 1 on page 4. As for all VSS-enabled components, it is the administrator’s
responsibility to make sure that the required VSS snapshots are created by explicitly
mentioning at least one file or directory for each drive where data that is handled
by the plugin is stored. In the example, we use the file c:/backmeup to ensure this.
Hyper-V uses one of two mechanisms to back up each VM. The default backup
mechanism is called the “Saved State” or “Offline” method, where the VM is put

Windows Hyper-V Backup and Recovery using Bacula Enterprise 2 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
Child 2 - Second Virtual Machine

Child 1 - First Virtual Machine


Hyper-V Integration Application
components Server

WEB Hyper-V Integration Application


VSS Requestor VSS Writer
WEB
Bacula Enterprise components Server
Edition Agent
VSS Requestor VSSVSS
Writer
Provider
Microsoft Windows Server
VSS Provider
Microsoft WindowsHyper-V
Server Host
VSS
Requestor VSS Writer
Hyper-V Host
VSS Writer

Volume Shadow Copy Services (VSS)

VSS Microsoft
Provider Hyper-V
server

into a saved state during the processing of the PrepareForSnapshot event, snapshots
are taken of the appropriate volumes, and the VM is returned to the previous state
during the processing of the PostSnapshot event.

The other backup mechanism is called the “Child VM Snapshot” or “Online”


method, which uses VSS inside the child VM to participate in the backup. For
the “Child VM Snapshot” method to be supported, all of the following conditions
must be met:

◾ Backup (volume snapshot) Integration Service is installed and running in the


child VM. The service name is “Hyper-V Volume Shadow Copy Requestor”.
◾ The child VM must be in the running state.

◾ The Snapshot File Location for the VM is set to be the same volume in the
host operating system as the VHD files for the VM.
◾ All volumes in the child VM are basic disks and there are no dynamic disks.
◾ All disks in the child VM must use a file system that supports snapshots (for
example, NTFS).

To know if your VMs are “Offline” or “Online”, it is possible to use the following
windows command on Windows 2012 R2:
C:/> echo list writers > t.txt
C:/> diskshadow /s t.txt | find "Caption: O"
- Caption: Offline/2012
- Caption: Offline/windows
- Caption: Online/centos

On Windows 2012 and 2008

Windows Hyper-V Backup and Recovery using Bacula Enterprise 3 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
File Set {
Name = HYPERV
Include {
Options {
Signature = SHA1
Dedup = bothsides
}
File = C:/backmeup
Plugin = "vss:/@HYPERV/"
}
}

Job {
Name = HYPERV08
Accurate = Yes
File Set = HYPERV
Client = wsb-hyp08-fd
Job Defs = DefaultJob
Level = Full
}

Note the inclusion of c:/backmeup, which is required to ensure that Bacula creates
the required VSS snapshot of the drive the backed up data is stored on. If Hyper-V
Server data is also stored on other drives, you need to create similar File = -lines
for these drives, too.
Example 1: Hyper-V Server Backup Job

C:/> echo list writers > t.txt


C:/> diskshadow /s t.txt | find /i "Caption: Backup Using"

• For Offline backups: Backup Using Saved State/VMname1


• For Online backups: Backup Using Child Partition Snapshot/VMname2

3 Restore
Restoring the VMs is done entirely by the host operating system; the VSS writers
in the child VMs are not involved.

◾ During the processing of the PreRestore event, the Hyper-V VSS writer turns
off and deletes any VMs that are about to be restored.
◾ After all VSS writers have processed the PreRestore event, the files are re-
stored.
◾ For each VM that was restored, the Hyper-V VSS writer registers the VM
with the Hyper-V management service. If the VM is restored to a nondefault
location, a symbolic link is created in the default location linking to that
location.
◾ For each VHD that was restored, the location is compared with the one
specified for that VM. If the location is different, then the configuration is
updated with the proper location.

Windows Hyper-V Backup and Recovery using Bacula Enterprise 4 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
File Set {
Name = HYPERV-TestVM
Include {
Options {
Signature = SHA1
}
File = C:/backmeup
# backup only TestVM on the server
Plugin = "vss:/@HYPERV/ cinclude=\"Host Component\" cinclude=*/TestVM cexclude=*"
}
}

Example 2: Include only one virtual machine

◾ The network configuration is updated. If the virtual switches that the VM


was connected to when it was backed up still exit, new ports are created and
connected to the VM.

When restoring a “Offline” VM, the VM will not be re-created by Microsoft Hyper-V
vss driver. It is possible to run “New-VM” powershell command to re-create the
VM.
New-VM -VMName centos -VHDPath C:/VM/centos.vhdx -MemoryStartupBytes 512MB -SwitchName VMNetwork

With Bacula Enteprise , it is possible to restore VSS files directly on disk without
using the VSS restore framework. In the restore menu, it is possible to configure
Plugin Options menu and set the ................
without_vss option to “true”.
.....
Run Restore job
JobName: RestoreFiles
Bootstrap: /opt/bacula/working/trusty-amd64-dir.restore.9.bsr
Where: c:/tmp
Replace: Always
FileSet: Full Set
Backup Client: hyperv
Restore Client: hyperv
Storage: dedup
When: 2015-03-03 06:50:22
Catalog: MyCatalog
Priority: 10
Plugin Options: *None* <------------- Plugin Options menu

3.1 Example
We assume that a correct backup of Hyper-V data exists and you start the restore
with option 5. in Bacula Console’s restore command, mark the complete tree
of data backed up by the Hyper-V component of the VSS plugin, then finally do
lsmark @HYPERV command to show all the files selected to be restored. Then the
output you see should be similar to that presented in example 3 on the next page.

Windows Hyper-V Backup and Recovery using Bacula Enterprise 5 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
$ mark *
31 files marked.
$ lsmark
*@HYPERV/
*Microsoft Hyper-V VSS Writer/
*Host Component/
*:component_info_5215da3c
*c:/
*programdata/
*microsoft/
*windows/
*hyper-v/
*initialstore.xml
*resource types/
*06ff76fa-2d58-4baf-9f8d-455773824f37.xml
*118c3be5-0d31-4804-85f0-5c6074abea8f.xml
*146c56a0-3546-469b-9737-fcbcf82428f4.xml
*dacdcf3f-6f67-4eb8-a4d0-5d93b48a2468.xml
*f6293891-f32f-4930-b2db-1a8961d9cb75.xml
*Offline/
*ubuntu/
*:component_info_5215da3c
*c:/
*programdata/
*microsoft/
*windows/
*hyper-v/
*virtual machines/
*690f5094-ff23-411e-92c0-639fc7ebc598/
*690f5094-ff23-411e-92c0-639fc7ebc598.bin
*690f5094-ff23-411e-92c0-639fc7ebc598.vsv
*690f5094-ff23-411e-92c0-639fc7ebc598.xml
*vm/
*ubuntu.vhdx

Example 3: Output for lsmark Command with Hyper-V Data Marked

Windows Hyper-V Backup and Recovery using Bacula Enterprise 6 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
$ lsmark
*@HYPERV/
*Microsoft Hyper-V VSS Writer/
*Host Component/
*:component_info_5216cf46
*c:/
*programdata/
*microsoft/
*windows/
*hyper-v/
*initialstore.xml
*resource types/
*06ff76fa-2d58-4baf-9f8d-455773824f37.xml
*118c3be5-0d31-4804-85f0-5c6074abea8f.xml
*Online/
*centos/
*:component_info_5216cf46
*c:/
*programdata/
*microsoft/
*windows/
*hyper-v/
*snapshots/
*acc145fb-9566-402d-9434-04f1e325a75f-backupsnapshot.xml
*virtual machines/
*acc145fb-9566-402d-9434-04f1e325a75f.xml
*vm/
*centos-childvhd.avhdx
*centos.vhdx

Example 4: Output for lsmark Command with Hyper-V Online Data Marked

Windows Hyper-V Backup and Recovery using Bacula Enterprise 7 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
4 File Level Restore
To restore a set of files from a Hyper-V VM backup without re-importing the entire
VM, it is possible to restore VHD files in a directory using the without_vss plugin
restore option (See section 3 on page 5) and mount them in the system with the
Powershell command Mount-VHD (or the Server Manager console) as shown figure
1). Once mounted, the VHD image is accessible like other physical disks on the
system.
Mount-VHD –Path c:\test\testvhdx.vhdx -ReadOnly

More information about the Mount-VHD command can be found on https://


technet.microsoft.com/en-us/library/hh848551.aspx

Figure 1: Attach/Mount Option in Server Manager

We advise to restore VHD files on a different system to avoid operational problems


during the restore. If the without_vss option is not properly set, the original VM
would be deleted by Hyper-V automatically during the restore.

5 Cluster Shared Volumes


Cluster Shared Volumes is a feature of Failover Clustering first introduced in Win-
dows Server 2008 R2 for use with the Hyper-V role.
A Cluster Shared Volume is a shared disk containing an NTFS or ReFS volume that
is made accessible for read and write operations by all nodes within a Windows
Server Failover Cluster.

Windows Hyper-V Backup and Recovery using Bacula Enterprise 8 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
Cluster Shared Volumes File System (CSVFS) backup is fully supported by Bacula’s
Hyper-V module, so VMs located on CSVFS volumes are backed up transparently.

6 Your IT Environment — Today and Tomorrow


The IT environment of many organizations today continues to get more complex as
data is moved between on-premise, Cloud, virtual machines, containers and more.
Not only must these organizations support multiple environments, but they are
also seeing tremendous growth in the volume of data that they need to regularly
manage. This introduces new backup and restore challenges for them to meet
security compliance requirements, RTO’s, RPO’s and ever-tightening budgets.
As CIOs grapple with this, they usually discover that the traditional vendors they
have been working with — who may have been fine in supporting IT as it used to
be — are not architected to be able to cope with their wide variety of systems in an
effective way. This usually becomes untenable when a new environment is brought
to bear and suddenly the customer is told that there needs to be custom work or
high contracting costs, or that it will not be supported until six to twelve months
from now. This trigger often induces people to take a look at something they tend
to not want to think about, which is backup and restore.
Bacula is a different type of company. We built our company with a modern,
modular architecture that was designed using open principles for this new world of
open volume. We also recognize that we felt the whole mind-set of the backup
industry which was built around data volume, was going to be untenable in a world
where data volumes are out of control. Our approach allows companies to support
more environments much faster than they ever have before, with a lower-cost,
fairer licensing model that is built around environments rather than volume. A
model based on volume is a model that no longer works. Bacula’s new model
creates a more positive, constructive relationship between the backup vendor and
the company — a relationship that is more suited for today’s and tomorrow’s world.

7 Conclusion
Hyper-V is just one of the many virtual environments that is catered for by Bacula
Systems. The Bacula VM Performance Backup Suite delivers an especially wide
range of Hypervisor support: Hyper-V VM Backup, VMware VM Backup, VMware
Instant File-Level Recovery, KVM Virtual Machine Backup and Replication, Xen
Virtual Machine Backup and Replication, Red Hat Virtualization, and Proxmox.
Bacula Enterprise has the ability to precisely protect huge volumes of data at a low
cost. This is because Bacula’s licensing model has no data volume charges. ...........
Contact
Bacula Systems
......... ............
1
for more information on its Hypervisor backup and recovery capa-
bilities.

1 https://www.baculasystems.com/contactus
.........................................................

Windows Hyper-V Backup and Recovery using Bacula Enterprise 9 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
The diagram below demonstrates the straightforward architecture of
Bacula Enterprise

text console graphic console

Data compression
Storage Daemon SQL Catalog
Deduplication

Management OS’s

and more... and more...

Google Amazon Private

S3 Oracle Azure

Clouds Disk & Disk array Tapes & Autoloaders VTL

Windows Hyper-V Backup and Recovery using Bacula Enterprise 10 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
The following diagram offers an overview of Bacula Enterprise’s
exceptionally wide feature range

Windows Hyper-V Backup and Recovery using Bacula Enterprise 11 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners
For More Information
For more information on Bacula Enterprise Edition, or any part of the broad Bacula
Systems services portfolio, visit www.baculasystems.com.

Linux is a registered trademark of Linus Torvalds.


SAP HANA is a registered trademark of SAP SE.

Windows Hyper-V Backup and Recovery using Bacula Enterprise 12 / 11


Copyright © November 2020 Bacula Systems SA www.baculasystems.com/contactus
..............................................
All trademarks are the property of their respective owners

You might also like