[Yum] fs-snapshot plugin: add included_vgs and excluded_vgs options to [lvm] section

Alfredo Moralejo amoralej at redhat.com
Fri Mar 2 16:09:35 UTC 2012


On 03/01/2012 08:54 AM, Zdenek Pavlas wrote:
> Hi!
>
>>            volume[lvm_key] = 1
> This should be avoided for excluded volumes.  Now it
> does not matter as the dict for excluded volumes is
> skipped anyway, but things change.
>
> Moving the added code 13 lines up should fix this,
> and also save the unnecessary Popen() if the volume
> is excluded.
>
>> +    # Check if include_vgs is defined in [lvm] section.
>> +    # If so, we compare VG name with include_vgs list
>> +    included_vgs = conduit.confString('lvm', 'included_vgs',
>> default="").split()
>> +    if len(included_vgs)>  0:
>> +       vg = device.split("/")[2]
>> +        if vg not in included_vgs :
>> +           return 0
>> +
>> +    # Check if excluded_vgs is defined in [lvm] section.
>> +    # If so, we compare VG name with excluded_vgs list
>> +    excluded_vgs = conduit.confString('lvm', 'excluded_vgs',
>> default="").split()
>> +    if len(excluded_vgs)>  0:
>> +        vg = device.split("/")[2]
>> +        if vg in excluded_vgs :
>> +            return 0
> On my system I have:
> /dev/mapper/vg_koblih-lv_root on / type ext4 (rw)
>
> Using mount points (/) instead of vgs (vg_koblih-lv_root)
> is easier, and there already is the "exclude" option that
> works with mount points.  Why didn't you just add a single
> "include" option instead?

I usually find several logical volumes in the OS volume group, and I'll 
probably want to include the all of most of them. An example of mount:

/dev/mapper/vg_system-lv_root on / type ext4 (rw)
/dev/mapper/vg_system-lv_usr on /usr type ext4 (rw)
/dev/mapper/vg_system-lv_var on /var type ext4 (rw)
/dev/mapper/vg_system-lv_tmp on /tmp type ext4 (rw)
/dev/mapper/vg_system-lv_opt on /opt type ext4 (rw)
/dev/mapper/vg_system-lv_home on /home type ext4 (rw)

/dev/mapper/vg_data-lv_data1 on /data1 type ext4 (rw)
/dev/mapper/vg_data-lv_data2 on /data2 type ext4 (rw)
/dev/mapper/vg_data-lv_data3 on /data3 type ext4 (rw)
/dev/mapper/vg_data-lv_data4 on /data4 type ext4 (rw)

...


I like the idea of using this config file:

[main]
enabled = 1
exclude = /tmp

[lvm]
enabled = 1
included_vgs = vg_system
# 'lvcreate_size_args' option must specify the snapshot LV size using -L or -l
lvcreate_size_args = -l 15%ORIGIN



I think it's easier that using purely /exclude, /include options.

>> +snapshoted by this plugin. When this option is used, all volume
> snapshotted
>
>> groups not
>> +listed are implicitely excluded.
> implicitly
> _______________________________________________
> Yum mailing list
> Yum at lists.baseurl.org
> http://lists.baseurl.org/mailman/listinfo/yum


-- 

Alfredo Moralejo
Red Hat - Senior Consultant
RHCE, RHCVA, RHCA

Office: +34 914148838
Cell: +34 607909535
Email: alfredo.moralejo at redhat.com

Dirección: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta 3ºD, 28016 
Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941


More information about the Yum mailing list