The LVM related modules filesystem and lvol
- https://docs.ansible.com/ansible/latest/modules/filesystem_module.html
- https://docs.ansible.com/ansible/latest/modules/lvol_module.html
are unable to manage xfs and swap filesystems on RHEL 7/8
When trying to grow an xfs filesystem using the filesystem module, an error occurs.
Underneath it’s using xfs_growfs, but that command required a mountpoint. The module however provides the /dev path which isn’t supported anymore
RHEL 8
Failure
xfs_growfs /dev/vg.appl/lv.taopt
xfs_growfs: /dev/vg.appl/lv.taopt is not a mounted XFS filesystem
Working fine
xfs_growfs /opt/testapp
meta-data=/dev/mapper/vg.appl-lv.taopt isize=512 agcount=6, agsize=32768 blks
= sectsz=512 attr=2, projid32bit=1
= crc=1 finobt=1, sparse=1, rmapbt=0
= reflink=1
data = bsize=4096 blocks=196608, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0, ftype=1
log =internal log bsize=4096 blocks=1368, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
I was able to use the lvol module and the resizefs option, but filesystem clearly states in the documentation that it support xfs too
RHEL 7/8
The 2nd issue is resizing a swap partition. There seems to be no workaround as both filesystem and lvol module can’t resize swap
Using filesystem to resize will display the message
“msg”: “module does not support resizing swap filesystem yet.”
and using lvol reports
“msg”: “Unable to resize lv.paging00 to 4g”, “rc”: 5
Logged a support ticket at Red Hat, but they replied these are community managed modules and should therefore be fixed by the community.
Kind regards,
René