-
Notifications
You must be signed in to change notification settings - Fork 69
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
Changes for AFM #811
Merged
Merged
Changes for AFM #811
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
5814ff6
added afm configuration role
7d74194
Added extra flages
74d2001
added permission
b9404d1
Added --xattr --acls
89f1efe
Changes for tuneable and folder permission
17676da
Modified permission task
d0a79fa
made dynamic filesystem
df21d97
Added task for afm sensor
2c19c7e
Changed the name for tasks
bb6632d
Removed afmDIO task
0058f5f
modified tuneable configuration
f11dee9
changed the task name
e1be91b
removed commented code
83600b8
Added changes to make filesystem dynamic
80a927c
Removed comment
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
Empty file.
This file contains 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,35 @@ | ||
--- | ||
# Default variables for the IBM Spectrum Scale AFM Cos Configure role - | ||
## Spectrum Scale daemon nodename (defaults to node's hostname) | ||
scale_daemon_nodename: "{{ ansible_hostname }}" | ||
|
||
#"scale_afm_cos_bucket_params": [ | ||
# { | ||
# "bucket": "test", | ||
# "akey": "xxxxxxxx", | ||
# "skey": "xxxxxxxx", | ||
# }, | ||
# { | ||
# "bucket": "test1", | ||
# "akey": "xxxxxxxxx", | ||
# "skey": "xxxxxxxxx", | ||
# }, | ||
#] | ||
|
||
#"scale_afm_cos_filesets_params": [ | ||
# { | ||
# "filesystem": "fs1", | ||
# "fileset": "afmfileset1", | ||
# "endpoint": "https://s3.ap.cos.appdomain.cloud:443/bucket-afm1", | ||
# "bucket": "bucket-afm1", | ||
# "mode": "SW", | ||
# }, | ||
# { | ||
# "filesystem": "fs1", | ||
# "fileset": "afmfileset2", | ||
# "endpoint": "https://s3.ap.cos.appdomain.cloud:443/bucket-afm2", | ||
# "bucket": "bucket-afm2", | ||
# "mode": "SW" | ||
# } | ||
#] | ||
|
This file contains 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,2 @@ | ||
--- | ||
# handlers file for configure |
This file contains 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,20 @@ | ||
--- | ||
galaxy_info: | ||
author: IBM Corporation | ||
description: Role for configuring IBM Spectrum Scale AFM COS configuration role | ||
company: IBM | ||
|
||
license: Apache-2.0 | ||
|
||
min_ansible_version: 2.9 | ||
|
||
platforms: | ||
- name: EL | ||
versions: | ||
- 7 | ||
- 8 | ||
- 9 | ||
|
||
galaxy_tags: [] | ||
|
||
dependencies: [] |
This file contains 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,49 @@ | ||
--- | ||
- block: | ||
- name: create | Initialize | ||
set_fact: | ||
extra_option_flag: "" | ||
|
||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }}{{ item.bucket }}" | ||
when: | ||
- item.bucket is defined | ||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }}:{{ item.Region}}" | ||
when: | ||
- item.Region is defined | ||
|
||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }}@{{ item.Server}}" | ||
when: | ||
- item.Server is defined | ||
|
||
- name: configure | Set the access key and secret key for new/existing bucket as below at gateway node | ||
command: "{{ scale_command_path }}mmafmcoskeys {{ extra_option_flag }} set {{ item.akey }} {{ item.skey }}" | ||
register: scale_afm_cos_define | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
when: | ||
- item.bucket is defined | ||
- item.akey is defined | ||
- item.skey is defined | ||
|
||
- name: configure | Set the access key and secret key for new/existing bucket as below at gateway node | ||
command: "{{ scale_command_path }}mmafmcoskeys {{ item.bucket }}:{{ item.Region }}@{{ item.Server }} set --keyfile {{ item.KeyfilePath }}" | ||
register: scale_afm_cos_define | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
when: | ||
- item.bucket is defined | ||
- item.Region is defined | ||
- item.Server is defined | ||
- item.KeyfilePath is defined | ||
|
||
- name: configure | FM cos bucket configuration | ||
debug: | ||
msg: AFM cos bucket configured. | ||
rescue: | ||
- name: Failure detected in Configuring AFM cos bucket | ||
fail: | ||
msg: "I caught an error, Please take a look to the output given!." |
This file contains 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,97 @@ | ||
--- | ||
- block: | ||
- name: create | Find existing AFM cos enabled Filesystem | ||
shell: mmlsfileset {{ item.filesystem }} {{ item.fileset }} --afm -Y | grep -v HEADER | cut -d ':' -f 20 | uniq | ||
register: scale_existing_afmcos | ||
changed_when: false | ||
failed_when: false | ||
when: | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- name: create | Find existing Bucket(s) | ||
shell: mmafmcoskeys all get --report | tail -n +2 | cut -d '=' -f 1 | uniq | ||
register: scale_existing_bucket | ||
changed_when: false | ||
failed_when: false | ||
|
||
- debug: | ||
msg: "{{scale_existing_bucket.stdout_lines}}" | ||
changed_when: false | ||
failed_when: false | ||
when: | ||
- scale_existing_bucket.stdout_lines is defined | ||
|
||
- name: create | Initialize | ||
set_fact: | ||
extra_option_flag: "" | ||
|
||
- name: create | Set existing bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }} --bucket {{ item.bucket }}" | ||
when: | ||
- item.bucket in scale_existing_bucket.stdout_lines | ||
- item.bucket is defined | ||
|
||
- name: create | Set new bucket if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }} --new-bucket {{ item.bucket }}" | ||
when: | ||
- item.bucket not in scale_existing_bucket.stdout_lines | ||
- item.bucket is defined | ||
|
||
- name: create | Set mode if it is defined | ||
set_fact: | ||
extra_option_flag: "{{ extra_option_flag }} --mode {{ item.mode | default('sw') }}" | ||
|
||
- name: configure | Create a AFM cos relationship with filesets | ||
command: "{{ scale_command_path }}mmafmcosconfig {{ item.filesystem }} {{ item.fileset }} --endpoint {{ item.endpoint }} {{ extra_option_flag }} --object-fs --xattr --acls" | ||
register: scale_afm_cos_define | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- name: configure | Add Number of Gateway Flush Threads for AFM filsets | ||
command: "mmchfileset {{ item.filesystem }} {{ item.fileset }} -p afmNumFlushThreads=8" | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
run_once: true | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- name: Update permissions for AFM COS filesets | ||
shell: > | ||
find {{ scale_storage[0].defaultMountPoint }}/{{ item.fileset }} -type d ! -path '{{ scale_storage[0].defaultMountPoint }}/{{ item.fileset }}/.snapshots' -exec chmod 777 {} + | ||
failed_when: scale_afm_cos_define.rc != 0 | ||
ignore_errors: yes | ||
run_once: true | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- debug: | ||
msg: "{{scale_afm_cos_define}}" | ||
|
||
- name: configure | Create a AFM cos default configuration with filesets | ||
command: "{{ scale_command_path }}mmchfileset {{ item.filesystem }} {{ item.fileset }} -p afmdirlookuprefreshinterval=default -p afmfilelookuprefreshinterval=default -p afmfileopenrefreshinterval=default -p afmdiropenrefreshinterval=default -p afmSkipHomeRefresh=no" | ||
register: scale_afm_cos_config_define | ||
failed_when: false | ||
when: | ||
- not "enabled" in scale_existing_afmcos.stdout_lines | ||
- item.filesystem is defined | ||
- item.fileset is defined | ||
|
||
- debug: | ||
msg: "{{scale_afm_cos_config_define}}" | ||
|
||
- name: configure | FM cos configuration | ||
debug: | ||
msg: AFM cos configured. | ||
rescue: | ||
- name: Failure detected in Configuring AFM cos | ||
fail: | ||
msg: "I caught an error, Please take a look to the output given!." |
This file contains 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,31 @@ | ||
--- | ||
- name: configure | Initialize lists | ||
set_fact: | ||
scale_gateway_nodes: [] | ||
|
||
- name: cluster | Find gateway nodes | ||
add_host: | ||
name: "{{ item }}" | ||
groups: scale_gateway_nodes | ||
when: hostvars[item].scale_cluster_gateway | bool | ||
with_items: "{{ ansible_play_hosts }}" | ||
changed_when: false | ||
|
||
- name: configure | Setting server licenses on AFM gateway nodes | ||
vars: | ||
scale_gateway_node: "{{ groups['scale_gateway_nodes'] | list }}" | ||
command: "{{ scale_command_path }}mmchlicense server --accept -N {{ scale_gateway_node | join(',') }}" | ||
when: groups['scale_gateway_nodes'] | list | length > 0 | ||
run_once: true | ||
|
||
- name: configure | Enabling AFM gateway | ||
vars: | ||
scale_gateway_node: "{{ groups['scale_gateway_nodes'] | list }}" | ||
command: "{{ scale_command_path }}mmchnode -N {{ scale_gateway_node | join(',') }} --gateway" | ||
when: groups['scale_gateway_nodes'] | list | length > 0 | ||
register: result_gateway | ||
run_once: true | ||
|
||
- debug: | ||
msg: "{{ result_gateway.cmd }}" | ||
when: result_gateway.cmd is defined |
This file contains 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,19 @@ | ||
--- | ||
- name: configure | Initialize lists of AFM Nodes | ||
set_fact: | ||
scale_gateway_nodes: [] | ||
|
||
- name: cluster | Find AFM gateway nodes | ||
add_host: | ||
name: "{{ item }}" | ||
groups: scale_gateway_nodes | ||
when: hostvars[item].scale_cluster_gateway | bool | ||
with_items: "{{ ansible_play_hosts }}" | ||
changed_when: false | ||
|
||
- name: configure | Setting AFM Sensors on AFM gateway nodes | ||
vars: | ||
scale_gateway_node: "{{ groups['scale_gateway_nodes'] | list }}" | ||
command: "{{ scale_command_path }}mmperfmon config update GPFSAFMFS.restrict={{ scale_gateway_node | join(',') }} GPFSAFMFS.period=10 GPFSAFMFSET.restrict={{ scale_gateway_node | join(',') }} GPFSAFMFS.period=10 GPFSAFMFSET.restrict={{ scale_gateway_node | join(',') }} GPFSAFMFSET.period=10 GPFSAFM.restrict={{ scale_gateway_node | join(',') }} GPFSAFM.period=10" | ||
when: groups['scale_gateway_nodes'] | list | length > 0 | ||
run_once: true | ||
This file contains 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,27 @@ | ||
--- | ||
# tasks file for configure | ||
- include_tasks: afm_gateway.yml | ||
tags: configure | ||
run_once: true | ||
|
||
- include_tasks: afm_bucket.yml | ||
tags: configure | ||
when: | ||
- scale_afm_cos_bucket_params is defined | ||
with_items: | ||
- "{{ scale_afm_cos_bucket_params }}" | ||
run_once: true | ||
|
||
- include_tasks: afm_configure.yml | ||
tags: configure | ||
when: | ||
- scale_afm_cos_filesets_params is defined | ||
with_items: | ||
- "{{ scale_afm_cos_filesets_params }}" | ||
run_once: true | ||
|
||
- include_tasks: afm_sensor_configure.yml | ||
tags: configure | ||
run_once: true | ||
|
||
|
This file contains 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,2 @@ | ||
localhost | ||
|
This file contains 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,5 @@ | ||
--- | ||
- hosts: localhost | ||
remote_user: root | ||
roles: | ||
- configure |
This file contains 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,6 @@ | ||
--- | ||
# Variables for the IBM Spectrum Scale (ECE) (Erasure Code Edition) role - | ||
# these variables are *not* meant to be overridden | ||
|
||
# default mm command exection path | ||
scale_command_path: /usr/lpp/mmfs/bin/ |
This file contains 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 |
---|---|---|
|
@@ -71,19 +71,27 @@ | |
# | ||
# Apply config params | ||
# | ||
- name: config | Creat a list of configuration parameter for configuration | ||
set_fact: | ||
config_list: > | ||
{%- set config_list = [] -%} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add the inventory file . |
||
{%- for nc in scale_config -%} | ||
{%- for param in nc.params -%} | ||
{%- for key, value in param.items() -%} | ||
{{ config_list.append({'nodeclass': nc.nodeclass, 'key': key, 'value': value}) }} | ||
{%- endfor -%} | ||
{%- endfor -%} | ||
{%- endfor -%} | ||
{{ config_list }} | ||
|
||
- name: config | Apply defined configuration parameters | ||
vars: | ||
current_key: "{{ item.1.keys() | list | first }}" | ||
current_value: "{{ item.1[current_key] | string | regex_replace('True', 'yes') | regex_replace('False', 'no') }}" | ||
current_nodeclass: "{{ item.0.nodeclass }}" | ||
command: /usr/lpp/mmfs/bin/mmchconfig {{ current_key }}={{ current_value }} -N {{ current_nodeclass }} | ||
command: /usr/lpp/mmfs/bin/mmchconfig {{ item.key }}={{ item.value | string | regex_replace('True', 'yes') | regex_replace('False', 'no') }} -N {{ item.nodeclass }} | ||
register: scale_config_changed_params | ||
when: | ||
not scale_config_existing_params.stdout | lower is | ||
search(':' + current_key | lower + ':' + current_value | lower + ':(.+,)?' + current_nodeclass | lower | regex_replace('all', '') + '(,.+)?:') | ||
with_subelements: | ||
- "{{ ansible_play_hosts | map('extract', hostvars, 'scale_config') | sum(start=[]) | unique }}" | ||
- params | ||
not scale_config_existing_params.stdout | lower is search(':' + item.key | lower + ':' + item.value | string | lower + ':(.+,)?' + item.nodeclass | lower | regex_replace('all', '') + '(,.+)?:') | ||
loop: "{{ config_list }}" | ||
loop_control: | ||
label: "{{ item.nodeclass }}: {{ item.key }}" | ||
|
||
- name: config | Check if configuration parameters were changed | ||
set_fact: | ||
|
This file contains 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 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 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
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.
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.
We need to add check if permon sensor file is exist then only it should be executed else it will fail.
- " 'mmperfmon: There is no performance monitoring configuration data.' not in scale_zimon_conf_sensors.stderr"
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.
@rajan-mis I have created an issue.
#812