1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

938 Commits

Author SHA1 Message Date
Zdenek Kabelac
0e0f91b6dd tests: use exclusive activation for mirror case
Since mirror doesn't take exclusive lock implicitely yet,
enforce it for cluster testing.
2014-02-18 10:39:29 +01:00
Jonathan Brassow
6a00a7e33d RAID: Allow implicit stripe (and parity) when creating RAID LVs
There are typically 2 functions for the more advanced segment types that
deal with parameters in lvcreate.c: _get_*_params() and _check_*_params().
(Not all segment types name their functions according to this scheme.)
The former function is responsible for reading parameters before the VG
has been read.  The latter is for sanity checking and possibly setting
parameters after the VG has been read.

This patch adds a _check_raid_parameters() function that will determine
if the user has specified 'stripe' or 'mirror' parameters.  If not, the
proper number is computed from the list of PVs the user has supplied or
the number that are available in the VG.  Now that _check_raid_parameters()
is available, we move the check for proper number of stripes from
_get_* to _check_*.

This gives the user the ability to create RAID LVs as follows:
# 5-device RAID5, 4-data, 1-parity (i.e. implicit '-i 4')
~> lvcreate --type raid5 -L 100G -n lv vg /dev/sd[abcde]1

# 5-device RAID6, 3-data, 2-parity (i.e. implicit '-i 3')
~> lvcreate --type raid6 -L 100G -n lv vg /dev/sd[abcde]1

# If 5 PVs in VG, 4-data, 1-parity RAID5
~> lvcreate --type raid5 -L 100G -n lv vg

Considerations:
This patch only affects RAID.  It might also be useful to apply this to
the 'stripe' segment type.  LVM RAID may include RAID0 at some point in
the future and the implicit stripes would apply there.  It would be odd
to have RAID0 be able to auto-determine the stripe count while 'stripe'
could not.

The only draw-back of this patch that I can see is that there might be
less error checking.  Rather than informing the user that they forgot
to supply an argument (e.g. '-i'), the value would be computed and it
may differ from what the user actually wanted.  I don't see this as a
problem, because the user can check the device count after creation
and remove the LV if they have made an error.
2014-02-17 20:18:23 -06:00
Zdenek Kabelac
0be6caba6e tests: drop more debug.log
Avoid login result from last lvm command when target_at_least fails.
2014-02-17 22:25:53 +01:00
Zdenek Kabelac
18cac16540 tests: more clustered testing 2014-02-17 22:25:53 +01:00
Zdenek Kabelac
37cf201906 tests: on older system use mirror type 2014-02-17 22:25:53 +01:00
Zdenek Kabelac
8eedb18c73 tests: add short delay
Give some extra delay so the file will be opened.
2014-02-17 22:25:53 +01:00
Zdenek Kabelac
25cea92338 thin: fix merge of old snaphost
Fix merging of old snapshot into thinvolume origin.
Add also internal error for the error case when
merging requests activation of merged LV.
2014-02-17 22:25:53 +01:00
Jonathan Brassow
fa4812bf7b cache: Fix cache LV not being instantiated in kernel
When an origin exists and the 'lvcreate' command is used to create
a cache pool + cache LV, the table is loaded into the kernel but
never instantiated (suspend/resume was never called).  A user running
LVM commands would never know that the kernel did not have the
proper state unless they also ran the dmsetup 'table/status' command.
The solution is to suspend/resume the cache LV to make the loaded
tables become active.
2014-02-14 16:04:31 -06:00
Jonathan Brassow
4b6e3b5e5e allocation: Allow approximate allocation when specifying size in percent
Introduce a new parameter called "approx_alloc" that is set when the
desired size of a new LV is specified in percentage terms.  If set,
the allocation code tries to get as much space as it can but does not
fail if can at least get some.

One of the practical implications is that users can now specify 100%FREE
when creating RAID LVs, like this:
~> lvcreate --type raid5 -i 2 -l 100%FREE -n lv vg
2014-02-13 21:10:28 -06:00
Zdenek Kabelac
d68e5d5ab9 tests: utilize check and get
Replace some in-test use of lvs commands with their check
and get equivalent.

Advantage is these 'checking' commands are not necessarily always
valiadated via extensive valgrind testing and also the output noice
is significantly reduces since the output of check/get is suppressed.
2014-02-11 19:00:07 +01:00
Zdenek Kabelac
177db48c11 tests: add check lv_not_exists 2014-02-11 19:00:06 +01:00
Zdenek Kabelac
4ed831e7ef tests: remove debug.log in enable_dev
In aux functions we may drop debug log from
last running lvm command - so we do not
get debug log from properly executed command,
when we fail here.
2014-02-11 19:00:06 +01:00
Jonathan Brassow
96626f64fa cache: Code to allow the create/remove of cache LVs
This patch allows users to create cache LVs with 'lvcreate'.  An origin
or a cache pool LV must be created first.  Then, while supplying the
origin or cache pool to the lvcreate command, the cache can be created.

