* [PATCH 0 of 2] LVM: Split mirror capability
@ 2009-10-13 21:20 ` Jonathan Brassow
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Brassow @ 2009-10-13 21:20 UTC (permalink / raw)
To: lvm-devel; +Cc: dm-devel
Adding code to allow users to split legs off of a mirror wasn't all that
hard. However, I could use some help regarding the nature of the
arguments that should be used to invoke this action.
The following patches introduce a new (horrible) argument '--split' to
lvconvert that signals the intent to split and keep a desired leg of a
mirror. Example run:
[root@bp-01 ~]# lvcreate -m2 -L 500M -n lv vg
Logical volume "lv" created
[root@bp-01 ~]# lvs -a -o name,copy_percent,devices
LV Copy% Devices
LogVol00 /dev/sda2(0)
LogVol01 /dev/sda2(4451)
lv 100.00 lv_mimage_0(0),lv_mimage_1(0),lv_mimage_2(0)
[lv_mimage_0] /dev/sdb1(0)
[lv_mimage_1] /dev/sdc1(0)
[lv_mimage_2] /dev/sdd1(0)
[lv_mlog] /dev/sdi1(0)
[root@bp-01 ~]# lvconvert -m1 --split vg/lv /dev/sdc1
Logical volume lv converted.
[root@bp-01 ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 139.09g
LogVol01 VolGroup00 -wi-ao 9.81g
lv vg mwi-a- 500.00m lv_mlog 100.00
lv_mimage_1 vg -wi-a- 500.00m
You can see from the above that I went as far as to specify the leg I
wanted split off.
Aside from the new '--split' argument not being very good, we also end
up with a new logical volume named, 'lv_mimage_1', which also isn't very
good. Should I change the name via s/_mimage_1/-copy-%d/, or should I
allow the name to be specified (or left alone)?
Here is the current syntax and some others I have thought of:
# New '--split' argument.
# This is suppose to give the user the ability to signify a split
# of the mirror, rather than a reduction/increase in mirror images.
# However, something like '--keep_images' might better signify that
# although we are reducing the number of mirror legs, we want to
# have them presented rather than removed.
prompt> lvconvert -m <n> --split vg/lv <removable device(s)>
# New '--splitmirror <n>' argument
# Replaces '-m <n> --split', and rather than specifying the number
# of legs you want remaining in the mirror when finished, you specify
# the number of legs you want split off.
#
# BTW, you can only split off one leg at a time right now, but I
# don't see a reason why we couldn't split a 4-way mirror into
# 2 2-way mirrors at some point in the future. (Being able to
# specify the removable devices also allows us to choose every
# other device if we chose to.)
prompt> lvconvert --splitmirror 1 vg/lv <removable device(s)>
Please added better ideas if you have them... I am leaning toward the
second example (even though I implemented the 1st in the patches).
Concerning the naming of the newly split off device, we could use the
'-n <name>' argument. If unspecified, we would have to choose some
default.
brassow
--
lvm-devel mailing list
lvm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0 of 2] LVM: Split mirror capability
@ 2009-10-13 21:20 ` Jonathan Brassow
0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Brassow @ 2009-10-13 21:20 UTC (permalink / raw)
To: lvm-devel
Adding code to allow users to split legs off of a mirror wasn't all that
hard. However, I could use some help regarding the nature of the
arguments that should be used to invoke this action.
The following patches introduce a new (horrible) argument '--split' to
lvconvert that signals the intent to split and keep a desired leg of a
mirror. Example run:
[root at bp-01 ~]# lvcreate -m2 -L 500M -n lv vg
Logical volume "lv" created
[root at bp-01 ~]# lvs -a -o name,copy_percent,devices
LV Copy% Devices
LogVol00 /dev/sda2(0)
LogVol01 /dev/sda2(4451)
lv 100.00 lv_mimage_0(0),lv_mimage_1(0),lv_mimage_2(0)
[lv_mimage_0] /dev/sdb1(0)
[lv_mimage_1] /dev/sdc1(0)
[lv_mimage_2] /dev/sdd1(0)
[lv_mlog] /dev/sdi1(0)
[root at bp-01 ~]# lvconvert -m1 --split vg/lv /dev/sdc1
Logical volume lv converted.
[root at bp-01 ~]# lvs
LV VG Attr LSize Origin Snap% Move Log Copy% Convert
LogVol00 VolGroup00 -wi-ao 139.09g
LogVol01 VolGroup00 -wi-ao 9.81g
lv vg mwi-a- 500.00m lv_mlog 100.00
lv_mimage_1 vg -wi-a- 500.00m
You can see from the above that I went as far as to specify the leg I
wanted split off.
Aside from the new '--split' argument not being very good, we also end
up with a new logical volume named, 'lv_mimage_1', which also isn't very
good. Should I change the name via s/_mimage_1/-copy-%d/, or should I
allow the name to be specified (or left alone)?
Here is the current syntax and some others I have thought of:
# New '--split' argument.
# This is suppose to give the user the ability to signify a split
# of the mirror, rather than a reduction/increase in mirror images.
# However, something like '--keep_images' might better signify that
# although we are reducing the number of mirror legs, we want to
# have them presented rather than removed.
prompt> lvconvert -m <n> --split vg/lv <removable device(s)>
# New '--splitmirror <n>' argument
# Replaces '-m <n> --split', and rather than specifying the number
# of legs you want remaining in the mirror when finished, you specify
# the number of legs you want split off.
#
# BTW, you can only split off one leg at a time right now, but I
# don't see a reason why we couldn't split a 4-way mirror into
# 2 2-way mirrors at some point in the future. (Being able to
# specify the removable devices also allows us to choose every
# other device if we chose to.)
prompt> lvconvert --splitmirror 1 vg/lv <removable device(s)>
Please added better ideas if you have them... I am leaning toward the
second example (even though I implemented the 1st in the patches).
Concerning the naming of the newly split off device, we could use the
'-n <name>' argument. If unspecified, we would have to choose some
default.
brassow
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dm-devel] [PATCH 0 of 2] LVM: Split mirror capability
2009-10-13 21:20 ` Jonathan Brassow
@ 2009-10-15 20:59 ` malahal
-1 siblings, 0 replies; 6+ messages in thread
From: malahal @ 2009-10-15 20:59 UTC (permalink / raw)
To: dm-devel, lvm-devel
Jonathan Brassow [jbrassow@redhat.com] wrote:
> [root@bp-01 ~]# lvconvert -m1 --split vg/lv /dev/sdc1
> Logical volume lv converted.
> [root@bp-01 ~]# lvs
> LV VG Attr LSize Origin Snap% Move Log Copy% Convert
> LogVol00 VolGroup00 -wi-ao 139.09g
> LogVol01 VolGroup00 -wi-ao 9.81g
> lv vg mwi-a- 500.00m lv_mlog 100.00
> lv_mimage_1 vg -wi-a- 500.00m
>
> You can see from the above that I went as far as to specify the leg I
> wanted split off.
How about specifying the hidden volume name of legs rather than PVs?
I imagine a leg could be allocated on two different PVs.
> Aside from the new '--split' argument not being very good, we also end
> up with a new logical volume named, 'lv_mimage_1', which also isn't very
> good. Should I change the name via s/_mimage_1/-copy-%d/, or should I
> allow the name to be specified (or left alone)?
We should allow the name to be specified. If not specified, we should
do something like: lvname-split-%date%
> # New '--split' argument.
> # This is suppose to give the user the ability to signify a split
> # of the mirror, rather than a reduction/increase in mirror images.
> # However, something like '--keep_images' might better signify that
> # although we are reducing the number of mirror legs, we want to
> # have them presented rather than removed.
> prompt> lvconvert -m <n> --split vg/lv <removable device(s)>
>
> # New '--splitmirror <n>' argument
> # Replaces '-m <n> --split', and rather than specifying the number
> # of legs you want remaining in the mirror when finished, you specify
> # the number of legs you want split off.
> #
> # BTW, you can only split off one leg at a time right now, but I
> # don't see a reason why we couldn't split a 4-way mirror into
> # 2 2-way mirrors at some point in the future. (Being able to
> # specify the removable devices also allows us to choose every
> # other device if we chose to.)
> prompt> lvconvert --splitmirror 1 vg/lv <removable device(s)>
I like the current syntax if you go with 'lvconvert' command. It already
has -m option, and convert is all about the current LV rather than the
resulting split LV.
I like #2 better but only if you go with a different command like
lvsplit:
promt> lvsplit --splitnum <n> vg/lv <list of hidden lv names>
<n> is the number of mirror legs the user wants to split out and the
number of hidden volume names specified can be less than or equal to <n>
but can't be more.
Thanks, Malahal.
--
lvm-devel mailing list
lvm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/lvm-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dm-devel] [PATCH 0 of 2] LVM: Split mirror capability
@ 2009-10-15 20:59 ` malahal
0 siblings, 0 replies; 6+ messages in thread
From: malahal @ 2009-10-15 20:59 UTC (permalink / raw)
To: lvm-devel
Jonathan Brassow [jbrassow at redhat.com] wrote:
> [root at bp-01 ~]# lvconvert -m1 --split vg/lv /dev/sdc1
> Logical volume lv converted.
> [root at bp-01 ~]# lvs
> LV VG Attr LSize Origin Snap% Move Log Copy% Convert
> LogVol00 VolGroup00 -wi-ao 139.09g
> LogVol01 VolGroup00 -wi-ao 9.81g
> lv vg mwi-a- 500.00m lv_mlog 100.00
> lv_mimage_1 vg -wi-a- 500.00m
>
> You can see from the above that I went as far as to specify the leg I
> wanted split off.
How about specifying the hidden volume name of legs rather than PVs?
I imagine a leg could be allocated on two different PVs.
> Aside from the new '--split' argument not being very good, we also end
> up with a new logical volume named, 'lv_mimage_1', which also isn't very
> good. Should I change the name via s/_mimage_1/-copy-%d/, or should I
> allow the name to be specified (or left alone)?
We should allow the name to be specified. If not specified, we should
do something like: lvname-split-%date%
> # New '--split' argument.
> # This is suppose to give the user the ability to signify a split
> # of the mirror, rather than a reduction/increase in mirror images.
> # However, something like '--keep_images' might better signify that
> # although we are reducing the number of mirror legs, we want to
> # have them presented rather than removed.
> prompt> lvconvert -m <n> --split vg/lv <removable device(s)>
>
> # New '--splitmirror <n>' argument
> # Replaces '-m <n> --split', and rather than specifying the number
> # of legs you want remaining in the mirror when finished, you specify
> # the number of legs you want split off.
> #
> # BTW, you can only split off one leg at a time right now, but I
> # don't see a reason why we couldn't split a 4-way mirror into
> # 2 2-way mirrors at some point in the future. (Being able to
> # specify the removable devices also allows us to choose every
> # other device if we chose to.)
> prompt> lvconvert --splitmirror 1 vg/lv <removable device(s)>
I like the current syntax if you go with 'lvconvert' command. It already
has -m option, and convert is all about the current LV rather than the
resulting split LV.
I like #2 better but only if you go with a different command like
lvsplit:
promt> lvsplit --splitnum <n> vg/lv <list of hidden lv names>
<n> is the number of mirror legs the user wants to split out and the
number of hidden volume names specified can be less than or equal to <n>
but can't be more.
Thanks, Malahal.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0 of 2] LVM: Split mirror capability
2009-10-13 21:20 ` Jonathan Brassow
(?)
(?)
@ 2009-10-26 20:58 ` Alasdair G Kergon
-1 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2009-10-26 20:58 UTC (permalink / raw)
To: lvm-devel
Based on the first proposal, things do seem to fit together nice
and simply.
On Tue, Oct 13, 2009 at 04:20:42PM -0500, Jon Brassow wrote:
> [root at bp-01 ~]# lvconvert -m1 --split vg/lv /dev/sdc1
(1) One lvconvert cmd can only split a mirror into two pieces.
Starting with a 2-way mirror:
lvconvert -m1 -n lvcopy --retainas copy vg/lv lv_mimage1
Splits off lv_mimage1, promotes it to a visible LV and renames it 'lvcopy'.
Starting with a 3-way mirror, it would split off a 2-way mirror (which you
could split further if you wished).
Without -n it would rename it to lv_msplit_N where N is the next unused digit
and msplit is *not* a reserved name.
lvconvert -m1 --retainas unsynced vg/lv lv_mimage1
promotes lv_mimage1 to a read-only visible LV & renames it to
lv_mimage1_unsynced (still a reserved name - you cannot rename it while
in this state). You can now lvremove it, or further use
lvconvert --retainas copy vg/lv_mimage1
to split it properly, rename it and make it writeable (unless the mirror
is itself readonly).
Alasdair
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 0 of 2] LVM: Split mirror capability
2009-10-13 21:20 ` Jonathan Brassow
` (2 preceding siblings ...)
(?)
@ 2009-10-26 21:02 ` Alasdair G Kergon
-1 siblings, 0 replies; 6+ messages in thread
From: Alasdair G Kergon @ 2009-10-26 21:02 UTC (permalink / raw)
To: lvm-devel
Second proposal.
On Tue, Oct 13, 2009 at 04:20:42PM -0500, Jon Brassow wrote:
> # New '--splitmirror <n>' argument
> # Replaces '-m <n> --split', and rather than specifying the number
> # of legs you want remaining in the mirror when finished, you specify
> # the number of legs you want split off.
Actually, that's really a general argument alternative to -m.
Either say -m for what is needed in the final state, or some new argument for
what to change to reach the desired final state, applicable to other lvconvert
functionality too.
So we could have both option 1 and option 2...
Alasdair
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-10-26 21:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-13 21:20 [PATCH 0 of 2] LVM: Split mirror capability Jonathan Brassow
2009-10-13 21:20 ` Jonathan Brassow
2009-10-15 20:59 ` [dm-devel] " malahal
2009-10-15 20:59 ` malahal
2009-10-26 20:58 ` Alasdair G Kergon
2009-10-26 21:02 ` Alasdair G Kergon
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.