On Wednesday 2017-11-22 09:19:46 Josh Fisher wrote:
> As has been pointed out, libvirt provides a means of snapshotting a
> live  VM's storage, so it is quite possible to backup images from the
> host machine. That said, I strongly suggest you consider the following.
> 
> While the disk image approach simplifies backup, it complicates 
> restores. There is no way to restore a few files to the VM, at least
> not  without restoring the entire image and then manually using guestfs
> to extract the needed files. Disk image backups complicate restoring
> files to a live VM. My experience is that user errors, inadvertent
> deletes, etc., are far more frequent than disaster recovery situations,
> and so installing bacula-fd on the VM has worked better for me.
> 
> For disaster recovery, I keep a small image file that has OS and 
> bacula-fd to be used as a "bare metal" boot disk. This can be dd'd to 
> the VM's disk image so that the VM can be booted, and then a normal 
> restore can be performed from bconsole on the host, just as would be 
> done for a real machine.

I apologize for the long post in advance.

I agree completely with all your arguments and I gave the similar
recommendation earlier.
However, I would like to repeat that taking snapshot is not the only
way to backup virtual machines from the host.

There are capabilities such as one provided by the libguestfs which
is less intrusive and less dangerous to the VM image than the process
of rebasing the image after taking snapshot.
This solution makes files inside the image visible to the host thus
making file based backup and restore possible.

I am guessing that libguestfs solution might be slower than the usual
bacula-fd backup agent but I didn't tested it as I am not in a need
for that kind of a solution.
I am basing this opinion on the fact that most tools that use
libguestfs are using fuse and fuse has its speed limitations.

So, one could mount running virtual machine's images but it
should be done read-only and I am guessing that sometimes some
files or file names could be caught in the inconsistent state
which not desirable for the backup purposes. :-)

At this point one could combine the live snapshot and read-only
mount using libguestfs (e.g. guestmount) to make sure that the
files are in a consistent state.
Still, there is a possibility that merge (rebase) of the snapshot
would fail and we don't want that.

It is possible to install and run the guestfsd daemon inside the
virtual machine which should allow the host to access files from
a live virtual machine.
But then again why not simply use bacula-fd?


There is also qemu-nbd which (AFAIK) doesn't support mounting
images of a live virtual machines but serves solely to provide
the block device which the host can use to mount file systems
inside the virtual machine.
Not much useful for backup files of running virtual machine
but very useful when people have to debug and fix broken virtual
machines.


I understand that people might see the backup of the image files
easier because they don't have to configure bacula file daemons
on all the virtual machines they have to backup but it seems that
bacula-fd is still the safest way if one care for the data.
It also offers the best data throughput and ability to run
pre-backup and post-backup scripts inside the virtual machine.


I would also like to note that if the virtal machine is shut down
one can safely use libguestfs to create or modify files and
directories.
One could use it to automate configuration of bacula-fd inside
the virtual machine and then start the machine.
That would work just fine.


I should also say that some of my info could be outdated as I haven't
chance/time to follow on KVM's development for the past five years.


Regards

-- 
Josip Deanovic

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to