Skip to content
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

Dynamic parititioning scheme #74

Closed
lzap opened this issue Dec 16, 2019 · 2 comments · Fixed by #274
Closed

Dynamic parititioning scheme #74

lzap opened this issue Dec 16, 2019 · 2 comments · Fixed by #274
Assignees

Comments

@lzap
Copy link
Member

lzap commented Dec 16, 2019

I've noticed that we have an undocumented feature (surprise!): dynamic partitioning scheme. Since Foreman does not ship with any dynamic partitioning scheme, I've decided to file a PR to include one with the following explanation:

When a partition template contains line starting with "#Dynamic", the contents will be put into %pre shell scriplet rather and it's expected it creates a file "/tmp/diskpart.cfg" which is then included into the Kickstart partitioning section. This allows generating parititioning scheme on the managed node befure
Anaconda starts installation.

This template is an example of such dynamic partitioning scheme. It follows recommended scheme of Red Hat Enterprise Linux for servers (no extra allocation for hibernation):

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-swapspace

#Dynamic (do not remove this line)

MEMORY=$((`grep MemTotal: /proc/meminfo | sed 's/^MemTotal: *//'|sed 's/ .*//'` / 1024))
if [ "$MEMORY" -lt 2048 ]; then
    SWAP_MEMORY=$(($MEMORY * 2))
elif [ "$MEMORY" -lt 8192 ]; then
    SWAP_MEMORY=$MEMORY
elif [ "$MEMORY" -lt 65536 ]; then
    SWAP_MEMORY=$(($MEMORY / 2))
else
    SWAP_MEMORY=32768
fi

cat <<EOF > /tmp/diskpart.cfg
zerombr yes
clearpart --all --initlabel
part /boot --fstype ext4 --size 200 --asprimary
part swap --size "$SWAP_MEMORY"
part / --fstype ext4 --size 1024 --grow
EOF

The PR is here: theforeman/community-templates#672

@melcorr melcorr self-assigned this Sep 24, 2020
@melcorr
Copy link
Member

melcorr commented Sep 24, 2020

@lzap did this PR get reopened on the new repo?

melcorr pushed a commit to melcorr/foreman-documentation that referenced this issue Sep 25, 2020
@lzap
Copy link
Member Author

lzap commented Oct 12, 2020

Yes I think we can close this one.

@lzap lzap closed this as completed Oct 12, 2020
melcorr pushed a commit to melcorr/foreman-documentation that referenced this issue Oct 14, 2020
spetrosi pushed a commit that referenced this issue Oct 14, 2020
spetrosi pushed a commit that referenced this issue Oct 14, 2020
spetrosi pushed a commit that referenced this issue Oct 14, 2020
spetrosi pushed a commit that referenced this issue Oct 14, 2020
ianf77 pushed a commit to ianf77/foreman-documentation that referenced this issue Feb 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants