Skip to content

Commit dba7d2b

Browse files
committed
fix: Fix PV grow_to_fill feature
We need to set the `grow_to_fill` property on the LVMPV format not on the block device and the target size for the resize needs to be size of the PV, 'self._device' is the pool (VG) in this case. Related: storaged-project/blivet#1320 Resolves: RHEL-73244
1 parent 59e9390 commit dba7d2b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

library/blivet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,8 +1853,8 @@ def _manage_members(self):
18531853
pv.format.update_size_info() # set pv to be resizable
18541854

18551855
if pv.format.resizable:
1856-
pv.grow_to_fill = True
1857-
ac = ActionResizeFormat(pv, self._device.size)
1856+
pv.format.grow_to_fill = True
1857+
ac = ActionResizeFormat(pv, pv.size)
18581858
self._blivet.devicetree.actions.add(ac)
18591859
else:
18601860
log.warning("cannot grow/resize PV '%s', format is not resizable", pv.name)

tests/verify-pool-member-pvsize.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111

1212
- name: Verify each PV size
1313
assert:
14-
that: (dev_size.bytes - actual_pv_size.stdout | int) |
15-
abs / actual_pv_size.stdout | int < 0.04
14+
that: (dev_size.bytes - actual_pv_size.stdout | int) <= 4194304
1615
msg: >-
17-
PV resize failure; size difference too big
16+
Unexpected difference between PV size and block device size:
1817
(device size: {{ dev_size.bytes }})
1918
(actual PV size: {{ actual_pv_size.stdout }})
2019

0 commit comments

Comments
 (0)