Ex1:
Here the cache pool is created first, followed by the origin which will
be cached.
~> lvcreate --type cache_pool -L 500M -n cachepool vg /dev/small_n_fast
~> lvcreate --type cache -L 1G -n lv vg/cachepool /dev/large_n_slow

Ex2:
Here the origin is created first, followed by the cache pool - allowing
a cache LV to be created covering the origin.
~> lvcreate -L 1G -n lv vg /dev/large_n_slow
~> lvcreate --type cache -L 500M -n cachepool vg/lv /dev/small_n_fast

The code determines which type of LV was supplied (cache pool or origin)
by checking its type.  It ensures the right argument was given by ensuring
that the origin is larger than the cache pool.

If the user wants to remove just the cache for an LV.  They specify
the LV's associated cache pool when removing:
~> lvremove vg/cachepool

If the user wishes to remove the origin, but leave the cachepool to be
used for another LV, they specify the cache LV.
~> lvremove vg/lv

In order to remove it all, specify both LVs.

This patch also includes tests to create and remove cache pools and
cache LVs.
2014-02-04 16:50:16 -06:00
Zdenek Kabelac
ef557b8091 tests: update test
Remove some unneeded traces and outputs.
2014-02-04 14:49:38 +01:00
Zdenek Kabelac
42fa0e6dd1 tests: validate acceptable external origin size 2014-01-29 14:59:09 +01:00
Zdenek Kabelac
e9d9852c55 thin: more validation of thin name
Avoid starting conversion of the LV to the thin pool and thin volume
at the same time.  Since this is mostly a user mistake, do not try
to just convert to one of those type, since we cannot assume if the
user wanted LV to become thin volume or thin pool.

Before the fix tool reported pretty strange internal error:
Internal error: Referenced LV lvol1_tdata not listed in VG mvg.

Fixed output:
lvconvert --thinpool lvol0 -T mvg/lvol0
Can't use same LV mvg/lvol0 for thin pool and thin volume.
2014-01-28 13:21:39 +01:00
Zdenek Kabelac
bc5f40ee1c tests: check for mkfs
Test mkfs.ext3 presence for test.
Test also on singlenode cluster.
Speed up a bit slowed down device.
2014-01-28 10:40:08 +01:00
Zdenek Kabelac
c0bd436dcb thin: disable extension of reduced thin with etx.origin
Since we are currently incapable of providing zeroes for
reextended thin volume area, let's disable extension of
such already reduce thin volumes.

(in-release change)
2014-01-28 10:40:08 +01:00
Zdenek Kabelac
6b73d21ba9 locking: avoid dropping locks
When lvm2 command forks, it calls reset_locking(),
which as an unwanted side effect unlinked lock file from filesystem.

Patch changes the behavior to just close locked file descriptor
in children - so the lock is being still properly hold in the parent.
2014-01-27 12:13:29 +01:00
Zdenek Kabelac
f18ee04fab lvmetad: respect LVM_LVMETAD_PIDFILE settings in lvm
Test LVM_LVMETAD_PIDFILE for pid for lvm command.
Fix WHATS_NEW envvar name usage
Fix init order in prepare_lvmetad to respect set vars
and avoid clash with system settings.
Update test to really test the 'is running' message.
2014-01-24 15:59:38 +01:00
Zdenek Kabelac
c1df1f3a81 tests: thin external origin resize 2014-01-23 14:22:34 +01:00
Zdenek Kabelac
efe36fcd43 tests: more testing for online thin metadata resize
Some more tests for online resize, but it's still disabled
by default, since kernel doesn't work yet for this feature.
2014-01-21 13:53:10 +01:00
Zdenek Kabelac
79768b2e9c tests: update testing for xfs 2014-01-20 12:02:33 +01:00
Petr Rockai
e892ac7398 test: Increase the overall timeout to 3 hours. 2014-01-08 17:11:32 +01:00
Petr Rockai
d52c4154c5 test: Time out the entire testsuite after an hour. 2014-01-08 17:11:32 +01:00
Petr Rockai
af8580d756 test: Use klogctl in the harness instead of reading /var/log/messages. 2014-01-08 17:11:32 +01:00
Petr Rockai
1937715d2c test: Add a regression test for pvcreate -ff. 2014-01-08 15:24:43 +01:00
Zdenek Kabelac
2b7f7d0ab4 tests: use compiled lvm for clvmd executed lvs 2014-01-08 13:52:05 +01:00
Zdenek Kabelac
434d95cef3 tests: clear inactive table before resuming in teardown 2013-12-18 10:40:36 +01:00
Zdenek Kabelac
904a02335f tests: hide expected error message
Test typically enables disabled device - so it mostly expects
error target will be reloaded here - thus hide confusing message.
2013-12-17 14:08:54 +01:00
Zdenek Kabelac
fd73b2b7b9 tests: skip pool-label test for lvmetad
Unsupported by lvmetad.
2013-12-17 14:08:54 +01:00
Petr Rockai
56af6cae08 test: Turn check_full into check_system complementary with normal check. 2013-12-15 17:26:28 +01:00
Petr Rockai
97fbbbc150 test: Make the harness optionally less verbose (QUIET=1). 2013-12-15 16:44:47 +01:00
Zdenek Kabelac
c9fe05eee2 tests: count interrupted test as failed 2013-12-10 11:21:40 +01:00
Zdenek Kabelac
e3b7fa4b8d thin: thin metadata resize unsupported with 1.9
Thin kernel target 1.9 still does not support online resize of
thin pool metadata properly - so disable it with expectation
for much higher version - and reenable after fixing kernel.
2013-12-10 11:17:37 +01:00
Alasdair G Kergon
16eab3ec08 config: shorten new sig wiping option string
Rename wipe_signatures_on_new_logical_volumes_when_zeroing  to
wipe_signatures_when_zeroing_new_lvs.
2013-12-09 09:35:47 +00:00
Zdenek Kabelac
2b3adf4eea tests: more limits for python test
It will be most probably more problem with
incomplete initialization of lvm.conf settings
when lvm2app is in use.

