Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

support checking the snapshot age #5

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

evgeni
Copy link

@evgeni evgeni commented Aug 25, 2015

Hi,

we have a need to verify that we do not have too old snapshots (people keep forgetting things, you know). To fix that, I have implemented an optional age check (in days).

Code is dependent on the new lvs call from #4, sorry :)

Greets

otherwise we would also match thin-provisioned volumes

example lvs output:
% sudo lvs
  LV                     VG     Attr       LSize  Pool       Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home                   fedora -wi-ao---- 20.00g
  root                   fedora owi-aos--- 20.00g
  root-snap              fedora swi-a-s---  1.00g            root   0.35
  swap                   fedora -wi-ao----  5.81g
  vm-osp7compute-root    fedora Vwi-a-tz-- 10.00g vmthinpool        0.00
  vm-osp7controller-root fedora Vwi-a-tz-- 10.00g vmthinpool        100.00
  vm-osp7dir-root        fedora Vwi-a-tz-- 10.00g vmthinpool        100.00
  vm-rhel66-root         fedora Vwi-a-tz-- 10.00g vmthinpool        9.30
  vm-rhel71-root         fedora Vwi-a-tz-- 10.00g vmthinpool        9.58
  vm-rhevh35-root        fedora Vwi-a-tz-- 10.00g vmthinpool        8.27
  vm-rhevm35-root        fedora Vwi-a-tz-- 10.00g vmthinpool        54.21
  vm-sat61-pulp          fedora Vwi-aotz-- 40.00g vmthinpool        67.43
  vm-sat61-root          fedora Vwi-aotz-- 15.00g vmthinpool        50.99
  vm-sat61-swap          fedora Vwi-aotz--  4.00g vmthinpool        9.21
  vmthinpool             fedora twi-aotz-- 70.00g                   90.17  78.80
that makes parsing the output easier and stable for future changes
@roman-vynar
Copy link
Contributor

Thanks for this.

However, I noticed that lvs on Ubuntu does not recognize role and time fields.
The package lvm2 2.02.66-4ubuntu7.4.
Is there any workaround to make it working on both redhat and debian distros?

@evgeni
Copy link
Author

evgeni commented Jan 6, 2016

Hi,

meh, I only checked on RHEL6 and expected it to work on others too. Will have look and come back to you :)

Greets

Edit: Debian Wheezy (lvm2 2.02.95-8) does not support this either. Debian Jessie (lvm2 2.02.111-2.2) supports this just fine. Ubuntu version mentioned above is from Precise, 12.04 LTS.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants