Description
Use Case
We've recently upgraded the LVM module to get access to the unless_vg setting for physical volumes within hieradata.
Formerly the hieradata would have been
physical_volumes:
- /dev/sdb
Is changed to
physical_volumes:
/dev/sdb:
unless_vg: 'local_vg'
This then fails during a puppet run with messages like
Error: Could not remove physical volume /dev/sdb from volume group 'local_vg'; this physical volume may be in use and may require a manual data migration (using pvmove) before it can be removed (Execution of '/sbin/vgreduce local_vg /dev/sdb' returned 5: Physical volume "/dev/sdb" still in use)
Error: /Stage[main]/Lvm/Lvm::Volume_group[local_vg]/Volume_group[local_vg]/physical_volumes: change from ['/dev/sdb'] to [
{
'/dev/sdb' => {
'unless_vg' => 'local_vg'
}
}] failed: Could not remove physical volume /dev/sdb from volume group 'local_vg'; this physical volume may be in use and may require a manual data migration (using pvmove) before it can be removed (Execution of '/sbin/vgreduce local_vg /dev/sdb' returned 5: Physical volume "/dev/sdb" still in use)
Describe the Solution You Would Like
Since the physical device itself is not changed puppet should not be failing.
Describe Alternatives You've Considered
None - I can't of a workaround.
Additional Context
Its impossible to add the unless_vg option to existing configurations - which we were hoping to use to workaround the issue of disc names changing in RHEL/Rocky 9.4