Jon, putting this into your responsibilty. Thanks, Heinz
Rerouting to Petr, as Jon seems to be busy these days.
This doesn't seem to be hard to fix, I can try to have a look over the weekend, but I am on PTO afterwards, so if I don't get to send a patch by Sunday, it'll have to wait till after 10th when I'm back (unless someone else can pick up the ball).
After a discussion, we decided my intended solution (interpreting the PVs depending on their current allocation status with regards to the mirror in question), while doable and reasonable, would be probably somewhat confusing. To that end, we will instead require the operation to be done in two steps, which, for all I can tell, should not compromise any of the use-cases, and gives the user a much better and more transparent control over allocation. It also avoids any possibly confusing behaviours. What needs to be changed then is to disallow operations that both allocate and de-allocate space in lvconvert, printing an informative error message requesting the operation to be performed in two steps. (We *might* allow an exception for cases where a single step works well enough, and especially if there are existing tools or scripts relying on this behaviour. Specifically, all invocations with no explicit PVs given can continue to work as before.) I will submit a patch. Corey, if you think the use-case for allowing the above operations (add logs, remove legs at once, specifying PVs to use) in a single step are compelling, please let me know and we can do that as well, at the expense of a somewhat more complicated (harder to understand) UI.
Checked in upstream.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: When converting a mirror in such a way that adds devices - either to the image count or log - there must be enough devices available to make the change or the command will fail. This is especially pertinent when specifying devices (PVs) to be used for the conversion. Specified PVs are treated in the following manor when converting: Up-converting (adding devices to the mirror or its log): When PVs are specified, they are treated as the only available source for allocation. You must specify enough PVs to satisfy the request. Down-converting (removing devices from the mirror or its log): When PVs are specified, they are treated as the preferential devices to be removed. If there are more images to be removed than PVs specified, the remaining images are chosen by LVM.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,8 +1,3 @@ -When converting a mirror in such a way that adds devices - either to the image count or log - there must be enough devices available to make the change or the command will fail. This is especially pertinent when specifying devices (PVs) to be used for the conversion. +When converting a mirror in such a way that adds devices (either to the image count or log) there must be enough devices available to make the change or the command will fail. This is especially pertinent when specifying physical volumes to be used for the conversion. - +When up-converting (adding devices to the mirror or its log) and physical volumes are specified, they are treated as the only available source for allocation. Ensure that enough physical volumes are present to satisfy the request. -Specified PVs are treated in the following manor when converting: +When down-converting (removing devices from the mirror or its log), and physical volumes are specified, they are treated as the preferential devices to be removed. If there are more images to be removed than physical volumes specified, the remaining images are chosen by LVM.-Up-converting (adding devices to the mirror or its log): -When PVs are specified, they are treated as the only available source for allocation. You must specify enough PVs to satisfy the request. - -Down-converting (removing devices from the mirror or its log): -When PVs are specified, they are treated as the preferential devices to be removed. If there are more images to be removed than PVs specified, the remaining images are chosen by LVM.
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
This request was erroneously denied for the current release of Red Hat Enterprise Linux. The error has been fixed and this request has been re-proposed for the current release.
Fixed in lvm2-2.02.84-1.el5
This operation is no longer allowed. Marking verified. [root@grant-02 ~]# lvconvert -m 3 --mirrorlog core grant/mirror /dev/sdc3 /dev/sdc1 Cannot both allocate and free extents when specifying physical volumes to use. Please specify the operation in two steps. 2.6.18-256.el5 lvm2-2.02.84-3.el5 BUILT: Wed Apr 27 03:42:24 CDT 2011 lvm2-cluster-2.02.84-3.el5 BUILT: Wed Apr 27 03:42:43 CDT 2011 device-mapper-1.02.63-2.el5 BUILT: Fri Mar 4 10:23:17 CST 2011 device-mapper-event-1.02.63-2.el5 BUILT: Fri Mar 4 10:23:17 CST 2011 cmirror-1.1.39-10.el5 BUILT: Wed Sep 8 16:32:05 CDT 2010 kmod-cmirror-0.1.22-3.el5 BUILT: Tue Dec 22 13:39:47 CST 2009
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-1071.html