|
10 | 10 | # vars/scale_clusterdefinition.json
|
11 | 11 | - import_playbook: "set_json_variables.yml"
|
12 | 12 |
|
| 13 | +# Ensure provisioned VMs are up and Passwordless SSH setup |
| 14 | +# has been compleated and operational |
| 15 | +- name: Check passwordless SSH connection is setup |
| 16 | + hosts: scale_node |
| 17 | + any_errors_fatal: true |
| 18 | + gather_facts: false |
| 19 | + connection: local |
| 20 | + tasks: |
| 21 | + - name: Check passwordless SSH on all scale inventory hosts |
| 22 | + shell: ssh -i {{ ansible_ssh_private_key_file }} {{ inventory_hostname }} "echo PASSWDLESS_SSH_ENABLED" |
| 23 | + register: result |
| 24 | + until: result.stdout.find("PASSWDLESS_SSH_ENABLED") != -1 |
| 25 | + retries: 30 |
| 26 | + delay: 10 |
| 27 | + |
| 28 | +# Ensure all provisioned VMs are running the supported OS versions |
| 29 | +- name: Check for supported OS |
| 30 | + hosts: scale_node |
| 31 | + any_errors_fatal: true |
| 32 | + gather_facts: true |
| 33 | + tasks: |
| 34 | + - name: Spectrum Scale Precheck | Check OS Distribution |
| 35 | + assert: |
| 36 | + that: |
| 37 | + - ansible_distribution == "RedHat" |
| 38 | + - ansible_distribution_major_version == "7" or ansible_distribution_major_version == "8" |
| 39 | + - (ansible_distribution_version is match("7.9") or |
| 40 | + ansible_distribution_version is match("8.2") or |
| 41 | + ansible_distribution_version is match("8.4")) |
| 42 | + fail_msg: "Only instances running RedHat Enterprise Linux version 7.9, 8.2 and 8.4 are supported" |
| 43 | + |
13 | 44 | # Setup Spectrum Scale on nodes and create cluster
|
14 | 45 | - hosts: scale_node
|
15 | 46 | any_errors_fatal: true
|
| 47 | + vars: |
| 48 | + - scale_install_directory_pkg_path: /opt/IBM/gpfs_cloud_rpms |
16 | 49 | roles:
|
17 | 50 | - core/precheck
|
18 | 51 | - core/node
|
|
25 | 58 | - zimon/node
|
26 | 59 | - zimon/cluster
|
27 | 60 | - zimon/postcheck
|
| 61 | + |
| 62 | + # Cloud deployment specific actions after Spectrum Scale |
| 63 | + # cluster installation and setup |
| 64 | + tasks: |
| 65 | + - block: |
| 66 | + - name: accept client lisence for compute descriptor node |
| 67 | + command: /usr/lpp/mmfs/bin/mmchnode --client -N "computedescnodegrp" |
| 68 | + |
| 69 | + - name: set filesystem |
| 70 | + set_fact: |
| 71 | + fs_name: "{{ scale_storage.0.filesystem }}" |
| 72 | + when: |
| 73 | + - scale_storage is defined |
| 74 | + |
| 75 | + - name: create empty file on descriptor node |
| 76 | + command: /usr/lpp/mmfs/bin/mmdsh -N "computedescnodegrp" touch /var/mmfs/etc/ignoreAnyMount.{{ fs_name }} |
| 77 | + |
| 78 | + - name: unmount filesystem on descriptor node |
| 79 | + command: /usr/lpp/mmfs/bin/mmumount {{ fs_name }} -N "computedescnodegrp" |
| 80 | + run_once: true |
| 81 | + when: |
| 82 | + - scale_sync_replication_config | bool |
| 83 | + |
| 84 | + - name: Prevent kernel upgrade |
| 85 | + lineinfile: |
| 86 | + path: /etc/yum.conf |
| 87 | + line: exclude=kernel* redhat-release* |
| 88 | + |
| 89 | +# Configure the Spectrum Scale Pagepool setings |
| 90 | +- hosts: scale_node |
| 91 | + any_errors_fatal: false |
| 92 | + gather_facts: true |
| 93 | + tasks: |
| 94 | + - block: |
| 95 | + - name: Spectrum Scale Config | Find Compute Nodes |
| 96 | + add_host: |
| 97 | + name: "{{ item }}" |
| 98 | + groups: scale_compute_members |
| 99 | + when: |
| 100 | + - hostvars[item]['scale_nodeclass'] is defined and 'computenodegrp' in hostvars[item]['scale_nodeclass'] |
| 101 | + with_items: "{{ ansible_play_hosts }}" |
| 102 | + changed_when: false |
| 103 | + |
| 104 | + - name: Spectrum Scale Config | Find Storage Nodes |
| 105 | + add_host: |
| 106 | + name: "{{ item }}" |
| 107 | + groups: scale_storage_members |
| 108 | + when: |
| 109 | + - hostvars[item]['scale_nodeclass'] is defined and 'storagenodegrp' in hostvars[item]['scale_nodeclass'] |
| 110 | + with_items: "{{ ansible_play_hosts }}" |
| 111 | + changed_when: false |
| 112 | + |
| 113 | + - name: Spectrum Scale Config | Determine Compute Node Total Memory |
| 114 | + set_fact: |
| 115 | + scale_compute_total_mem: "{{ hostvars[item]['ansible_memtotal_mb'] }}" |
| 116 | + when: hostvars[item]['ansible_memtotal_mb'] is defined and hostvars[item]['ansible_memtotal_mb'] |
| 117 | + with_items: "{{ groups['scale_compute_members'].0 }}" |
| 118 | + run_once: true |
| 119 | + |
| 120 | + - name: Spectrum Scale Config | Determine Storage Node Total Memory |
| 121 | + set_fact: |
| 122 | + scale_storage_total_mem: "{{ hostvars[item]['ansible_memtotal_mb'] }}" |
| 123 | + when: hostvars[item]['ansible_memtotal_mb'] is defined and hostvars[item]['ansible_memtotal_mb'] |
| 124 | + with_items: "{{ groups['scale_storage_members'].0 }}" |
| 125 | + run_once: true |
| 126 | + |
| 127 | + - name: Spectrum Scale Config | Determine Compute Node Pagepool Memory |
| 128 | + set_fact: |
| 129 | + scale_compute_total_mem_per: "{{ ((scale_compute_total_mem | int / 1024) * 0.25) | round(0, 'ceil') | int | abs }}" |
| 130 | + when: scale_compute_total_mem is defined |
| 131 | + run_once: true |
| 132 | + |
| 133 | + - name: Spectrum Scale Config | Determine Storage Node Pagepool Memory |
| 134 | + set_fact: |
| 135 | + scale_storage_total_mem_per: "{{ ((scale_storage_total_mem | int / 1024) * 0.25) | round(0, 'ceil') | int | abs }}" |
| 136 | + when: scale_storage_total_mem is defined |
| 137 | + run_once: true |
| 138 | + |
| 139 | + - name: Spectrum Scale Config | Define Compute Raw Pagepool Size |
| 140 | + set_fact: |
| 141 | + pagepool_compute: "{{ scale_compute_total_mem_per }}" |
| 142 | + when: scale_compute_total_mem_per is defined |
| 143 | + run_once: true |
| 144 | + |
| 145 | + - name: Spectrum Scale Config | Define Storage Raw Pagepool Size |
| 146 | + set_fact: |
| 147 | + pagepool_storage: "{{ scale_storage_total_mem_per }}" |
| 148 | + when: scale_storage_total_mem_per is defined |
| 149 | + run_once: true |
| 150 | + |
| 151 | + - name: Spectrum Scale Config | Check Compute Pagepool Floor Value |
| 152 | + set_fact: |
| 153 | + pagepool_compute: "1" |
| 154 | + when: |
| 155 | + - pagepool_compute is defined |
| 156 | + - pagepool_compute | int < 1 |
| 157 | + run_once: true |
| 158 | + |
| 159 | + - name: Spectrum Scale Config | Check Compute Pagepool Ceiling Value |
| 160 | + set_fact: |
| 161 | + pagepool_compute: "16" |
| 162 | + when: |
| 163 | + - pagepool_compute is defined |
| 164 | + - pagepool_compute | int > 16 |
| 165 | + run_once: true |
| 166 | + |
| 167 | + - name: Spectrum Scale Config | Check Storage Pagepool Floor Value |
| 168 | + set_fact: |
| 169 | + pagepool_storage: "1" |
| 170 | + when: |
| 171 | + - pagepool_storage is defined |
| 172 | + - pagepool_storage | int < 1 |
| 173 | + run_once: true |
| 174 | + |
| 175 | + - name: Spectrum Scale Config | Check Storage Pagepool Ceiling Value |
| 176 | + set_fact: |
| 177 | + pagepool_compute: "16" |
| 178 | + when: |
| 179 | + - pagepool_storage is defined |
| 180 | + - pagepool_storage | int > 16 |
| 181 | + run_once: true |
| 182 | + |
| 183 | + - name: Spectrum Scale Config | Assign Compute Pagepool |
| 184 | + command: "/usr/lpp/mmfs/bin/mmchconfig pagepool={{ pagepool_compute }}G -i -N computenodegrp" |
| 185 | + when: |
| 186 | + - pagepool_compute is defined |
| 187 | + run_once: true |
| 188 | + |
| 189 | + - name: Spectrum Scale Config | Assign Storage Pagepool |
| 190 | + command: "/usr/lpp/mmfs/bin/mmchconfig pagepool={{ pagepool_storage }}G -i -N storagenodegrp" |
| 191 | + when: |
| 192 | + - pagepool_storage is defined |
| 193 | + run_once: true |
0 commit comments