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

configuge_hugepages does not work anymore #410

Closed
bartowl opened this issue Feb 15, 2024 · 1 comment · Fixed by #412
Closed

configuge_hugepages does not work anymore #410

bartowl opened this issue Feb 15, 2024 · 1 comment · Fixed by #412
Labels
Milestone

Comments

@bartowl
Copy link
Contributor

bartowl commented Feb 15, 2024

configure_hugepages does not disable the task in orahost/tasks/main.yml:370 and in effect it sets huge pages to 0 regardless of previous value even when having this boolean set to false. (missing when condition at task)
Temporary workaround is to redefine oracle_hugepages with empty list

@Rendanic Rendanic added the bug label Feb 17, 2024
@Rendanic
Copy link
Collaborator

Hi Bartek,
this bug is not new in 4.x. It is broken in 3.x as well:

/~https://github.com/oravirt/ansible-oracle/blob/release/3.x/roles/orahost/tasks/main.yml

- name: Oracle hugepages
  ansible.posix.sysctl:
    name: "{{ item.name }}"
    value: "{{ item.value }}"
    state: present
    reload: true
    ignoreerrors: true
  with_items: "{{ oracle_hugepages }}"
  register: systclcmd
  tags: sysctl,hugepages
configure_hugepages: true
configure_hugepages_by: memory              # percentage/memory
percent_hugepages: 50                       # Percentage (0-100) of total RAM to dedicate to hugepages, Configures vm.nr_hugepages
size_in_gb_hugepages: 1                     # The amount of RAM in GB to dedicate to hugepages
nr_hugepages_percent: "{{ ((((percent_hugepages / 100) * ansible_memtotal_mb) / 2) + 2) | round | int }}"
nr_hugepages_memory: "{{ (((size_in_gb_hugepages * 1024) / 2) + 2) | round | int }}"
nr_hugepages: "{% if configure_hugepages %}\
                 {%- if configure_hugepages_by | lower == 'percentage' %}{{ nr_hugepages_percent }}\
                 {%- elif configure_hugepages_by | lower == 'memory' %}{{ nr_hugepages_memory }}\
                 {%- endif %}\
                 {%- else %}0\
               {%- endif %}"

nr_hugepages is always 0 when configure_hugepages is false. That has not been changed in 4.x

In Release 4.x:
/~https://github.com/oravirt/ansible-oracle/blob/v4.4.2/roles/orahost/tasks/main.yml

- name: Oracle hugepages
  ansible.posix.sysctl:
    name: "{{ item.name }}"
    value: "{{ item.value }}"
    state: present
    reload: true
    ignoreerrors: true
  with_items: "{{ oracle_hugepages }}"
  register: systclcmd
  tags: sysctl,hugepages,molecule-idempotence-notest
configure_hugepages: true
configure_hugepages_by: memory
nr_hugepages: "{% if configure_hugepages %}\
                 {%- if configure_hugepages_by | lower == 'percentage' %}{{ nr_hugepages_percent }}\
                 {%- elif configure_hugepages_by | lower == 'memory' %}{{ nr_hugepages_memory }}\
                 {%- endif %}\
                 {%- else %}0\
               {%- endif %}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants