Skip to content

Commit

Permalink
fix check_chunkserver and check_mds
Browse files Browse the repository at this point in the history
  • Loading branch information
bai-charisu committed Sep 24, 2020
1 parent 97fceea commit 998c546
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
27 changes: 18 additions & 9 deletions curve-ansible/common_tasks/check_chunkserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
msg: "distribution_major_version is {{ansible_facts['distribution_major_version']}}"
when: ansible_facts['distribution_major_version'] != "9"

- name: "check kernel"
fail:
msg: "kernel version is {{ ansible_facts['kernel'] }}"
when: ansible_facts['kernel'] != "4.9.0-8-amd64"
- name: check kernel version
assert:
that:
- ansible_facts['kernel']|version_compare('4.9.0-8-amd64', '>=')

- name: "check max fd number"
shell: cat /proc/sys/fs/file-max
Expand Down Expand Up @@ -83,21 +83,30 @@
failed_when: " 'Operation Mode: Disabled' not in result.stdout "
changed_when: False

- name: check if jbod enabled
shell: sudo megacli -AdpGetProp -enablejbod -aALL
register: jbod_res

- name: check the RAID cache
shell: sudo megacli -LDGetProp -Cache -LALL -a0
register: result
failed_when: " 'Cache Policy:WriteThrough' not in result.stdout"
changed_when: False
when: "'Disabled' not in jbod_res.stdout"

- name: check the RAID firmware
shell: sudo /usr/sbin/megacli -AdpAllInfo -aALL | grep "FW Package Build"
register: result
failed_when: " '24.3.0-0050' not in result.stdout"
shell: sudo /usr/sbin/megacli -AdpAllInfo -aALL | grep "FW Package Build" | awk -F ' ' '{print $2}'
register: firmware_version

- name: check kernel version
assert:
that:
- firmware_version.stdout|version_compare('24.3.0-0050', '>=')

- name: check the disk schedule algorithm
shell: cat /sys/block/sd*/queue/scheduler | grep -v "\[deadline\]" | wc -l
shell: cat /sys/block/sd*/queue/scheduler | grep "\[noop\]" | wc -l
register: result
failed_when: result.stdout != ""
failed_when: result.stdout | int != chunkserver_num

- name: check if the disk cache closed
shell: sudo /sbin/hdparm -W /dev/sd* | grep "write-caching"
Expand Down
8 changes: 4 additions & 4 deletions curve-ansible/common_tasks/check_mds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
msg: "distribution_major_version is {{ansible_facts['distribution_major_version']}}"
when: ansible_facts['distribution_major_version'] != "9"

- name: "check kernel"
fail:
msg: "kernel version is {{ ansible_facts['kernel'] }}"
when: ansible_facts['kernel'] != "4.9.0-8-amd64"
- name: check kernel version
assert:
that:
- ansible_facts['kernel']|version_compare('4.9.0-8-amd64', '>=')

0 comments on commit 998c546

Please sign in to comment.