Bug 1473175 - Failed to install RHVH without specifying --reserved-percent for volgroup
Summary: Failed to install RHVH without specifying --reserved-percent for volgroup
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-node
Classification: oVirt
Component: Installation & Update
Version: 4.1
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.4
: 4.1
Assignee: Yuval Turgeman
QA Contact: Qin Yuan
URL:
Whiteboard:
Depends On:
Blocks: 1473298
TreeView+ depends on / blocked
 
Reported: 2017-07-20 07:52 UTC by Qin Yuan
Modified: 2017-07-28 14:12 UTC (History)
13 users (show)

Fixed In Version: imgbased-0.9.34-0.1.el7ev
Doc Type: Bug Fix
Doc Text:
Cause: Updating metadata LV to be 1G Consequence: imgbased tries to blindly set the metadata LV to 1G, even if there's no space left in the VG Fix: Check if the VG has enough space for a 1G metadata LV before extending it Result: If no space is left, imgbase will not extend the metadata LV and will issue a warning instead
Clone Of:
: 1473298 (view as bug list)
Environment:
Last Closed: 2017-07-28 14:12:32 UTC
oVirt Team: Node
Embargoed:
rule-engine: ovirt-4.1+
rule-engine: blocker+
sbonazzo: devel_ack+
cshao: testing_ack+


Attachments (Terms of Use)
logs during installation without setting reserved-percent (78.42 KB, application/x-gzip)
2017-07-20 07:52 UTC, Qin Yuan
no flags Details
logs after installation without setting reserved-percent (9.29 MB, application/x-gzip)
2017-07-20 07:54 UTC, Qin Yuan
no flags Details
logs after installation with setting reserved-percent (9.32 MB, application/x-gzip)
2017-07-20 07:59 UTC, Qin Yuan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 79648 0 master MERGED lvm: check for free space before metadata extend 2020-02-23 02:45:59 UTC
oVirt gerrit 79676 0 ovirt-4.1 MERGED lvm: check for free space before metadata extend 2020-02-23 02:45:59 UTC

Description Qin Yuan 2017-07-20 07:52:10 UTC
Created attachment 1301565 [details]
logs during installation without setting reserved-percent

Description of problem:
Using the following partitioning cmds in kickstart to install RHVH:

zerombr
clearpart --all
bootloader --location=mbr
part /boot --fstype=ext4 --size=1024
part pv.01 --size=20000 --grow
volgroup rhvh pv.01
logvol swap --fstype=swap --name=swap --vgname=rhvh --size=8000
logvol none --name=pool --vgname=rhvh --thinpool --size=100000 --grow
logvol / --fstype=ext4 --name=root --vgname=rhvh --thin --poolname=pool --size=50000 --grow
logvol /var --fstype=ext4 --name=var --vgname=rhvh --thin --poolname=pool --size=15360

The installation failed with error:

Traceback (most recent call last):
  File "/usr/lib64/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.7/site-packages/imgbased/__main__.py", line 53, in <module>
    CliApplication()
  File "/usr/lib/python2.7/site-packages/imgbased/__init__.py", line 82, in CliApplication
    app.hooks.emit("post-arg-parse", args)
  File "/usr/lib/python2.7/site-packages/imgbased/hooks.py", line 120, in emit
    cb(self.context, *args)
  File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 169, in post_argparse
    layout.initialize(args.source, args.init_nvr)
  File "/usr/lib/python2.7/site-packages/imgbased/plugins/core.py", line 216, in initialize
    self.app.imgbase.init_layout_from(source, init_nvr)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 292, in init_layout_from
    self.add_layer(initial_base, new_layer)
  File "/usr/lib/python2.7/site-packages/imgbased/imgbase.py", line 184, in add_layer
    self._thinpool().check_metadata_size(resize=True)
  File "/usr/lib/python2.7/site-packages/imgbased/lvm.py", line 323, in check_metadata_size
    self._resize_metadata(min_size_mb)
  File "/usr/lib/python2.7/site-packages/imgbased/lvm.py", line 313, in _resize_metadata
    LVM._lvextend(args)
  File "/usr/lib/python2.7/site-packages/imgbased/utils.py", line 383, in lvextend
    return self.call(["lvextend"] + args, **kwargs)
  File "/usr/lib/python2.7/site-packages/imgbased/utils.py", line 441, in call
    return super(LvmBinary, self).call(*args, stderr=DEVNULL, **kwargs)
  File "/usr/lib/python2.7/site-packages/imgbased/utils.py", line 365, in call
    stdout = call(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/imgbased/utils.py", line 147, in call
    return subprocess.check_output(*args, **kwargs).strip()
  File "/usr/lib64/python2.7/subprocess.py", line 575, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['lvextend', '--poolmetadatasize', '1024M', u'rhvh/pool']' returned non-zero exit status 5

Still can log into system, and the VFree is 0:
[root@dhcp-10-111 ~]# vgs
  VG   #PV #LV #SN Attr   VSize   VFree
  rhvh   1   5   0 wz--n- 231.88g    0 

As per Bug 1131247, user has to add '--reserved-percent' or '--reserved-space' to volgroup when using 'logvol --thinpool --grow', otherwise there will be no free space in volume group.
The traceback error above was caused by no free space left in volume group to extend the size of poolmetadata.

Tried specifying 'volgroup rhvh pv.01 --reserved-percent=5', the installation succeeded .

RHVH has to notify users about this change caused by Bug 1131247, or finds a way to solve the above error without adding '--reserved-percent' or '--reserved-space'.


Version-Release number of selected component (if applicable):
redhat-virtualization-host-4.1-20170714.1
RHVH-4.1-20170718.2-RHVH-x86_64-dvd1.iso


How reproducible:
100%


Steps to Reproduce:
1. Set the above partitioning cmds and other mandatory cmds in kickstart file.
2. Install redhat-virtualization-host-4.1-20170714.1 via Anaconda text mode.


Actual results:
1. Installation failed with the error above.


Expected results:
1. The installation won't fail, or add comments to doc to notify users who are using 'logvol --thinpool --grow' that they have to add '--reserved-percent' or '--reserved-space' to volgroup.


Additional info:

Comment 1 Qin Yuan 2017-07-20 07:54:44 UTC
Created attachment 1301568 [details]
logs after installation without setting reserved-percent

Comment 2 Qin Yuan 2017-07-20 07:59:28 UTC
Created attachment 1301574 [details]
logs after installation with setting reserved-percent

Comment 3 Qin Yuan 2017-07-26 09:53:43 UTC
Verify Versions:
RHVH-4.1-20170723.1-RHVH-x86_64-dvd1.iso
redhat-virtualization-host-4.1-20170721.0
imgbased-0.9.34-0.1.el7ev.noarch 

Verify Steps and results:

Part1, to verify without specifying --reserved-percent

1. Prepare kickstart file to include all mandatory parameters, the partitioning configurations are as in comment #0
2. Install RHVH via PXE.
3. After installation finished, log into system, run `lvs -a`, `vgs`:

[root@fctest ~]# lvs -a
  LV                      VG   Attr       LSize    Pool Origin                Data%  Meta%  Move Log Cpy%Sync Convert
  home                    rhvh Vwi-a-tz--    1.00g pool                       3.24                                   
  [lvol0_pmspare]         rhvh ewi-------  100.00m                                                                   
  pool                    rhvh twi-aotz-- <190.99g                            3.12   4.14                            
  [pool_tdata]            rhvh Twi-ao---- <190.99g                                                                   
  [pool_tmeta]            rhvh ewi-ao----  100.00m                                                                   
  rhvh-4.1-0.20170721.0   rhvh Vwi---tz-k <175.99g pool root                                                         
  rhvh-4.1-0.20170721.0+1 rhvh Vwi-aotz-- <175.99g pool rhvh-4.1-0.20170721.0 2.84                                   
  root                    rhvh Vwi-a-tz-- <175.99g pool                       2.84                                   
  swap                    rhvh -wi-ao----    7.81g                                                                   
  tmp                     rhvh Vwi-a-tz--    2.00g pool                       3.23                                   
  var                     rhvh Vwi-aotz--   15.00g pool                       3.75                                   
  var-log                 rhvh Vwi-a-tz--    8.00g pool                       1.66                                   
  var-log-audit           rhvh Vwi-a-tz--    2.00g pool                       3.20                                   

[root@fctest ~]# vgs
  VG   #PV #LV #SN Attr   VSize    VFree
  rhvh   1  10   0 wz--n- <199.00g    0 

4. run `grep resizing /var/log/anaconda/program.log`:

[root@fctest ~]# grep resizing /var/log/anaconda/program.log 
09:20:16,036 INFO program: 2017-07-26 17:18:00,923 [WARNING] (MainThread) Not resizing metadata: 924.0 > 0.0


Part2, to verify with specifying --reserved-percent

1. Prepare kickstart file to include all mandatory parameters, the partitioning configurations are the same as in part1, except adding --reserved-percent=2
2. Install RHVH via PXE.
3. After installation finished, log into system, run `lvs -a`, `vgs`:

[root@fctest ~]# lvs -a
  LV                      VG   Attr       LSize   Pool Origin                Data%  Meta%  Move Log Cpy%Sync Convert
  home                    rhvh Vwi-a-tz--   1.00g pool                       3.24                                   
  [lvol0_pmspare]         rhvh ewi-------  96.00m                                                                   
  pool                    rhvh twi-aotz-- 181.04g                            3.19   0.40                            
  [pool_tdata]            rhvh Twi-ao---- 181.04g                                                                   
  [pool_tmeta]            rhvh ewi-ao----   1.00g                                                                   
  rhvh-4.1-0.20170721.0   rhvh Vwi---tz-k 166.04g pool root                                                         
  rhvh-4.1-0.20170721.0+1 rhvh Vwi-a-tz-- 166.04g pool rhvh-4.1-0.20170721.0 2.90                                   
  root                    rhvh Vwi-aotz-- 166.04g pool                       2.92                                   
  swap                    rhvh -wi-ao----   7.81g                                                                   
  tmp                     rhvh Vwi-a-tz--   2.00g pool                       3.23                                   
  var                     rhvh Vwi-aotz--  15.00g pool                       3.65                                   
  var-log                 rhvh Vwi-a-tz--   8.00g pool                       1.66                                   
  var-log-audit           rhvh Vwi-a-tz--   2.00g pool                       3.20                                   

[root@fctest ~]# vgs
  VG   #PV #LV #SN Attr   VSize    VFree 
  rhvh   1  10   0 wz--n- <199.00g <9.05g

4. run `grep resizing /var/log/anaconda/program.log`:
[root@fctest ~]# grep resizing /var/log/anaconda/journal.log 
[root@fctest ~]# 


Conclusions:
1. Without specifying --reserved-percent, the installation procedure doesn't fail. The size of pool_tmeta hasn't been extended to 1G, and there is a warning message saying "Not resizing metadata: 924.0 > 0.0", just as designed.

2. With specifying --reserved-percent, the size of pool_tmeta is extented to 1G, there is no warning message saying "Not resizing metadata..", just as designed.

The bug is verified.


Note You need to log in before you can comment on or make changes to this bug.