-
Notifications
You must be signed in to change notification settings - Fork 23
INFRA-709 Rated dwpd alerts #1077
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
Merged
+2,177
−75
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e56312c
Update smart metrics to include rated DWPD
technowhizz 4bc1856
Add release note
technowhizz 31b8372
Update alert to use new metric
technowhizz c830ab7
Update hardware overview dashboard with more nvme metrics
technowhizz 98cc322
Add nvme drive drill down dashboard
technowhizz f0c5c02
Merge branch 'stackhpc/2024.1' into rated-dwpd-alerts
dougszumski File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
--- | ||
- name: Gather unique NVMe disk models on all hosts | ||
hosts: overcloud | ||
gather_facts: no | ||
tasks: | ||
- name: Retrieve NVMe device information | ||
ansible.builtin.command: "nvme list -o json" | ||
register: nvme_list | ||
changed_when: false | ||
become: true | ||
|
||
- name: Parse NVMe device model names | ||
ansible.builtin.set_fact: | ||
nvme_models: "{{ nvme_models | default([]) + [item.ModelNumber] }}" | ||
loop: "{{ nvme_list.stdout | from_json | json_query('Devices[].{ModelNumber: ModelNumber}') }}" | ||
changed_when: false | ||
|
||
- name: Set unique NVMe models as host facts | ||
ansible.builtin.set_fact: | ||
unique_nvme_models: "{{ (nvme_models | default([])) | unique }}" | ||
|
||
- name: Show unique NVMe models per host | ||
ansible.builtin.debug: | ||
var: unique_nvme_models | ||
|
||
- name: Aggregate all unique NVMe models from all hosts | ||
hosts: localhost | ||
gather_facts: no | ||
tasks: | ||
- name: Aggregate unique NVMe models from all overcloud hosts | ||
ansible.builtin.set_fact: | ||
all_nvme_models: "{{ groups['overcloud'] | map('extract', hostvars, 'unique_nvme_models') | select('defined') | sum(start=[]) | unique }}" | ||
|
||
- name: Show all unique NVMe models | ||
ansible.builtin.debug: | ||
var: all_nvme_models | ||
|
||
- name: Ensure dwpd-ratings.yml exists | ||
ansible.builtin.stat: | ||
path: "{{ kayobe_env_config_path }}/dwpd-ratings.yml" | ||
register: dwpd_ratings_stat | ||
run_once: true | ||
|
||
- name: Load existing dwpd-ratings.yml | ||
ansible.builtin.set_fact: | ||
existing_dwpd_yml: "{{ lookup('file', kayobe_env_config_path ~ '/dwpd-ratings.yml') | from_yaml }}" | ||
when: dwpd_ratings_stat.stat.exists | ||
run_once: true | ||
|
||
- name: Convert existing YAML array into a dictionary | ||
ansible.builtin.set_fact: | ||
dwpd_lookup: "{{ dwpd_lookup | default({}) | combine({item.model_name: item.rated_dwpd}) }}" | ||
loop: "{{ existing_dwpd_yml.stackhpc_dwpd_ratings | default([]) }}" | ||
loop_control: | ||
label: "{{ item.model_name }}" | ||
run_once: true | ||
|
||
- name: Get list of existing model names | ||
ansible.builtin.set_fact: | ||
existing_model_names: "{{ existing_dwpd_yml.stackhpc_dwpd_ratings | default([]) | map(attribute='model_name') | list }}" | ||
run_once: true | ||
|
||
- name: Identify new models not already in the configuration | ||
ansible.builtin.set_fact: | ||
new_models: "{{ all_nvme_models | default([]) | reject('in', existing_model_names | default([])) | list }}" | ||
run_once: true | ||
|
||
- name: Create entry dictionary for new models | ||
ansible.builtin.set_fact: | ||
new_entries: "{{ new_entries | default([]) + [{'model_name': item, 'rated_dwpd': 1}] }}" | ||
loop: "{{ new_models }}" | ||
run_once: true | ||
when: new_models | length > 0 | ||
|
||
- name: Build updated list for stackhpc_dwpd_ratings | ||
ansible.builtin.set_fact: | ||
new_dwpd_list: "{{ existing_dwpd_yml.stackhpc_dwpd_ratings | default([]) + (new_entries | default([])) }}" | ||
run_once: true | ||
|
||
- name: Write updated dwpd-ratings.yml | ||
ansible.builtin.copy: | ||
content: "---\nstackhpc_dwpd_ratings:\n{% for item in new_dwpd_list %} - model_name: \"{{ item.model_name }}\"\n rated_dwpd: {{ item.rated_dwpd }}\n{% endfor %}" | ||
dest: "{{ kayobe_env_config_path }}/dwpd-ratings.yml" | ||
run_once: true | ||
notify: Show updated dwpd-ratings.yml contents | ||
when: new_dwpd_list is defined and new_dwpd_list | length > 0 | ||
|
||
handlers: | ||
- name: Show updated dwpd-ratings.yml contents | ||
ansible.builtin.debug: | ||
msg: | ||
- "Updated local dwpd-ratings.yml contents" | ||
- "{{ {'stackhpc_dwpd_ratings': new_dwpd_list} | to_nice_yaml }}" | ||
- "PLEASE REVIEW AND COMMIT {{ kayobe_env_config_path }}/dwpd-ratings.yml TO VERSION CONTROL." | ||
run_once: true | ||
changed_when: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.