Open pallaswept opened 1 year ago
https://github.com/openSUSE/open-build-service/blob/master/dist/obsstoragesetup#L227 VG_SIZE=
vgdisplay -c OBS | cut -d: -f16
returns free space on the VG it should be VG_SIZE=vgdisplay -c OBS | cut -d: -f14
bump :) Just change that 6 to a 4 and it's a working script.
Not a barbed question but an honest curiosity: Why has such a quick and simple fix that completely breaks a critical feature that official documentation instructs us to use, taken 2 months for nothing to happen? Would it help if I made a PR for you? Is there some kind of process holding it up? Can I help somehow?
Feel free to not answer that and just apply the fix, since answering will take longer than fixing it :) But I am genuinely puzzled.
@pallaswept we hear you :) @M0ses ping :) what do you think?
Issue Description
obsstoragesetup script reads VG size incorrectly and fails
Expected Result
Script runs a command to get the size of the VGm but the command is malformed and instead of reading the VG total size, it reads the free space
This means that if you have space used by the server LV as per the instructions, then the server LV space is subtracted from the total size, and then it is subtracted again a few times later, leading the script to believe there is insufficient space
How to Reproduce
1) Install appliance with disk with existing LVM data including server LV as per documentation at here and here 2) Start appliance 3) Be sad at obsstoragesetup service failure when the math goes wrong
https://github.com/openSUSE/open-build-service/blob/master/dist/obsstoragesetup#L227 VG_SIZE=
vgdisplay -c OBS | cut -d: -f16
returns free space on the VG it should be VG_SIZE=vgdisplay -c OBS | cut -d: -f14
Further Information
Here is the server LV of size 40GB out of 100GB total VG:
Script getting the math wrong and accounting for the server volume taking up free space, twice over:
Script using the 16th entry is getting free space not total:
Happy service after changing f16 to f14: