All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] dynamic lvm snapshots (auto-resize)
@ 2011-10-13 17:28 Dusty Mabe
  2011-10-13 18:25 ` Ray Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Dusty Mabe @ 2011-10-13 17:28 UTC (permalink / raw)
  To: linux-lvm@redhat.com

Hi Everyone,

I am interested to see if there is any support for automatically resizing an lvm snapshot when it becomes full or bypasses a certain utilization? There has been �at least some interest in this in the past as I have found the following post in the mailman archives.�

http://www.redhat.com/archives/linux-lvm/2007-November/msg00016.html


Also it looks like HP as performed at least a similar implementation of this type of feature in their own product.�

http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02054539/c02054539.pdf



Thanks for any Help!!

Dusty Mabe

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] dynamic lvm snapshots (auto-resize)
  2011-10-13 17:28 [linux-lvm] dynamic lvm snapshots (auto-resize) Dusty Mabe
@ 2011-10-13 18:25 ` Ray Morris
  2011-10-14 13:07   ` Dusty Mabe
  0 siblings, 1 reply; 4+ messages in thread
From: Ray Morris @ 2011-10-13 18:25 UTC (permalink / raw)
  To: linux-lvm; +Cc: Dusty Mabe

I think that's being worked on / beta. Until it's ready, we implemented
it in a daemon that is 49 lines of Perl. This particular implementation 
is set to match our environment but you can modify it to your needs:

#!/usr/bin/perl

use Getopt::Long;
use lib 'lib';
use Linux::LVM;

my $lvname;
my $usage = "usage: $0 --lvname lvname\n";
die $usage unless ( GetOptions ( "lvname=s" => \$lvname ) );
die $usage unless ($lvname);

my $ppid = getppid();
while ( -e "/proc/$ppid") {
  &check_snaps($lvname);
  sleep(60);
}

sub check_snaps {
  my $lvname = shift();
  for ($snapnum = 2; $snapnum >= 0; $snapnum--) {
    if (-e "/dev/clones/${lvname}_snap${snapnum}") {
      my %lv = get_lv_info("/dev/clones/${lvname}_snap${snapnum}");
      next unless ($lv{'lv_name'});
      unless ($lv{'allocated_to_snapshot'}) {
          system('lvremove', '-f', "clones/${lvname}_snap${snapnum}");
          next;
      }
      if ($lv{'allocated_to_snapshot'} > 80) {
          print "live extending ${lvname}_snap${snapnum}\n";
          system('lvextend', '-f', '-l', '+20%LV', "clones/${lvname}_snap${snapnum}");
      }
    }
  }
}
-- 
Ray Morris
support@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php




On Thu, 13 Oct 2011 10:28:56 -0700 (PDT)
Dusty Mabe <dustymabe@yahoo.com> wrote:

> Hi Everyone,
> 
> I am interested to see if there is any support for automatically
> resizing an lvm snapshot when it becomes full or bypasses a certain
> utilization? There has been  at least some interest in this in the
> past as I have found the following post in the mailman archives. 
> 
> http://www.redhat.com/archives/linux-lvm/2007-November/msg00016.html
> 
> 
> Also it looks like HP as performed at least a similar implementation
> of this type of feature in their own product. 
> 
> http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02054539/c02054539.pdf
> 
> 
> 
> Thanks for any Help!!
> 
> Dusty Mabe
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] dynamic lvm snapshots (auto-resize)
  2011-10-13 18:25 ` Ray Morris
@ 2011-10-14 13:07   ` Dusty Mabe
       [not found]     ` <20111014092227.0bfbec97@bettercgi.com>
  0 siblings, 1 reply; 4+ messages in thread
From: Dusty Mabe @ 2011-10-14 13:07 UTC (permalink / raw)
  To: LVM general discussion and development

Ray,�

Thanks so much for your answer. You said the feature is being "worked on". I see some work related to thin provisioning "pools" in the latest LVM code. Is this the work you are referring to? If so do you know anything about it (maybe just a paragraph about how it works)? This has peaked my interest and I look forward to what LVM has to offer in the future.

Have a good day!

Dusty�


----- Original Message -----
From: Ray Morris <support@bettercgi.com>
To: linux-lvm@redhat.com
Cc: Dusty Mabe <dustymabe@yahoo.com>
Sent: Thursday, October 13, 2011 2:25 PM
Subject: Re: [linux-lvm] dynamic lvm snapshots (auto-resize)

I think that's being worked on / beta. Until it's ready, we implemented
it in a daemon that is 49 lines of Perl. This particular implementation 
is set to match our environment but you can modify it to your needs:

#!/usr/bin/perl

use Getopt::Long;
use lib 'lib';
use Linux::LVM;

my $lvname;
my $usage = "usage: $0 --lvname lvname\n";
die $usage unless ( GetOptions ( "lvname=s" => \$lvname ) );
die $usage unless ($lvname);

my $ppid = getppid();
while ( -e "/proc/$ppid") {
� &check_snaps($lvname);
� sleep(60);
}

