Bug 154691
Summary: | RHEL4: (LVM2) lvextend should default to the size of the pv + current size of lv | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 4 | Reporter: | Corey Marthaler <cmarthal> |
Component: | lvm2 | Assignee: | Dave Wysochanski <dwysocha> |
Status: | CLOSED ERRATA | QA Contact: | |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 4.0 | CC: | agk, dwysocha, mbroz, shillman |
Target Milestone: | --- | Keywords: | FutureFeature |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | acl | ||
Fixed In Version: | RHBA-2008-0776 | Doc Type: | Enhancement |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2008-07-24 20:07:04 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Attachments: |
Description
Corey Marthaler
2005-04-13 15:39:09 UTC
Probably not default to maximum size, but there needs to be a simple way to request it - either a new cmdline flag or a special size value. This request was evaluated by Red Hat Product Management for inclusion in a Red Hat Enterprise Linux maintenance release. Product Management has requested further review of this request by Red Hat Engineering, for potential inclusion in a Red Hat Enterprise Linux Update release for currently deployed products. This request is not yet committed for inclusion in an Update release. Does the %FREE option you added to lvextend address this one? If so it looks like it needs a backport right? It looks to me like agk's %FREE fix does the trick (for the most part) upstream. But it does not cover the exact case corey described in this bug. The downside I found was that if you use the % option, it assumes the %age is against the vg, and ignores any physicalvolumes on the cmdline. Was there a reason the %FREE behaves this way or is it a bug? Also, I checked and the %FREE code is not in RHEL4 nightly. With no PhysicalVolumePath args, we assume all the PVs in the VG, so it works fine: # tools/lvm lvs File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) LV VG Attr LSize Origin Snap% Move Log Copy% lv0 vg0 -wi-a- 96.00M # tools/lvm pvs File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) PV VG Fmt Attr PSize PFree /dev/loop1 vg0 lvm2 a- 252.00M 156.00M /dev/loop2 lvm2 -- 256.00M 256.00M # tools/lvm vgs File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) VG #PV #LV #SN Attr VSize VFree vg0 1 1 0 wz--n- 252.00M 156.00M # tools/lvm lvextend -l +100%FREE vg0/lv0 File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) Extending logical volume lv0 to 252.00 MB Logical volume lv0 successfully resized # tools/lvm lvs File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) LV VG Attr LSize Origin Snap% Move Log Copy% lv0 vg0 -wi-a- 252.00M # tools/lvm version File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) LVM version: 2.02.17-cvs (2006-12-01) Library version: 1.02.10-cvs (2006-08-15) Driver version: 4.5.0 With PV args though - fails b/c there is > 1 PV in the VG, and 100% check is against the VG. You'd either have to do %age math here or extend math: # tools/lvm vgs File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) VG #PV #LV #SN Attr VSize VFree vg0 2 1 0 wz--n- 504.00M 408.00M # tools/lvm lvs File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) LV VG Attr LSize Origin Snap% Move Log Copy% lv0 vg0 -wi-a- 96.00M # tools/lvm pvs File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) PV VG Fmt Attr PSize PFree /dev/loop1 vg0 lvm2 a- 252.00M 156.00M /dev/loop2 vg0 lvm2 a- 252.00M 252.00M # tools/lvm lvextend -l +100%FREE vg0/lv0 /dev/loop2 File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) Extending logical volume lv0 to 504.00 MB Insufficient free space: 102 extents needed, but only 63 available # tools/lvm lvextend -l +63 vg0/lv0 /dev/loop2 File descriptor 4 left open WARNING: Ignoring duplicate config node: filter (seeking filter) Extending logical volume lv0 to 348.00 MB Logical volume lv0 successfully resized I am pretty sure this is an easy one - and I don't even have to use the %FREE thing. I have a patch I'm testing that is simple and seems to work ok. Will talk with agk to confirm. Created attachment 144160 [details]
Patch to make extents optional for lvextend when pvs are on cmdline
Preliminary patch against upstream CVS to allow someone to skip extents arg and
just specify PVS. Needs cleanup and did not fix man page or cmdline yet but
seems to work ok for basic tests.
Alasdair has pointed out that this is more complicated than it looks, because of possible pe ranges on the cmdline, and the fact that you don't know if you can use the extents in the ranges until allocate time. So I've been reading more details of the code now and working on improving the previous patch. I need to look at this again and try to close this out for 4.6. This bugzilla had previously been approved for engineering consideration but Red Hat Product Management is currently reevaluating this issue for inclusion in RHEL4.6. Created attachment 192151 [details]
Updated patch against upstream LVM2 to add "%PV" option
Patch header explains most of it. Add %PV so you can do "lvextend -l +100%PV
vg0/lv0 /dev/foobar". This will extend the LV by 100% of the free extents in
/dev/foobar. Code even handles PE ranges, etc.
Fairly confident something like the above patch is feasible for 4.7. Probably needs some discussion with Alasdair when he gets back to confirm this approach. Created attachment 200201 [details]
Updated patch implementing %PVS option for lvextend and lvcreate
Updated patch based on phone conversation today with agk. I think this
addresses most, if not all of the comments. The simpler syntax of omitting the
-l and -L option if you specify a PV on the cmdline is now accepted. I added
an example in the lvextend man page but did not change the man page syntax.
Patch probably needs a bit more unit testing - only brief unit testing on
lvextend with some simple command lines.
Patch in #14 with slight modifications committed to upstream CVS and should be pulled into next release. Fix verified in lvm2-2.02.37-3.el4. [root@taft-03 dev]# lvextend /dev/taft/grow /dev/sdd1 Extending logical volume grow to 406.96 GB Logical volume grow successfully resized 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-2008-0776.html |