integ/config/puppet-modules/puppet-lvm/centos/puppet-lvm.spec
Mihnea Saracin b310077093 Fix resize of filesystems in puppet logical_volume
After system reinstalls there is stale data on the disk
and puppet fails when resizing, reporting some wrong filesystem
types. In our case docker-lv was reported as drbd when
it should have been xfs.

This problem was solved in some cases e.g:
when doing a live fs resize we wipe the last 10MB
at the end of partition:
https://opendev.org/starlingx/stx-puppet/src/branch/master/puppet-manifests/src/modules/platform/manifests/filesystem.pp#L146

Our issue happened here:
https://opendev.org/starlingx/stx-puppet/src/branch/master/puppet-manifests/src/modules/platform/manifests/filesystem.pp#L65
Resize can happen at unlock when a bigger size is detected for the
filesystem and the 'logical_volume' will resize it.
To fix this we have to wipe the last 10MB of the partition after the
'lvextend' cmd in the 'logical_volume' module.

Tested the following scenarios:

B&R on SX with default sizes of filesystems and cgts-vg.

B&R on SX with with docker-lv of size 50G, backup-lv also 50G and
cgts-vg with additional physical volumes:

- name: cgts-vg
    physicalVolumes:
    - path: /dev/disk/by-path/pci-0000:00:0d.0-ata-1.0
    size: 50
    type: partition
    - path: /dev/disk/by-path/pci-0000:00:0d.0-ata-1.0
    size: 30
    type: partition
    - path: /dev/disk/by-path/pci-0000:00:0d.0-ata-3.0
    type: disk

B&R on DX system with backup of size 70G and cgts-vg
with additional physical volumes:

physicalVolumes:
- path: /dev/disk/by-path/pci-0000:00:0d.0-ata-1.0
    size: 50
    type: partition
- path: /dev/disk/by-path/pci-0000:00:0d.0-ata-1.0
    size: 30
    type: partition
- path: /dev/disk/by-path/pci-0000:00:0d.0-ata-3.0
    type: disk

Closes-Bug: 1926591
Change-Id: I55ae6954d24ba32e40c2e5e276ec17015d9bba44
Signed-off-by: Mihnea Saracin <Mihnea.Saracin@windriver.com>
2021-05-22 18:41:22 +03:00

50 lines
1.4 KiB
RPMSpec

%global git_sha d0283da637ae24550fb4ba109a48ef8d5d8c8b84
%global prefix puppetlabs
%global module_dir lvm
Name: puppet-%{module_dir}
Version: 0.5.0
Release: 0%{?_tis_dist}.%{tis_patch_ver}
Summary: Puppet %{module_dir} module
License: Apache
URL: https://github.com/puppetlabs/puppetlabs-lvm
Source0: %{prefix}-%{module_dir}-%{git_sha}.tar.gz
Patch0: 0001-puppet-lvm-kilo-quilt-changes.patch
Patch1: 0002-UEFI-pvcreate-fix.patch
Patch2: 0003-US94222-Persistent-Dev-Naming.patch
Patch3: 0004-extendind-nuke_fs_on_resize_failure-functionality.patch
Patch4: Fix-the-logical-statement-for-nuke_fs_on_resize.patch
Patch5: 0005-Wipe-10MB-after-we-lvextend-the-partitions.patch
BuildArch: noarch
BuildRequires: python2-devel
# According to .fixtures.yml the following puppet modules are also required
Requires: puppet-stdlib
%description
A Puppet module for Logical Resource Management (LVM)
%prep
%setup -c %{module_dir}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%install
install -d -m 0755 %{buildroot}/%{_datadir}/puppet/modules/%{module_dir}
cp -R packstack/puppet/modules/%{module_dir} %{buildroot}/%{_datadir}/puppet/modules
%files
%license packstack/puppet/modules/%{module_dir}/LICENSE
%{_datadir}/puppet/modules/%{module_dir}