diff --git a/playbooks/sample-sap-storage-prep.yml b/playbooks/sample-sap-storage-prep.yml deleted file mode 100644 index 6a8cac0a6..000000000 --- a/playbooks/sample-sap-storage-prep.yml +++ /dev/null @@ -1,20 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -# Experimental Ansible Role, do not suggest using this - -- hosts: all - become: true - pre_tasks: -# - include_vars: ./vars/sample-variables-sap-storage-lvm.yml -# - include_vars: ./vars/sample-variables-sap-storage-lvm-stripes.yml - - tasks: - - - name: SAP storage preparation - vars: - sap_storage_cloud_type: 'generic' - sap_storage_sap_type: 'sap_onehost' - sap_storage_action: 'prepare' - include_role: - name: ../roles/sap_storage_setup diff --git a/playbooks/sample-sap-storage-setup_sap_s4hana_distributed.yml b/playbooks/sample-sap-storage-setup_sap_s4hana_distributed.yml new file mode 100644 index 000000000..4cdcf423a --- /dev/null +++ b/playbooks/sample-sap-storage-setup_sap_s4hana_distributed.yml @@ -0,0 +1,162 @@ +# SPDX-License-Identifier: Apache-2.0 +--- + +- name: Complete Infrastructure setup + hosts: hana_primary, nwas_ascs, nwas_pas, nwas_aas + become: true + any_errors_fatal: true + + vars: + + sap_system_sid: "S01" + sap_system_hana_db_sid: "H01" + sap_system_nwas_abap_ascs_instance_nr: "00" + sap_system_nwas_abap_pas_instance_nr: "01" + sap_system_nwas_abap_aas_instance_nr: "11" + + aws_nfs_mount_point: "fs-1234567890.efs.eu-west-2.amazonaws.com:/" + aws_nfs_mount_point_separate_sap_transport_dir: "fs-0987654321.efs.eu-west-2.amazonaws.com:/" + aws_nfs_mount_point_type: nfs4 + aws_nfs_mount_point_opts: nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,acl,noauto # should include noauto to avoid /etc/fstab mount on boot, when Linux Pacemaker should control mount + + aws_host_specifications_dictionary: + + hana-p: + sap_storage_setup_sid: "{{ sap_system_hana_db_sid }}" + sap_storage_setup_host_type: + - hana_primary + sap_storage_setup_definition: + - name: hana_data + mountpoint: /hana/data + disk_size: 384 # size in GB, integer + filesystem_type: xfs # default: xfs + - name: hana_log + mountpoint: /hana/log + disk_size: 128 # size in GB, integer + filesystem_type: xfs # default: xfs + - name: hana_shared + mountpoint: /hana/shared + disk_size: 320 # size in GB, integer + filesystem_type: xfs # default: xfs + - name: swap + swap_path: /swapfile # use swap file on root disk, instead of creating LVM LV for swap + disk_size: 2 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + nw-ascs: + sap_storage_setup_sid: "{{ sap_system_sid }}" + sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ sap_system_nwas_abap_ascs_instance_nr }}" + sap_storage_setup_host_type: + - nwas_abap_ascs + sap_storage_setup_definition: + - name: usr_sap + mountpoint: /usr/sap + nfs_path: /usr/sap # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: usr_sap_trans + mountpoint: /usr/sap/trans + nfs_path: /usr/sap/trans # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: sapmnt + mountpoint: /sapmnt + nfs_path: /sapmnt # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: swap + disk_size: 96 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + nw-pas: + sap_storage_setup_sid: "{{ sap_system_sid }}" + sap_storage_setup_nwas_abap_pas_instance_nr: "{{ sap_system_nwas_abap_pas_instance_nr }}" + sap_storage_setup_host_type: + - nwas_abap_pas + sap_storage_setup_definition: + - name: usr_sap + mountpoint: /usr/sap + nfs_path: /usr/sap # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: usr_sap_trans + mountpoint: /usr/sap/trans + nfs_path: /usr/sap/trans # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: sapmnt + mountpoint: /sapmnt + nfs_path: /sapmnt # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: swap + disk_size: 96 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + nw-aas: + sap_storage_setup_sid: "{{ sap_system_sid }}" + sap_storage_setup_nwas_abap_aas_instance_nr: "{{ sap_system_nwas_abap_aas_instance_nr }}" + sap_storage_setup_host_type: + - nwas_abap_aas + sap_storage_setup_definition: + - name: usr_sap + mountpoint: /usr/sap + nfs_path: /usr/sap # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: usr_sap_trans + mountpoint: /usr/sap/trans + nfs_path: /usr/sap/trans # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: sapmnt + mountpoint: /sapmnt + nfs_path: /sapmnt # subdirectory path on the NFS server + nfs_server: "{{ aws_nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} + nfs_filesystem_type: "{{ aws_nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} + nfs_mount_options: "{{ aws_nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} + - name: swap + disk_size: 96 + filesystem_type: swap # must be swap filesystem + - name: software + mountpoint: /software + disk_size: 100 # size in GB, integer + filesystem_type: xfs # default: xfs + + + tasks: + + - name: Execute Ansible Role sap_storage_setup + ansible.builtin.include_role: + name: community.sap_install.sap_storage_setup + vars: + sap_storage_setup_sid: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_sid | default('') }}" + sap_storage_setup_host_type: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_host_type | list }}" + sap_storage_setup_definition: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_definition | list }}" + sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ascs_instance_nr | default(omit) }}" + sap_storage_setup_nwas_abap_ers_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ers_instance_nr | default(omit) }}" + sap_storage_setup_nwas_abap_pas_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_pas_instance_nr | default(omit) }}" + sap_storage_setup_nwas_abap_aas_instance_nr: "{{ aws_host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_aas_instance_nr | default(omit) }}" diff --git a/playbooks/sample-storage_sap_s4hana_distributed.yml b/playbooks/sample-storage_sap_s4hana_distributed.yml deleted file mode 100644 index 6e5b65d7a..000000000 --- a/playbooks/sample-storage_sap_s4hana_distributed.yml +++ /dev/null @@ -1,206 +0,0 @@ -# SPDX-License-Identifier: Apache-2.0 ---- - -- name: Complete Infrastructure setup - hosts: hana_primary, nwas_ascs, nwas_pas, nwas_aas - become: true - any_errors_fatal: true - - vars: - - sap_system_sid: "S01" - sap_system_hana_db_sid: "H01" - sap_system_hana_db_instance_nr: "90" - sap_system_nwas_abap_ascs_instance_nr: "00" - sap_system_nwas_abap_pas_instance_nr: "01" - sap_system_nwas_abap_aas_instance_nr: "11" - - nfs_mount_point: "fs-1234567890.efs.eu-west-2.amazonaws.com:/" - nfs_mount_point_separate_sap_transport_dir: "fs-0987654321.efs.eu-west-2.amazonaws.com:/" - nfs_mount_point_type: nfs4 - nfs_mount_point_opts: nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2,noresvport,acl,noauto # should include noauto to avoid /etc/fstab mount on boot, when Linux Pacemaker should control mount - - host_specifications_dictionary: - - hana-p: # hostname - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - hana_primary - - storage_definition: - - # Commented out variables are the same for each filesystem, only shown once below to ease readability - - name: hana_data - mountpoint: /hana/data - disk_size: 384 # size in GB, integer - filesystem_type: xfs # default: xfs - #lvm_lv_name: # default: lv_ - #lvm_lv_stripes: 2 # default: null, number of disks to stripe over - #lvm_lv_stripe_size: 128K # default: 64K, defined by the OS. Akin to Virtualized Block Size - #lvm_vg_name: # default: vg_ - #lvm_vg_options: # default: none, additional LVM VG options as string in LVM options syntax (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM VG Physical Extent) - #lvm_vg_physical_extent_size: # default: 4, uses 4 MiB default and difficult to change once set. Akin to Physical Block Size - #lvm_pv_device: # default: discovered ansible_devices matching the target size - #lvm_pv_options: # default: none, additional LVM PV options as string in LVM options syntax (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM PV Physical Extent) - #nfs_path: # subdirectory path on the NFS server - #nfs_server: # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - #nfs_filesystem_type: # default: {{ sap_storage_setup_nfs_filesystem_type }} - #nfs_mount_options: # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: hana_log - mountpoint: /hana/log - disk_size: 128 # size in GB, integer - filesystem_type: xfs # default: xfs - - - name: hana_shared - mountpoint: /hana/shared - disk_size: 320 # size in GB, integer - filesystem_type: xfs # default: xfs - - - name: swap - swap_path: /swapfile # use swap file on root disk, instead of creating LVM LV for swap - disk_size: 2 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - nw-ascs: # hostname - sap_storage_setup_sid: "{{ sap_system_sid }}" - sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ sap_system_nwas_abap_ascs_instance_nr }}" - - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - nwas_abap_ascs - - storage_definition: - - - name: usr_sap - mountpoint: /usr/sap - nfs_path: /usr/sap # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: usr_sap_trans - mountpoint: /usr/sap/trans - nfs_path: /usr/sap/trans # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: sapmnt - mountpoint: /sapmnt - nfs_path: /sapmnt # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: swap - disk_size: 96 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - nw-pas: # hostname - sap_storage_setup_sid: "{{ sap_system_sid }}" - sap_storage_setup_nwas_abap_pas_instance_nr: "{{ sap_system_nwas_abap_pas_instance_nr }}" - - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - nwas_abap_pas - - storage_definition: - - - name: usr_sap - mountpoint: /usr/sap - nfs_path: /usr/sap # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: usr_sap_trans - mountpoint: /usr/sap/trans - nfs_path: /usr/sap/trans # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: sapmnt - mountpoint: /sapmnt - nfs_path: /sapmnt # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: swap - disk_size: 96 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - nw-aas: # hostname - sap_storage_setup_sid: "{{ sap_system_sid }}" - sap_storage_setup_nwas_abap_aas_instance_nr: "{{ sap_system_nwas_abap_aas_instance_nr }}" - - # hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers - sap_storage_setup_host_type: - - nwas_abap_aas - - storage_definition: - - - name: usr_sap - mountpoint: /usr/sap - nfs_path: /usr/sap # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: usr_sap_trans - mountpoint: /usr/sap/trans - nfs_path: /usr/sap/trans # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point_separate_sap_transport_dir | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: sapmnt - mountpoint: /sapmnt - nfs_path: /sapmnt # subdirectory path on the NFS server - nfs_server: "{{ nfs_mount_point | default('') }}" # NFS server and parent directory (e.g. nfs.com:/share1). default: {{ sap_storage_setup_nfs_server }} - nfs_filesystem_type: "{{ nfs_mount_point_type | default('') }}" # default: {{ sap_storage_setup_nfs_filesystem_type }} - nfs_mount_options: "{{ nfs_mount_point_opts | default('') }}" # default: {{ sap_storage_setup_nfs_mount_options }} - - - name: swap - disk_size: 96 - filesystem_type: swap # must be swap filesystem - - - name: software - mountpoint: /software - disk_size: 100 # size in GB, integer - filesystem_type: xfs # default: xfs - - - tasks: - - - name: Execute Ansible Role sap_storage_setup - ansible.builtin.include_role: - name: { role: community.sap_install.sap_storage_setup } - vars: - sap_storage_setup_sid: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_sid | default('') }}" - sap_storage_setup_nwas_abap_ascs_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ascs_instance_nr | default('') }}" - sap_storage_setup_nwas_abap_ers_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_ers_instance_nr | default('') }}" - sap_storage_setup_nwas_abap_pas_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_pas_instance_nr | default('') }}" - sap_storage_setup_nwas_abap_aas_instance_nr: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_nwas_abap_aas_instance_nr | default('') }}" - sap_storage_setup_host_type: "{{ host_specifications_dictionary[ansible_hostname].sap_storage_setup_host_type | list }}" - sap_storage_setup_definition: "{{ host_specifications_dictionary[ansible_hostname].storage_definition | list }}" diff --git a/roles/sap_storage_setup/README.md b/roles/sap_storage_setup/README.md index 1f3394813..d5e5ff23c 100644 --- a/roles/sap_storage_setup/README.md +++ b/roles/sap_storage_setup/README.md @@ -17,6 +17,13 @@ This Ansible Role is agnostic, and will run on any Infrastructure Platform. Only Please note, while this Ansible Role has protection against overwrite of existing disks and filesystems - sensible review and care is required for any automation of disk storage. Please review the documentation and samples/examples carefully. It is strongly suggested to initially execute the Ansible Playbook calling this Ansible Role, with `ansible-playbook --check` for Check Mode - this will perform no changes to the host and show which changes would be made. +In addition, this Ansible Role: + +- Does not permit static definition for mountpoint to use a specific device (e.g. `/dev/sdk`). The definition will define the disk size to use for the mountpoint, and match accordingly. +- Enforces 1 mountpoint will use 1 LVM Logical Volume (LV) that consumes 100% of an LVM Volume Group (VG), with the LVM Volume Group (VG) consuming 100% of 1..n LVM Physical Volumes (PV). + - For granular control of LVM setup, the suggestion is to instead use Ansible Role `storage` from the `fedora.linux_system_roles` Ansible Collection or the Ansible Roles `lvg/lvol/filesystem` from `community.general` Ansible Collection + + ## Requirements The Ansible Role requires the `community.general` Ansible Collection (uses the `lvg`, `lvol` and `filesystem` Ansible Modules). @@ -62,9 +69,9 @@ Red Hat for SAP Community of Practice, Janine Fuchs, IBM Lab for SAP Solutions Minimum required parameters: -- [sap_storage_setup_definition](#sap_storage_setup_definition) -- [sap_storage_setup_host_type](#sap_storage_setup_host_type) -- [sap_storage_setup_sid](#sap_storage_setup_sid) +- [sap_storage_setup_definition](#sap_storage_setup_definition-required) +- [sap_storage_setup_host_type](#sap_storage_setup_host_type-required) +- [sap_storage_setup_sid](#sap_storage_setup_sid-required) ### sap_storage_setup_definition required @@ -110,14 +117,24 @@ Example: ```yaml sap_storage_setup_definition: -- disk_size: 100G - filesystem_type: xfs - mountpoint: /hana/data - name: hanadata -- disk_size: 100G - filesystem_type: xfs - mountpoint: /hana/log - name: hanalog + + # Block Storage volume + - name: hana_data # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name + mountpoint: /hana/data # required: string, directory path where the filesystem is mounted + disk_size: 100 # required: integer, size in GB + filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem + + # File Storage volume + - name: hana_shared # required: string, reference name + mountpoint: /hana/shared # required: string, directory path where the filesystem is mounted + nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server + + # Swap as file instead of Block Storage volume + # See SAP Note 1597355 - Swap-space recommendation for Linux + - name: swap # required: string, reference name + swap_path: /swapfile # required: string, directory path where swap file is created + disk_size: 4 # required: integer, size in GB of swap file + filesystem_type: swap # required: string, must be value 'swap' ``` ### sap_storage_setup_host_type required diff --git a/roles/sap_storage_setup/defaults/main.yml b/roles/sap_storage_setup/defaults/main.yml index 3cfc3bd3e..f4925f150 100644 --- a/roles/sap_storage_setup/defaults/main.yml +++ b/roles/sap_storage_setup/defaults/main.yml @@ -1,10 +1,59 @@ # SPDX-License-Identifier: Apache-2.0 --- -# Inherit from global parameters, if they exist -sap_storage_setup_host_type: "{{ sap_host_type }}" +# Mandatory +# Inherit from global parameter, if exist sap_storage_setup_sid: "{{ sap_system_sid }}" +# Mandatory +# Inherit from global parameter, if exist +# Use list with values: hana_primary, hana_secondary, nwas_abap_ascs, nwas_abap_ers, nwas_abap_pas, nwas_abap_aas, nwas_java_scs, nwas_java_ers +# Sandbox example +## sap_storage_setup_host_type: +## - hana_primary +## - nwas_abap_ascs +## - nwas_abap_pas +sap_storage_setup_host_type: "{{ sap_host_type }}" + + +#### Mandatory variable reference example for SAP System storage definition + +# # Mandatory +# sap_storage_setup_definition: + +# # Block Storage volume +# - name: name # required: string, filesystem name used to generate lvm_lv_name and lvm_vg_name +# mountpoint: /directory # required: string, directory path where the filesystem is mounted +# disk_size: 384 # required: integer, size in GB +# filesystem_type: xfs # optional: string, value 'xfs'. Use 'swap' to create swap filesystem +# #lvm_lv_name: # optional: string, value 'lv_' +# #lvm_lv_stripes: # optional: integer, value '1', stripe over LVM Physical Volumes within the LVM Volume Group +# #lvm_lv_stripe_size: # optional: string, value '128K', override definition by the OS. Akin to Virtualized Block Size +# #lvm_vg_name: # optional: string, value 'vg_'' +# #lvm_vg_options: # optional: string, value '', additional LVM VG options (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM VG Physical Extent) +# #lvm_vg_physical_extent_size: # optional: integer, value '4', size in MiB. Akin to Physical Block Size, difficult to change once set +# #lvm_pv_options: # optional: string, value '', additional LVM PV options (e.g. "--dataalignment XX ..." to override MiB offset from disk start before first LVM PV Physical Extent) + +# # File Storage volume +# - name: name # required: string, reference name +# mountpoint: /directory # required: string, directory path where the filesystem is mounted +# nfs_server: nfs.corp:/ # required: string, server and parent directory of the NFS Server; value default from var sap_storage_setup_nfs_server +# #nfs_path: # optional: string, value '', subdirectory path on the NFS Server +# #nfs_filesystem_type: # optional: string, value default 'nfs4' from var sap_storage_setup_nfs_filesystem_type, NFS Server protocol +# #nfs_mount_options: # optional: string, value default 'defaults' from var sap_storage_setup_nfs_mount_options, NFS Server specific options e.g. 'relatime' + +# # Swap as file instead of Block Storage volume +# - name: swap # required: string, reference name +# swap_path: /swapfile # required: string, directory path where swap file is created +# disk_size: 4 # required: integer, size in GB of swap file +# filesystem_type: swap # required: string, must be value 'swap' + +# # If applicable, create default for all nfs_server keys within sap_storage_setup_definition +# sap_storage_setup_nfs_server: 'nfs.corp:/' + + +#### Default variable values for SAP System storage + # By default do not look for multipath devices. # When enabled, this includes # - installation of necessary packages @@ -33,7 +82,8 @@ sap_storage_setup_nwas_java_ci_instance_nr: '21' # - NWAS JAVA AS uses J # - NWAS WebDispatcher uses W -#----------------------------------------------------------# + +#### NFS default values sap_storage_setup_nfs_filesystem_type: nfs4 sap_storage_setup_nfs_mount_options: defaults @@ -59,6 +109,7 @@ sap_storage_setup_nfs_dirs_usr_sap: nwas_java_scs: - "{{ sap_storage_setup_sid }}/SCS{{ sap_storage_setup_nwas_java_scs_instance_nr }}" + ##### #### Legacy code - retain vars for commented out code, until decision on specific activities for each Cloud ###### @@ -85,6 +136,3 @@ sap_storage_setup_aws_imds_url: sap_storage_setup_aws_vmsize_url: sap_storage_setup_aws_vmsize: - -# IBM Cloud variables -#