Skip cluster & lvmetad test for now.
2013-12-06 10:37:49 +01:00
Zdenek Kabelac
f460d6d9b5 tests: python test needs dmeventd
Until lvm2app respects all lvm.conf setting,
this test require dmeventd.
2013-12-06 10:08:34 +01:00
Zdenek Kabelac
b494881e68 tests: sysrq only when stuck with no output.
If we are stuck in user for too long without output,
grab kernel stack traces.
If we just produce too many lines of output, it's
not probably kernel related bug.
2013-12-05 12:40:47 +01:00
Zdenek Kabelac
c7b733cd6c tests: do not run lvmetad tests without lvmetad
Skip tests when lvmetad is not compiled.
2013-12-05 12:40:47 +01:00
Zdenek Kabelac
aa75698a17 tests: harness prints debug.log
When the test is interrupted because debug.log has got to big,
and the test doesn't react on SIGINT - and needs to be only
killed with SIGKILL - it's still valuable to print at least
a portion of this debug.log (currently 4MB).

LVM_TEST_UNLIMITED  could be set to avoid this limitation
(i.e. when busy-looping lvm command needs to be running
for gdb attachment)
2013-12-05 11:18:15 +01:00
Zdenek Kabelac
76ca82df82 tests: drop RUN... already have this var elsewhere 2013-12-04 21:37:33 +01:00
Zdenek Kabelac
d9461ae89b tests: replace built-in popen
It seems some older bashes have problems to properly execute
both pipes - so replace this code with separate temporary files.
2013-12-04 19:50:53 +01:00
Zdenek Kabelac
e06cfd7437 tests: reuse timeout code for too long debug.log
Jump to the same code used for timeout when no output
is made for long time.

Increase the allowed debug.log size to 32MB.
2013-12-04 19:48:29 +01:00
Zdenek Kabelac
c144305d3e tests: update pvmove-test
Do not lock test when trying to grab cluster lock.
There seems to be still something weird in this test
so it still needs some inspection.
2013-12-04 17:10:31 +01:00
Zdenek Kabelac
7c6b14b74f tests: monitor debug.log size
Show testing directory from test and monitor it in
harness - so when it gets too big - kill test.
2013-12-04 17:10:31 +01:00
Zdenek Kabelac
1592bb216e test: thin snapshot merge
Testing thin snapshot merge cases.
TODO: Probably still misses some cases.
2013-12-04 14:30:26 +01:00
Peter Rajnoha
163666e513 tests: one LV should be active and one inactive in covercmd test 2013-12-04 09:38:00 +01:00
Peter Rajnoha
6232cac86c vgdisplay: select only active volumes groups if -A option is used
Where "active" means "at least one LV is active in the volume group".
2013-12-03 14:43:00 +01:00
Alasdair G Kergon
84394c0219 lvmetad: extend socket/pid file handling
Make it easier to run a live lvmetad in debugging mode and
to avoid conflicts if multiple test instances need to be run
alongside a live one.

No longer require -s when -f is used: use built-in default.
Add -p to lvmetad to specify the pid file.
No longer disable pidfile if -f used to run in foreground.
If specified socket file appears to be genuine but stale, remove it
before use.
On error, only remove lvmetad socket file if created by the same
process.  (Previous code removes socket even while a running instance
is using it!)
2013-11-29 20:56:29 +00:00