-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Disable swap space on nodes at install and upgrade #3884
Conversation
aos-ci-test |
How much of a challenge do you think it'd be to add a task that checks to ensure that we have enough free memory versus swap in use before doing this and perform that as a pre-upgrade check? I believe the formula we'd use is to grab MemFree, SwapTotal, SwapFree from /proc/meminfo and abort if The output of |
That said, if we disable swap while the node is evacuated the memory usage will be vastly different than what it is when prior to performing the upgrade and it's difficult to determine how evacuation will affect usage. |
roles/openshift_node/tasks/main.yml
Outdated
@@ -34,6 +34,32 @@ | |||
dns_ip: "{{ openshift_dns_ip | default(none) | get_dns_ip(hostvars[inventory_hostname])}}" | |||
env_vars: "{{ openshift_node_env_vars | default(None) }}" | |||
|
|||
# https://docs.openshift.com/container-platform/3.4/admin_guide/overcommit.html#disabling-swap-memory | |||
- name: Check for swap usage | |||
command: grep swap /etc/fstab |
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.
grep -v "^#" /etc/fstab | grep swap
or something better to avoid false positives on commented lines?
Updated grep command to ignore commented lines. |
aos-ci-test |
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
aos-ci-test |
aos-ci-test |
[merge] |
[test]ing while waiting on the merge queue |
aos-ci-test |
Evaluated for openshift ansible test up to 38e0c9c |
continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_openshift_ansible/25/) (Base Commit: 2942b03) |
Flake openshift/origin#13271 |
[merge] |
Flake openshift/origin#12629 Downward API volume |
Evaluated for openshift ansible merge up to 38e0c9c |
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_openshift_ansible/222/) (Base Commit: e36b53c) |
@mtnbikenc @sdodson the builtin Ansible "setup" module provides memory-related facts such that we may not need to call |
So, based on that if we choose to add it, if ( ansible_memfree_mb - ansible_memory_mb.swap.used > 0 ) we're good to go? Anyway, given we're performing this either at install time or during upgrade when the node is already drained I'm relatively confident that we won't run into problems.
|
https://trello.com/c/vGmZYJ79/296-3-disable-swap-at-install-and-upgrade