Welcome! » Log In » Create A New Profile

LVM thin support

Posted by Anonymous 
LVM thin support
June 10, 2015 05:24AM
Hello

Rsnapshot is able to create temporary LVM snapshots to backup datas so that it has a consistent view of the whole volume, and that's great. Today LVM also offers thin provisionning (for more information : https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Logical_Volume_Manager_Administration/thinly-provisioned_snapshot_volumes.html). As for rsnapshot this would permit :
[list][*]to simplify lthe lvcreate command (and the user configuring rsnapshot) by discarding the size option
[*]to create snapshot of snapshot. Eg I use thin snapshots to quickly backup my datas daily and then I also rely on rsnapshot to backup the latest snapshot on an external disk weekly[/list]
Please see attached a quick & dirty patch I did for my needs. To use it you only need to put in rsnapshot.conf :
linux_lvm_snapshotsize = 'lvmthin' # (lvmthin instead of a LVM size)

If you are interested in adding this feature in rsnapshot but would like this patch to get reworked, I'd be glad to help.

Regards

dud
LVM thin support
June 10, 2015 03:55PM
Hi dud,

[quote]On June 10, 2015 at 2:22 PM Hervé Werner <dud225 < at > hotmail.com> wrote:
If you are interested in adding this feature in rsnapshot but would like
this patch to get reworked, I'd be glad to help.
[/quote]
Indeed, you can work on it.

I'll give you some hints, where your patches have to change something:
- write unittests (the corresponding PR is not merged yet, so you may have
to wait a bit till you can finish unittests)
- add Pod documentation
- add documentation to rsnapshot.conf.in

What would it be, if the linux_lvm_snapshotsize is by default `undef` and
then behaves like 'lvmthin'? And only by setting an explicit value, the
snapshot_size will be regarded.

Cheers,
Bene

------------------------------------------------------------------------------
_______________________________________________
rsnapshot-discuss mailing list
rsnapshot-discuss < at > lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
LVM thin support
June 16, 2015 11:33AM
[quote]Date: Thu, 11 Jun 2015 00:53:54 +0200
From: benedikt < at > heine.rocks
To: rsnapshot-discuss < at > lists.sourceforge.net; dud225 < at > hotmail.com
Subject: Re: [rsnapshot-discuss] LVM thin support

Hi dud,

[quote]On June 10, 2015 at 2:22 PM Hervé Werner <dud225 < at > hotmail.com> wrote:
If you are interested in adding this feature in rsnapshot but would like
this patch to get reworked, I'd be glad to help.
[/quote]
Indeed, you can work on it.

I'll give you some hints, where your patches have to change something:
- write unittests (the corresponding PR is not merged yet, so you may have
to wait a bit till you can finish unittests)
- add Pod documentation
- add documentation to rsnapshot.conf.in

What would it be, if the linux_lvm_snapshotsize is by default `undef` and
then behaves like 'lvmthin'? And only by setting an explicit value, the
snapshot_size will be regarded.

[/quote]
Hello

As requested I reworked a bit my patch. Now it does complete checking on the lvm_snapshot_size parameter : it could only be equal to the string "lvmthin" or to a regex size that is accepted by lvcreate, any other case makes rsnapshot to fail. If lvmthin is used, an extra check is done to ensure the source LVM volume is thinly-provisionned, unfortunately this check uses an additionnal command : lvs. So if this patch is accepted as is, from now it will fail if linux_lvm_cmd_lvs is not set.

Concerning the unittest, I noticed there isn't any LVM so far. I've thought a little bit how to implement this and the major question is : which test volume is going to be snapshotted ? I don't know if there is a way to get this information from the user in a unit test ? We could try to detect it automatcally based on the current directory, but this will not allow to test both normal LV snapshots and thin snapshots.
So any idea to implement LVM unit tests is welcome :)

Let me know what do you think about this patch and if it stiil needs some review.

Regards

dud
Sorry, only registered users may post in this forum.

Click here to login