Skip to content

Commit

Permalink
Merge pull request #1386 from wanyaoqi/fix/add-hugepage-check
Browse files Browse the repository at this point in the history
fix: enable hugepage add more checks
  • Loading branch information
zexi authored Nov 26, 2024
2 parents 19a4d56 + 87970f6 commit beb7240
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions onecloud/roles/utils/detect-os/vars/debian.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
is_debian_based: true
is_debian_based_x86: true
debian_based_arch: amd64

common_packages:
Expand Down
1 change: 1 addition & 0 deletions onecloud/roles/utils/detect-os/vars/ubuntu-22.x86_64.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
is_debian_based: true
is_ubuntu_based: true
is_ubuntu_based_x86: true
debian_based_arch: amd64

common_packages:
Expand Down
13 changes: 13 additions & 0 deletions onecloud/roles/utils/host-service/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@
include_role:
name: utils/set-hostnetworks

- name: Is Support 1G hugepage
shell: |
cat /proc/cpuinfo | grep pdpe1gb > /dev/null
register: is_support_1g_hugepage
changed_when: false
failed_when: false

- name: Set host_enable_hugepage to true
set_fact:
host_enable_hugepage: true
when:
- enable_hugepage is defined
- is_controller_node|default(false)|bool == false
- is_support_1g_hugepage.rc == 0
- (is_centos_x86 is defined and is_centos_x86 | default(false) | bool) == true
or (is_openeuler_x86 is defined and is_openeuler_x86 | default(false) | bool) == true
or (is_ubuntu_based_x86 is defined and is_ubuntu_based_x86 | default(false) | bool) == true
or (is_debian_based_x86 is defined and is_debian_based_x86 | default(false) | bool) == true
- onecloud_version is defined
- onecloud_version is version('v3.10', '>=')
- ansible_architecture == 'x86_64'
Expand Down

0 comments on commit beb7240

Please sign in to comment.