summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* toollib: remove unused arg from process_each_lv_in_vgdev-dct-process-v2-part1David Teigland2013-08-293-4/+2
| | | | | The failed_lvnames arg is no longer used since the cmd_vg replicator wrapper was removed.
* toollib: improve error message in process_each_lv_in_vgDavid Teigland2013-08-291-6/+14
| | | | Include in the error message the lv name args that were not found.
* toollib: rewrite process_each_lvDavid Teigland2013-08-291-313/+332
| | | | | | - Copy the same form as the new process_each_vg. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: rewrite process_each_vgDavid Teigland2013-08-291-146/+234
| | | | | | | | - Split the collecting of arguments from processing them. - The split allows the two different loops through vgs to be replaced by a single loop. - Replace unused struct cmd_vg and cmd_vg_read() replicator code with struct vg and vg_read() directly.
* toollib: add ENABLE_ALL_VGS flagDavid Teigland2013-08-292-13/+14
| | | | | | | The ENABLE_ALL_VGS flag is added to the command structure for commands that should process all vgs when they call process_each_vg or process_each_lv with no args. This will be used in later patches to process_each functions.
* reporter: Adapt pvseg reporting to label-type fields.Petr Rockai2013-08-282-4/+9
|
* reporter: Deal correctly with dummy PVs/labels.Petr Rockai2013-08-282-4/+10
|
* toollib: Report errors on non-PV arguments to process_each_label.Petr Rockai2013-08-281-1/+5
|
* pv_label: NULL result is not always an internal error.Petr Rockai2013-08-281-1/+4
|
* report: Make PV UUID into a "label" type field.Petr Rockai2013-08-283-2/+18
|
* report: Iterate over labels instead of PVs for label-only reports.Petr Rockai2013-08-281-2/+2
|
* report: Make PMdaFree into a "label" field.Petr Rockai2013-08-282-4/+3
|
* report: Adapt _pvfmt_disp to label-based reporting.Petr Rockai2013-08-282-5/+5
|
* report: Add a proper "label" field type.Petr Rockai2013-08-283-11/+25
|
* report: Make dev_size and dev_name columns' type "label".Petr Rockai2013-08-282-8/+4
|
* label: Track a device pointer in struct label.Petr Rockai2013-08-282-1/+4
|
* metadata: Add a pv_label accessor (go from a PV to its label).Petr Rockai2013-08-282-0/+11
|
* metadata: Add lvmcache_info_mda_free as a companion to pv_mda_free.Petr Rockai2013-08-282-5/+13
|
* toollib: Implement process_each_label.Petr Rockai2013-08-282-0/+64
|
* labeller: Make the use of "private" as "fmt" explicit.Petr Rockai2013-08-289-13/+13
| | | | | | | All labellers always use the "private" (void *) field as the fmt pointer. Making this fact explicit in the type of the labeller simplifies the label reporting code which needs to extract the format. Moreover, it removes a number of error-prone casts from the code.
* metadata: Nuke the exported "pv_read" function.Petr Rockai2013-08-282-39/+0
|
* metadata: Fix handling of orphan PV linking & re-linking.Petr Rockai2013-08-281-3/+28
|
* metadata: Avoid pv_read in find_pv_by_name.Petr Rockai2013-08-281-14/+20
|
* pvremove: Avoid using pv_read in favour of scanning.Petr Rockai2013-08-281-36/+39
|
* test: Fix fallout from pv_read changes.Petr Rockai2013-08-282-15/+22
|
* pvresize: Do not use pv_read (get the PV from orphan VG).Petr Rockai2013-08-281-33/+18
|
* test: Add a test for the failing pv_read optimisation.Petr Rockai2013-08-281-0/+26
|
* toollib: Drop the pv_read optimisation.Petr Rockai2013-08-281-47/+46
| | | | | | | Only reading a single PV works correctly only in very limited circumstances. Moreover, we can't rely on the MDA available on the PV either, since it may be out of date in some circumstances (until now, we believed that PVs that have an empty MDA are always orphans, but this is not 100% reliable either).
* metadata: Do not try to check vg_name of a NULL PV.Petr Rockai2013-08-281-1/+1
|
* test: Set the timeout to 3 minutes (was 5s accidentally).Petr Rockai2013-08-281-1/+1
|
* test: Add a new "check_full" target, which also tests with real /dev.Petr Rockai2013-08-282-1/+17
| | | | | | | The original "check" target stays confined to a local device directory, while check_full does 6 flavours, 3 with a local device directory and 3 with the global /dev directory (the latter are prefixed with "s" for "system"). I.e.: normal, cluster, lvmetad, snormal, scluster, slvmetad.
* test: Check for flavoured variables earlier.Petr Rockai2013-08-281-10/+10
| | | | | This is necessary to make LVM_TEST_DEVDIR flavourable, and in turn have flavours that use the global /dev (which can in turn be managed by udev).
* test: Remove a redundant drain() from the timeout path.Petr Rockai2013-08-281-1/+0
|
* test: Make timeouts a little more robust & verbose.Petr Rockai2013-08-281-3/+4
|
* TEST: Add a timeout to the harness, killing tests after 2 minutes.Petr Rockai2013-08-281-11/+39
|
* TEST: Add tests for lvchange actions of RAID under thinJonathan Brassow2013-08-271-118/+197
| | | | | | | | | | | | | Patch includes RAID1,4,5,6,10 tests for: - setting writemostly/writebehind * syncaction changes (i.e. scrubbing operations) - refresh (i.e. reviving devices after transient failures) - setting recovery rate (sync I/O throttling) while the RAID LVs are under a thin-pool (both data and metadata) * not fully tested because I haven't found a way to force bad blocks to be noticed in the testsuite yet. Works just fine when dealing with "real" devices.
* test: pvmove tests for all the different segment types.Jonathan Brassow2013-08-261-0/+304
| | | | | | | Test moving linear, mirror, snapshot, RAID1,5,10, thinpool, thin and thin on RAID. Perform the moves along with a dummy LV and also without the dummy LV by specifying a logical volume name as an argument to pvmove.
* pvmove: Allow moving snapshot/origin. Disallow converting and merging LVsJonathan Brassow2013-08-263-10/+9
| | | | | | The patch allows the user to also pvmove snapshots and origin logical volumes. This means pvmove should be able to move all segment types. I have, however, disallowed moving converting or merging logical volumes.
* pvmove: Fix inability to specify LV name when moving RAID, mirror, or thin LVJonathan Brassow2013-08-262-1/+26
| | | | | | | | | | | Top-level LVs (like RAID, mirror or thin) are ignored when determining which portions of an LV to pvmove. If the user specified the name of an LV to move and it was one of the above types, it would be skipped. The code would never move on to check whether its sub-LVs needed moving because their names did not match what the user specified. The solution is to check whether a sub-LVs is part of the LV whose name was specified by the user - not just if there was a name match.
* WHATS_NEW: for 4d3b5724e0b51782000a45027de00e0fed1c9833Peter Rajnoha2013-08-261-0/+1
|
* udev: inform lvmetad about lost PV labelPeter Rajnoha2013-08-262-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In stacked environment where we have a PV layered on top of a snapshot LV and then removing the LV, lvmetad still keeps information about the PV: [0] raw/~ $ pvcreate /dev/sda Physical volume "/dev/sda" successfully created [0] raw/~ $ vgcreate vg /dev/sda Volume group "vg" successfully created [0] raw/~ $ lvcreate -L32m vg Logical volume "lvol0" created [0] raw/~ $ lvcreate -L32m -s vg/lvol0 Logical volume "lvol1" created [0] raw/~ $ pvcreate /dev/vg/lvol1 Physical volume "/dev/vg/lvol1" successfully created [0] raw/~ $ lvremove -ff vg/lvol1 Logical volume "lvol1" successfully removed [0] raw/~ $ pvs No device found for PV BdNlu2-7bHV-XcIp-mFFC-PPuR-ef6K-yffdzO. PV VG Fmt Attr PSize PFree /dev/sda vg lvm2 a-- 124.00m 92.00m [0] raw/~ $ pvscan --cache --major 253 --minor 3 Device 253:3 not found. Cleared from lvmetad cache. This is because of the reactivation that is done just before snapshot removal as part of the process (vg/lvol1 from the example above). This causes a CHANGE event to be generated, but any scan done on the LV does not see the original data anymore (in this case the stacked PV label on top) and consequently the ID_FS_TYPE="LVM2_member" (provided by blkid scan) is not stored in udev db anymore for the LV. Consequently, the pvscan --cache is not run anymore as the dev is not identified as LVM PV by the "LVM2_member" id - lvmetad loses this info and still keeps records about the PV. We can run into a very similar problem with erasing the PV label directly: [0] raw/~ $ lvcreate -L32m vg Logical volume "lvol0" created [0] raw/~ $ pvcreate /dev/vg/lvol0 Physical volume "/dev/vg/lvol0" successfully created [0] raw/~ $ dd if=/dev/zero of=/dev/vg/lvol0 bs=1M dd: error writing '/dev/vg/lvol0': No space left on device 33+0 records in 32+0 records out 33554432 bytes (34 MB) copied, 0.380921 s, 88.1 MB/s [0] raw/~ $ pvs PV VG Fmt Attr PSize PFree /dev/sda vg lvm2 a-- 124.00m 92.00m /dev/vg/lvol0 lvm2 a-- 32.00m 32.00m [0] raw/~ $ pvscan --cache --major 253 --minor 2 No PV label found on /dev/vg/lvol0. This patch adds detection of this change from ID_FS_LABEL="LVM2_member" to ID_FS_LABEL="<whatever_else>" and hence informing the lvmetad about PV being gone.
* thin: support lvchange for data and metadataZdenek Kabelac2013-08-262-1/+8
| | | | | Support lvchange operation on stacked thin pool data and metadata volumes.
* test: add process-each-vg and process-each-lvDavid Teigland2013-08-232-0/+1218
| | | | | | | These test the toollib functions that select vgs/lvs to process based on command line args: empty, vg name(s), lv names(s), vg tag(s), lv tags(s), and combinations of all.
* test: add process-each-duplicate-vgnamesDavid Teigland2013-08-231-0/+53
| | | | | Test that vgs shows both vgs when two vgs exist with the same name but different uuids.
* test: add vg-name-from-envDavid Teigland2013-08-231-0/+104
| | | | | | vg name should come from env var LVM_VG_NAME for commands that take vg name and lv name, but vg name is not specified on command line.
* misc: make lv_is_on_pv use for_each_sub_lv to walk LV treeJonathan Brassow2013-08-231-71/+55
| | | | | Make lv_is_on_pv use for_each_sub_lv to walk the LV tree. This reduces code duplication.
* pvmove: Ability to move thin volumesJonathan Brassow2013-08-231-8/+3
| | | | | The previous commit was missing the code to allow moving thin volumes.
* pvmove: Add support for RAID, mirror, and thinJonathan Brassow2013-08-233-30/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch allows pvmove to operate on RAID, mirror and thin LVs. The key component is the ability to avoid moving a RAID or mirror sub-LV onto a PV that already has another RAID sub-LV on it. (e.g. Avoid placing both images of a RAID1 LV on the same PV.) Top-level LVs are processed to determine which PVs to avoid for the sake of redundancy, while bottom-level LVs are processed to determine which segments/extents to move. This approach does have some drawbacks. By eliminating whole PVs from the allocation list, we might miss the opportunity to perform pvmove in some senarios. For example, if we have 3 devices and a linear uses half of the first, a RAID1 uses half of the first and half of the second, and a linear uses half of the third (FIGURE 1); we should be able to pvmove the first device (FIGURE 2). FIGURE 1: [ linear ] [ -RAID- ] [ linear ] [ -RAID- ] [ ] [ ] FIGURE 2: [ moved ] [ -RAID- ] [ linear ] [ moved ] [ linear ] [ -RAID- ] However, the approach we are using would eliminate the second device from consideration and would leave us with too little space for allocation. In these situations, the user does have the ability to specify LVs and move them one at a time.
* Thin: Make 'lv_is_on_pv(s)' work with thin typesJonathan Brassow2013-08-231-1/+23
| | | | | | | | The pool metadata LV must be accounted for when determining what PVs are in a thin-pool. The pool LV must also be accounted for when checking thin volumes. This is a prerequisite for pvmove working with thin types.
* Misc: Make get_pv_list_for_lv() available to more than just RAIDJonathan Brassow2013-08-233-41/+80
| | | | | | The function 'get_pv_list_for_lv' will assemble all the PVs that are used by the specified LV. It uses 'for_each_sub_lv' to traverse all of the sub-lvs which may compose it.