[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [linux-lvm] balooning/dynamic snapshots?



On Tue, 2007-11-13 at 15:27 -0500, Brian J. Murrell wrote:
>         
>         IO.popen("/testsuite/ltest-boulder/acceptance/common/timed_run 10 /usr/sbin/lvs") do |f|
>           f.each_line do |line|
>             j,volume,j,j,size,j,used = line.chomp.split(/\s+/)
>             if used.to_f > threshold then
>               # by bytes
>               #size = eval(size.sub(/G$/, ' * 1024 * 1024 * 1024'))
>               re = /([\d\.]+)([GM])/
>               md = re.match(size)
>               size = md[1]
>               units = md[2]
>               expand_by = size.to_f * increase_factor
>               system("echo \"lv #{volume} was #{size}#{units} big and #{used} full and was expaned +#{expand_by}#{units}\" | mail -s \"snap expanded\" root")
>               system("/testsuite/ltest-boulder/acceptance/common/timed_run 60 /usr/sbin/lvextend -L+#{expand_by}#{units} /dev/vg0/#{volume}")

Ooops.  I should have mentioned
that /testsuite/ltest-boulder/acceptance/common/timed_run is simply a
wrapper that time-bounds a command.  You can disregard it's use at the
risk of an lv* command hanging and running forever.

b.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]