sub check_snaps {
� my $lvname = shift();
� for ($snapnum = 2; $snapnum >= 0; $snapnum--) {
� � if (-e "/dev/clones/${lvname}_snap${snapnum}") {
� � � my %lv = get_lv_info("/dev/clones/${lvname}_snap${snapnum}");
� � � next unless ($lv{'lv_name'});
� � � unless ($lv{'allocated_to_snapshot'}) {
� � � � � system('lvremove', '-f', "clones/${lvname}_snap${snapnum}");
� � � � � next;
� � � }
� � � if ($lv{'allocated_to_snapshot'} > 80) {
� � � � � print "live extending ${lvname}_snap${snapnum}\n";
� � � � � system('lvextend', '-f', '-l', '+20%LV', "clones/${lvname}_snap${snapnum}");
� � � }
� � }
� }
}
-- 
Ray Morris
support@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php




On Thu, 13 Oct 2011 10:28:56 -0700 (PDT)
Dusty Mabe <dustymabe@yahoo.com> wrote:

> Hi Everyone,
> 
> I am interested to see if there is any support for automatically
> resizing an lvm snapshot when it becomes full or bypasses a certain
> utilization? There has been �at least some interest in this in the
> past as I have found the following post in the mailman archives.�
> 
> http://www.redhat.com/archives/linux-lvm/2007-November/msg00016.html
> 
> 
> Also it looks like HP as performed at least a similar implementation
> of this type of feature in their own product.�
> 
> http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02054539/c02054539.pdf
> 
> 
> 
> Thanks for any Help!!
> 
> Dusty Mabe
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
> 


_______________________________________________
linux-lvm mailing list
linux-lvm@redhat.com
https://www.redhat.com/mailman/listinfo/linux-lvm
read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [linux-lvm] dynamic lvm snapshots (auto-resize)
       [not found]     ` <20111014092227.0bfbec97@bettercgi.com>
@ 2012-03-05 22:46       ` Dusty Mabe
  0 siblings, 0 replies; 4+ messages in thread
From: Dusty Mabe @ 2012-03-05 22:46 UTC (permalink / raw)
  To: Ray Morris; +Cc: linux-lvm@redhat.com

Hey guys,

I notice that the work for this has now been complete (bugzilla report�# 427298�). If anyone is interested I wrote a small how-to on using the automatic resize for snapshot LVs at�http://dustymabe.com/2012/03/04/automatically-extend-lvm-snapshots/�

Dusty�

________________________________
From: Ray Morris <support@bettercgi.com>
To: Dusty Mabe <dustymabe@yahoo.com> 
Sent: Friday, October 14, 2011 10:22 AM
Subject: Re: [linux-lvm] dynamic lvm snapshots (auto-resize)

I don't really know anything about the work being done.
-- 
Ray Morris
support@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php




On Fri, 14 Oct 2011 06:07:57 -0700 (PDT)
Dusty Mabe <dustymabe@yahoo.com> wrote:

> Ray,�
> 
> Thanks so much for your answer. You said the feature is being "worked
> on". I see some work related to thin provisioning "pools" in the
> latest LVM code. Is this the work you are referring to? If so do you
> know anything about it (maybe just a paragraph about how it works)?
> This has peaked my interest and I look forward to what LVM has to
> offer in the future.
> 
> Have a good day!
> 
> Dusty�
> 
> 
> ----- Original Message -----
> From: Ray Morris <support@bettercgi.com>
> To: linux-lvm@redhat.com
> Cc: Dusty Mabe <dustymabe@yahoo.com>
> Sent: Thursday, October 13, 2011 2:25 PM
> Subject: ASO- Re: [linux-lvm] dynamic lvm snapshots (auto-resize)
> 
> I think that's being worked on / beta. Until it's ready, we
> implemented it in a daemon that is 49 lines of Perl. This particular
> implementation is set to match our environment but you can modify it
> to your needs:
> 
> #!/usr/bin/perl
> 
> use Getopt::Long;
> use lib 'lib';
> use Linux::LVM;
> 
> my $lvname;
> my $usage = "usage: $0 --lvname lvname\n";
> die $usage unless ( GetOptions ( "lvname=s" => \$lvname ) );
> die $usage unless ($lvname);
> 
> my $ppid = getppid();
> while ( -e "/proc/$ppid") {
> � &check_snaps($lvname);
> � sleep(60);
> }
> 
> sub check_snaps {
> � my $lvname = shift();
> � for ($snapnum = 2; $snapnum >= 0; $snapnum--) {
> � � if (-e "/dev/clones/${lvname}_snap${snapnum}") {
> � � � my %lv = get_lv_info("/dev/clones/${lvname}_snap${snapnum}");
> � � � next unless ($lv{'lv_name'});
> � � � unless ($lv{'allocated_to_snapshot'}) {
> � � � � � system('lvremove', '-f', "clones/${lvname}_snap${snapnum}");
> � � � � � next;
> � � � }
> � � � if ($lv{'allocated_to_snapshot'} > 80) {
> � � � � � print "live extending ${lvname}_snap${snapnum}\n";
> � � � � � system('lvextend', '-f', '-l', '+20%LV',
> "clones/${lvname}_snap${snapnum}"); }
> � � }
> � }
> }

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-05 22:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-13 17:28 [linux-lvm] dynamic lvm snapshots (auto-resize) Dusty Mabe
2011-10-13 18:25 ` Ray Morris
2011-10-14 13:07   ` Dusty Mabe
     [not found]     ` <20111014092227.0bfbec97@bettercgi.com>
2012-03-05 22:46       ` Dusty Mabe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.