Merge "Reduce thin pool by one more extent"

This commit is contained in:
Zuul 2023-01-27 02:34:56 +00:00 committed by Gerrit Code Review
commit 174089a6a5
2 changed files with 7 additions and 5 deletions

View File

@ -512,9 +512,11 @@ def main(argv):
thin_pool = find_thin_pool(devices, group) thin_pool = find_thin_pool(devices, group)
if thin_pool: if thin_pool:
# total size available, reduced by POOL_METADATA_SIZE # total size available, reduced by POOL_METADATA_SIZE
# rounded down to whole extent # rounded down to whole extent and reduced by 1 extent
# for metadata overhead
size_bytes -= POOL_METADATA_SIZE size_bytes -= POOL_METADATA_SIZE
size_bytes -= size_bytes % PHYSICAL_EXTENT_BYTES size_bytes -= size_bytes % PHYSICAL_EXTENT_BYTES
size_bytes -= PHYSICAL_EXTENT_BYTES
dev_path = '/dev/%s' % devname dev_path = '/dev/%s' % devname
grow_vols = find_grow_vols(opts, devices, group, size_bytes) grow_vols = find_grow_vols(opts, devices, group, size_bytes)

View File

@ -601,13 +601,13 @@ class TestGrowvols(base.BaseTestCase):
mock.call(['vgextend', 'vg', '/dev/sda5']), mock.call(['vgextend', 'vg', '/dev/sda5']),
mock.call(['lvextend', '--poolmetadatasize', '+1073741824B', mock.call(['lvextend', '--poolmetadatasize', '+1073741824B',
'/dev/mapper/vg-lv_thinpool', '/dev/sda5']), '/dev/mapper/vg-lv_thinpool', '/dev/sda5']),
mock.call(['lvextend', '-L+208331079680B', mock.call(['lvextend', '-L+208326885376B',
'/dev/mapper/vg-lv_thinpool', '/dev/sda5']), '/dev/mapper/vg-lv_thinpool', '/dev/sda5']),
mock.call(['lvextend', '--size', '+41666215936B', mock.call(['lvextend', '--size', '+41662021632B',
'/dev/mapper/vg-lv_home']), '/dev/mapper/vg-lv_home']),
mock.call(['lvextend', '--size', '+83332431872B', mock.call(['lvextend', '--size', '+83328237568B',
'/dev/mapper/vg-lv_var']), '/dev/mapper/vg-lv_var']),
mock.call(['lvextend', '--size', '+83332431872B', mock.call(['lvextend', '--size', '+83336626176B',
'/dev/mapper/vg-lv_root']), '/dev/mapper/vg-lv_root']),
mock.call(['xfs_growfs', '/dev/mapper/vg-lv_home']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_home']),
mock.call(['xfs_growfs', '/dev/mapper/vg-lv_var']), mock.call(['xfs_growfs', '/dev/mapper/vg-lv_var']),