Workaround changed LVM behaviour
The vgreduce command has changed behaviour from when we initially wrote the code (2.02.02 versus 2.02.66, 4 years delta): - if there are LVs which will be impacted, it requires --force - otherwise refuses to proceed, but it still returns exit code 0 We handle this by looking to see if it returns "Wrote out consistent volume group" (behaviour unchanged), or if it complains about "--force"; in the case it didn't complete, we retry the operation. We improve a bit the checking of "vgs", as it uses to fail silently and we didn't detect it. New tests for this function should test, I believe, all the expected variations; at the least we now have data files with the expected output. Signed-off-by:Iustin Pop <iustin@google.com> Reviewed-by:
Michael Hanselmann <hansmi@google.com>
Showing
- Makefile.am 2 additions, 1 deletionMakefile.am
- lib/storage.py 16 additions, 5 deletionslib/storage.py
- test/data/vgreduce-removemissing-2.02.02.txt 7 additions, 0 deletionstest/data/vgreduce-removemissing-2.02.02.txt
- test/data/vgreduce-removemissing-2.02.66-fail.txt 34 additions, 0 deletionstest/data/vgreduce-removemissing-2.02.66-fail.txt
- test/data/vgreduce-removemissing-2.02.66-ok.txt 2 additions, 0 deletionstest/data/vgreduce-removemissing-2.02.66-ok.txt
- test/data/vgs-missing-pvs-2.02.02.txt 5 additions, 0 deletionstest/data/vgs-missing-pvs-2.02.02.txt
- test/data/vgs-missing-pvs-2.02.66.txt 2 additions, 0 deletionstest/data/vgs-missing-pvs-2.02.66.txt
- test/ganeti.storage_unittest.py 113 additions, 0 deletionstest/ganeti.storage_unittest.py
Loading
Please register or sign in to comment