-
Notifications
You must be signed in to change notification settings - Fork 23
Add pvresize before lvextend #890
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Running pvresize before lvextend ensures that there is enough spaces for extension.
Growroot is no longer required if pvresize is being run early on, so you can delete this line |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but two notes:
-
Your change could be one line:
sudo pvresize $(sudo pvs --noheadings | head -n 1 | awk '{print $1}')
-
It's a bit of a shame we don't use growroot anymore, but I think it's more important to keep this script clean and consistent than to try and have some complex conditional that does both a pvresize and growroot.
Yeah I agree. Looks like setting a variable is not needed here. |
This reverts commit 94a107c.
@markgoddard What do you think of also making PR with this change for |
We merge changes forwards in this repo, so they will get fixed automatically. I can propose some merges. |
Thanks Mark |
Running pvresize before lvextend ensures that there is enough space for extension.
There are some cases where
lvextend
fails because initial usable space of a physical volume is not enough.This leads the automated setup failure at package or python module installation stage.
As this happens earlier than kayobe setup,
kayobe playbook run etc/kayobe/ansible/growroot.yml
can't be used.stackhpc-kayobe-config/etc/kayobe/ansible/growroot.yml
Lines 87 to 93 in e1a64bd
Therefore I propose adding bash equivalent of the Ansible task above before
lvextend
.The command gets the name of the physical volume by filtering the output of
sudo pvs --noheadings
.head -n 1
is used to take first line of output only thenawk '{print $1}'
is used to take first element of it, which is essentially the way thegrowroot.yml
does to get PV name.