Skip to contentSkip to conversation

master - pvmove: Add support for RAID, mirror, and thin

PATCH Jonathan Brassow 1 participant 1 message Aug 23, 2013

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c59167ec132071d6ab53f928b0775c36a704fe7c
Commit:        c59167ec132071d6ab53f928b0775c36a704fe7c
Parent:        e5c021316843a3b08e4f6d12ec27f06c20ded7da
Author:        Jonathan Brassow <[email protected]>
AuthorDate:    Fri Aug 23 08:57:16 2013 -0500
Committer:     Jonathan Brassow <[email protected]>
CommitterDate: Fri Aug 23 08:57:16 2013 -0500

pvmove: Add support for RAID, mirror, and thin

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.

---
 WHATS_NEW       |    1 +
 man/pvmove.8.in |    5 +-
 tools/pvmove.c  |  124 ++++++++++++++++++++++++++++++++++++++++++------------
 3 files changed, 100 insertions(+), 30 deletions(-)
WHATS_NEW +1 -0
index 76c2ebb..3ea8786 100644
@@ -1,5 +1,6 @@
 Version 2.02.101 - 
 ===================================
+  Add ability to pvmove RAID, mirror, and thin volumes.
   Make lvm2-activation-generator silent unless it's in error state.
   Remove "mpath major is not dm major" msg for mpath component scan (2.02.94).
   Prevent cluster mirror logs from being corrupted by redundant checkpoints.
man/pvmove.8.in +3 -2
index de20abb..ba6ea1e 100644
@@ -75,7 +75,8 @@ is updated so that the Logical Volumes reflect the new data locations.
 Note that this new process cannot support the original LVM1
 type of on-disk metadata.  Metadata can be converted using \fBvgconvert\fP(8).
 
-N.B. The moving of mirrors, snapshots and their origins is not yet supported.
+N.B. The moving of non-thinly provisioned snapshots and their
+origins is not supported.
 
 .SH OPTIONS
 See \fBlvm\fP(8) for common options.
@@ -109,7 +110,7 @@ To move all Physical Extents that are used by simple Logical Volumes on
 .sp
 .B pvmove /dev/sdb1
 .P
-Any mirrors, snapshots and their origins are left unchanged.
+Any non-thinly provisioned snapshots and their origins are left unchanged.
 .P
 Additionally, a specific destination device /dev/sdc1
 can be specified like this:
tools/pvmove.c +96 -28

153 lines not on this page · raw message