What's the purpose of the LVM stuff?

2 views
Skip to first unread message

ronaldlw

unread,
Aug 11, 2009, 6:02:48 PM8/11/09
to vmsbackup
I'm just wondering what the purpose of the LVM stuff is in the
script?

10nico

unread,
Aug 12, 2009, 3:48:37 AM8/12/09
to vmsbackup
Hello, the purpose is to allow the script to make "hot" backups using
LVM snapshots.
LVM snapshots allow to create a virtual copy of a filesystem which is
frozen in time and can be mounted and read (and backed up) without
interfering with the real filesystem, which in the meantime can still
be read/written.
When using LVM snapshots the scripts does the following:

suspend vm -> create LVM snapshot of the filesystem containing the vm -
> mount the LVM snapshot in another folder -> resume the vm -> start
backing up the folder where the LVM snapshot is mounted -> when the
backup is finished the LVM snapshot gets unmounted and then removed

The advantage is that the vm needs to remain suspended only for the
time needed to create the LVM snapshot and to mount it, which is a
very short time.

The disadvantage is that to be able to use LVM snapshots the physical
host must be specifically configured, in fact;
- the VMs need to reside on an LVM volume
- the LVM volume needs to have free physical extents, which are used
to create the LVM snapshot (the free physical extents are used to
store the modifications made to the real filesystem for as long as the
LVM snapshot exists).

Have a nice day,

Michele

Par_Tojkander

unread,
Aug 12, 2009, 6:37:20 AM8/12/09
to vmsbackup
Another question -- if you have all the VMs on one LVM volume, you'd
have to backup the entire LVM volume, with all the guests in it?


Pär
> > script?- Dölj citerad text -
>
> - Visa citerad text -

10nico

unread,
Aug 12, 2009, 7:08:18 AM8/12/09
to vmsbackup
Of course not!
When the LVM snapshot is mounted all of its contents are available,
just as if it was the real /var/lib/vmware/VirtualMachines directory.

The script then acts on the folder where the snapshot is mounted as if
it would do on the real folder, i.e. backs up only the VMs enabled for
backup, and not the entire folder.

Michele

ronaldlw

unread,
Aug 12, 2009, 9:16:46 AM8/12/09
to vmsbackup
So what is the advantage of doing that as opposed to using the vmware
server snapshot? Seems like that would be faster than suspending and
resuming? Just wondering!

Thanks,
Ron

James

unread,
Aug 12, 2009, 9:25:14 AM8/12/09
to vmsb...@googlegroups.com
I heard taking vmware snapshots effected performance, not sure how true this is though.

James

10nico

unread,
Aug 12, 2009, 9:46:06 AM8/12/09
to vmsbackup
The advantage is that you can use the "cold" backup method (which
suspends-resumes the VM) and have almost the same small downtime that
you have when using vmware snapshots.

You're welcome,

Michele

10nico

unread,
Aug 12, 2009, 9:56:20 AM8/12/09
to vmsbackup
In a vmware virtual disk the writes get written to the "mainfile".vmdk
file ; when a vmware snapshot is created, vmware stops writing to the
"mainfile".vmdk file and moves the writes to another file, usally
named "mainfile-000001.vmdk"

When another new a snapshot is created the changes of the previous one
(mainfile-000001.vmdk) get merged into the "mainfile.vmdk", and
another new file ("mainfile-000002.vmdk") gets created to store the
writes from that moment on.
Theoretically, doing this for long periods of time can cause
fragmentation.
In fact I periodically do a vmware shrink and defrag, but I never had
a chance to actually measure the amount of slow down of this
hypotetical fragmentation.

Regards,

Michele
Reply all
Reply to author
Forward
0 new messages