puppetlabs-lvm icon indicating copy to clipboard operation
puppetlabs-lvm copied to clipboard

Switch from physical volume without unless_vg to with, using same disc fails - not sure if this should be a bug ....

Open iscb1962 opened this issue 1 year ago • 0 comments

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

iscb1962 avatar Sep 20 '24 08:09 iscb1962