diff --git a/.ansible-lint b/.ansible-lint index fc315df23..386378042 100644 --- a/.ansible-lint +++ b/.ansible-lint @@ -14,12 +14,10 @@ exclude_paths: #- roles/sap_hana_install #- roles/sap_hana_preconfigure - roles/sap_hostagent - - roles/sap_hypervisor_node_preconfigure #- roles/sap_install_media_detect #- roles/sap_netweaver_preconfigure #- roles/sap_storage_setup #- roles/sap_swpm - - roles/sap_vm_preconfigure - tests/ enable_list: - yaml diff --git a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml b/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml deleted file mode 100644 index 219a9fcf1..000000000 --- a/.github/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- - -# Workflow for ansible-lint of a role, using reusable workflow - -name: ansible-lint of the role sap_hypervisor_node_preconfigure - -on: - push: - branches: - - main - - dev - - github-workflow-test - paths: - - 'roles/sap_hypervisor_node_preconfigure/**' - pull_request: - branches: - - main - - dev - paths: - - 'roles/sap_hypervisor_node_preconfigure/**' - workflow_dispatch: - branches: - - main - - dev - - github-workflow-test - paths: - - 'roles/sap_hypervisor_node_preconfigure/**' - -jobs: - ansible-lint-exec: - uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main - with: - role: sap_hypervisor_node_preconfigure diff --git a/.github/workflows/ansible-lint-sap_vm_preconfigure.yml b/.github/workflows/ansible-lint-sap_vm_preconfigure.yml deleted file mode 100644 index 346012e2d..000000000 --- a/.github/workflows/ansible-lint-sap_vm_preconfigure.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- - -# Workflow for ansible-lint of a role, using reusable workflow - -name: ansible-lint of the role sap_vm_preconfigure - -on: - push: - branches: - - main - - dev - - github-workflow-test - paths: - - 'roles/sap_vm_preconfigure/**' - pull_request: - branches: - - main - - dev - paths: - - 'roles/sap_vm_preconfigure/**' - workflow_dispatch: - branches: - - main - - dev - - github-workflow-test - paths: - - 'roles/sap_vm_preconfigure/**' - -jobs: - ansible-lint-exec: - uses: sap-linuxlab/community.sap_install/.github/workflows/ansible-lint-sap_reusable_workflow.yml@main - with: - role: sap_vm_preconfigure diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 22b92457d..28b879c7e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -5,6 +5,17 @@ community.sap_install Release Notes .. contents:: Topics +v1.4.0 +====== + +Release Summary +--------------- + +| Release Date: 2024-02-02 +| collection: Move sap_hypervisor_node_preconfigure Role to sap_infrastructure Collection +| collection: Move sap_vm_preconfigure Role to sap_infrastructure Collection +| sap_anydb_install_oracle: Feature add for Oracle DB install with patch + v1.3.5 ====== diff --git a/README.md b/README.md index 62e8b3ec7..03a04fd0e 100644 --- a/README.md +++ b/README.md @@ -34,13 +34,11 @@ Within this Ansible Collection, there are various Ansible Roles and no custom An | [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) | install SAP HANA via HDBLCM | | [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) | configure settings for SAP HANA database server | | [sap_hostagent](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hostagent) | install SAP Host Agent | -| [sap_hypervisor_node_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hypervisor_node_preconfigure) | configure a hypervisor running VMs for SAP HANA | | [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) | detect and extract SAP Software installation media | | [sap_maintain_etc_hosts](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_maintain_etc_hosts) | maintain the /etc/hosts file of an SAP software host | | [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure) | configure settings for SAP NetWeaver application server | | [sap_storage_setup](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_storage_setup) | configure storage for SAP HANA, with LVM partitions and XFS filesystem | | [sap_swpm](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_swpm) | install SAP Software via SWPM | -| [sap_vm_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_vm_preconfigure) | configure settings for a guest (VM) running on RHV/KVM for SAP HANA | ## License diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 3eb148f64..325cc5d3b 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -156,3 +156,12 @@ releases: | sap_hypervisor_node_preconfigure: Bug fix for role name and path for included tasks ' release_date: '2024-01-31' + 1.4.0: + changes: + release_summary: '| Release Date: 2024-02-02 + + | collection: Move sap_hypervisor_node_preconfigure Role to sap_infrastructure Collection + | collection: Move sap_vm_preconfigure Role to sap_infrastructure Collection + | sap_anydb_install_oracle: Feature add for Oracle DB install with patch + ' + release_date: '2024-02-02' diff --git a/docs/README.md b/docs/README.md index 2cc867f9b..040360fcd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -128,10 +128,8 @@ Important note: it is not possible for the project maintainers to test every SAP | [sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_install) | [![Ansible Lint for sap_hana_install](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_install.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_install.yml) | | [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure) | [![Ansible Lint for sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_preconfigure.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hana_preconfigure.yml) | | [sap_hostagent](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hostagent) | N/A | -| [sap_hypervisor_node_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hypervisor_node_preconfigure) | [![Ansible Lint for sap_hypervisor_node_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_hypervisor_node_preconfigure.yml) | | [sap_install_media_detect](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_install_media_detect) | N/A | | [sap_maintain_etc_hosts](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_maintain_etc_hosts) | [![Ansible Lint for sap_maintain_etc_hosts](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_maintain_etc_hosts.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_maintain_etc_hosts.yml) | | [sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_netweaver_preconfigure) | [![Ansible Lint for sap_netweaver_preconfigure](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_netweaver_preconfigure.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_netweaver_preconfigure.yml) | | [sap_storage_setup](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_storage_setup) | N/A | | [sap_swpm](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_swpm) | [![Ansible Lint for sap_swpm](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_swpm.yml/badge.svg)](https://github.com/sap-linuxlab/community.sap_install/actions/workflows/ansible-lint-sap_swpm.yml) | -| [sap_vm_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_vm_preconfigure) | N/A | diff --git a/galaxy.yml b/galaxy.yml index a6d273176..d6982415d 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -10,7 +10,7 @@ namespace: community name: sap_install # The version of the collection. Must be compatible with semantic versioning -version: 1.3.5 +version: 1.4.0 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml b/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml deleted file mode 100644 index 7cf165ac4..000000000 --- a/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- hosts: all - gather_facts: true - serial: 1 - vars: - sap_hypervisor_node_platform: redhat_ocp_virt - sap_hypervisor_node_kubeconfig: "{{ lookup( 'ansible.builtin.env', 'KUBECONFIG') }}" - environment: - KUBECONFIG: "{{ sap_hypervisor_node_kubeconfig }}" - K8S_AUTH_KUBECONFIG: "{{ sap_hypervisor_node_kubeconfig }}" - roles: - - { role: community.sap_install.sap_hypervisor_node_preconfigure } diff --git a/playbooks/vars/sample-variables-sap-hypervisor-node-preconfigure-rh_ocp_virt.yml b/playbooks/vars/sample-variables-sap-hypervisor-node-preconfigure-rh_ocp_virt.yml deleted file mode 100644 index 4e022e680..000000000 --- a/playbooks/vars/sample-variables-sap-hypervisor-node-preconfigure-rh_ocp_virt.yml +++ /dev/null @@ -1,97 +0,0 @@ -sap_hypervisor_node_preconfigure_install_operators: true -sap_hypervisor_node_preconfigure_install_hpp: true -sap_hypervisor_node_preconfigure_install_trident: false -sap_hypervisor_node_preconfigure_setup_worker_nodes: true - -sap_hypervisor_node_preconfigure_cluster_config: - - # URL under which the OCP cluster is reachable - cluster_url: ocpcluster.domain.org - - # namespace under which the VMs are created, note this has to be - # openshift-sriov-network-operator in case of using SRIOV network - # devices - vm_namespace: sap - - # Optional, configuration for trident driver for Netapp NFS filer - trident: - management: management.domain.org - data: datalif.netapp.domain.org - svm: sap_svm - backend: nas_backend - aggregate: aggregate_Name - username: admin - password: xxxxx - storage_driver: ontap-nas - storage_prefix: ocpv_sap_ - - # CPU cores which will be reserved for kubernetes - worker_kubernetes_reserved_cpus: "0,1" - - # Storage device used for host path provisioner as local storage. - worker_localstorage_device: /dev/vdb - - # detailed configuration for every worker that should be configured - # - workers: - - name: worker-0 # name must match the node name - networks: # Example network config - - name: sapbridge # using a bridge - description: SAP bridge - state: up - type: linux-bridge - ipv4: - enabled: false - auto-gateway: false - auto-dns: false - bridge: - options: - stp: - enabled: false - port: - - name: ens1f0 # network IF name - - name: storage # an SRIOV device - interface: ens2f0 # network IF name - type: sriov - - - bridge: # another bridge - options: - stp: - enabled: false - port: - - name: ens2f0 # network IF name - description: storage - mtu: 9000 - ipv4: - address: - - ip: 192.168.1.51 # IP config - prefix-length: 24 - auto-dns: false - auto-gateway: false - enabled: true - name: storagebridge - state: up - type: linux-bridge - - name: multi # another SRIOV device - interface: ens2f1 # network IF name - type: sriov - - - name: worker-1 # second worker configuration - networks: # Example network config - - name: sapbridge # using a bridge - description: SAP bridge - state: up - type: linux-bridge - ipv4: - enabled: false - auto-gateway: false - auto-dns: false - bridge: - options: - stp: - enabled: false - port: - - name: ens1f0 # network IF name - - name: storage # an SRIOV device - interface: ens2f0 # network IF name - type: sriov diff --git a/roles/sap_anydb_install_oracle/defaults/main.yml b/roles/sap_anydb_install_oracle/defaults/main.yml index dbf8d1ef3..5090a8267 100644 --- a/roles/sap_anydb_install_oracle/defaults/main.yml +++ b/roles/sap_anydb_install_oracle/defaults/main.yml @@ -20,3 +20,9 @@ sap_anydb_install_oracle_inventory_central: /oraInventory sap_anydb_install_oracle_system_password: sap_anydb_install_oracle_extract_path: # e.g. /software + +sap_anydb_install_oracle_patch_opatch_zip: # e.g. OPATCH19P_2308-70004508.ZIP + +sap_anydb_install_oracle_patch_sap_zip: # e.g. SAP19P_2311-70004508.ZIP + +sap_anydb_install_oracle_patch_enable: false diff --git a/roles/sap_anydb_install_oracle/tasks/main.yml b/roles/sap_anydb_install_oracle/tasks/main.yml index e10f4c8c7..d591fb8dc 100644 --- a/roles/sap_anydb_install_oracle/tasks/main.yml +++ b/roles/sap_anydb_install_oracle/tasks/main.yml @@ -10,5 +10,6 @@ - name: Oracle DB - Installation ansible.builtin.include_tasks: "oracledb_installer_{{ sap_anydb_install_oracle_method }}.yml" -#- name: Oracle DB - Post installation MOPatch -# ansible.builtin.include_tasks: "oracledb_install_post_mopatch.yml" +- name: Oracle DB - Post installation MOPatch + ansible.builtin.include_tasks: "oracledb_install_post_mopatch.yml" + when: (sap_anydb_install_oracle_patch_enable | bool) diff --git a/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml b/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml index ed97d539c..c482ea5c2 100644 --- a/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml +++ b/roles/sap_anydb_install_oracle/tasks/oracledb_install_post_mopatch.yml @@ -1 +1,93 @@ --- + +- name: Oracle DB Patch - Copy the SBP + ansible.builtin.copy: + remote_src: true + directory_mode: true + src: "{{ sap_anydb_patch_oracle_sbp_path }}/" + dest: "{{ sap_anydb_install_oracle_base }}/tmp_sbp" + owner: oracle + group: oinstall + mode: '0774' + +- name: Oracle DB Patch - Define vars to use in next tasks + ansible.builtin.set_fact: + current_datetime: "{{ lookup('pipe', 'date \"+%Y_%m_%d_%H_%M_%S\"') }}" + IHRDBMS: "{{ sap_anydb_install_oracle_base }}/{{ sap_anydb_install_oracle_sid }}/19.0.0" + +- name: Oracle DB Patch - Creates the sapbundle dir + ansible.builtin.file: + path: "{{ IHRDBMS }}/sapbundle" + owner: oracle + group: oinstall + state: directory + mode: '0774' + +- name: Oracle DB Patch - Move the old OPatch dir + ansible.builtin.shell: mv {{ IHRDBMS }}/OPatch {{ IHRDBMS }}/OPATCH_pre_SBP_{{ current_datetime }} + become_user: oracle + +- name: Oracle DB Patch - Uncompress the patch files + become_user: oracle + ansible.builtin.unarchive: + src: "{{ sap_anydb_install_oracle_base }}/tmp_sbp/{{ item.source }}" + dest: "{{ item.destination }}" + remote_src: true + loop: + - source: "{{ sap_anydb_install_oracle_patch_opatch_zip }}" + destination: "{{ IHRDBMS }}" + - source: "{{ sap_anydb_install_oracle_patch_sap_zip }}" + destination: "{{ IHRDBMS }}/sapbundle" + +- name: Oracle DB Patch - Move the old MOPatch dir if it exists and move sapbundle + ansible.builtin.shell: | + test -d {{ IHRDBMS }}/MOPatch && mv {{ IHRDBMS }}/MOPatch {{ IHRDBMS }}/MOPATCH_pre_SBP_{{ current_datetime }} + mv {{ IHRDBMS }}/sapbundle/*/MOPatch {{ IHRDBMS }}/MOPatch + become_user: oracle + +# From the SAP Note 3263756 - (LINUX) Oracle Database 19c SBP fails during mopatch +- name: Oracle DB Patch - Fixes rights on oradism file before the mopatch + become: true + ansible.builtin.file: + path: "{{ sap_anydb_install_oracle_base }}/{{ sap_anydb_install_oracle_sid }}/19/bin/oradism" + owner: oracle + mode: '0750' + +- name: Oracle DB Patch - Apply patches + become: true + become_user: oracle + args: + executable: /bin/csh + chdir: "{{ sap_anydb_install_oracle_base }}/tmp_sbp/" + register: __sap_anydb_patch_oracle_exec + changed_when: "'SAP RUNINSTALLER: Completed' in __sap_anydb_patch_oracle_exec.stdout" + failed_when: "__sap_anydb_patch_oracle_exec.rc not in [ 0, 1 ]" + ansible.builtin.shell: | + setenv ORACLE_BASE "{{ sap_anydb_install_oracle_base }}" + setenv DB_SID "{{ sap_anydb_install_oracle_sid }}" + setenv ORACLE_SID "{{ sap_anydb_install_oracle_sid }}" + setenv dbs_ora_tnsname "{{ sap_anydb_install_oracle_sid }}" + setenv ORACLE_HOME "$ORACLE_BASE/$DB_SID/19.0.0" + setenv SAPDATA_HOME "$ORACLE_BASE/$DB_SID/19.0.0" + setenv IHRDBMS "$ORACLE_HOME" + setenv OHRDBMS "$ORACLE_BASE/$DB_SID/19" + setenv dbms_type ORA + setenv GROUP dba + setenv LD_LIBRARY_PATH "$ORACLE_BASE/$DB_SID/19/lib" + setenv SBPFUSER /sbin/fuser + setenv PATH $PATH":$ORACLE_BASE/$DB_SID/19/bin" + $IHRDBMS/MOPatch/mopatch.sh -v -s {{ sap_anydb_install_oracle_patch_sap_zip }} + +# From the SAP Note 3263756 - (LINUX) Oracle Database 19c SBP fails during mopatch +- name: Oracle DB Patch - Return rights on oradism file after the mopatch + become: true + ansible.builtin.file: + path: "{{ sap_anydb_install_oracle_base }}/{{ sap_anydb_install_oracle_sid }}/19/bin/oradism" + owner: root + group: oinstall + mode: '4750' + +- name: Oracle DB Patch - Remove the temp dir + ansible.builtin.file: + path: "{{ sap_anydb_install_oracle_base }}/tmp_sbp" + state: absent diff --git a/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml b/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml index 2ec77bdf6..0b22b773b 100644 --- a/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml +++ b/roles/sap_anydb_install_oracle/tasks/oracledb_installer_minimal.yml @@ -84,7 +84,7 @@ ignore_errors: true ansible.builtin.shell: | setenv DB_SID "{{ sap_anydb_install_oracle_sid }}" - export ORACLE_BASE="{{ sap_anydb_install_oracle_base }}" + setenv ORACLE_BASE "{{ sap_anydb_install_oracle_base }}" setenv ORACLE_HOME "$ORACLE_BASE/$DB_SID/19.0.0" set CURRENT_DATE_ISO=`date +%Y-%m-%d` set ORACLEDB_RESP_GENERATED_FILE=`find $ORACLE_BASE -iname "db_$CURRENT_DATE_ISO*"` @@ -93,7 +93,7 @@ - name: Oracle DB - Find log files become_user: root ansible.builtin.shell: | - ls -1 /oraInventory/logs/InstallActions*/installActions* + ls -1 {{ sap_anydb_install_oracle_inventory_central }}/logs/InstallActions*/installActions* register: __sap_anydb_install_oracle_logs - name: Oracle DB - View the following Oracle DB installation log files diff --git a/roles/sap_hypervisor_node_preconfigure/.ansible-lint b/roles/sap_hypervisor_node_preconfigure/.ansible-lint deleted file mode 100644 index 8a5df4d43..000000000 --- a/roles/sap_hypervisor_node_preconfigure/.ansible-lint +++ /dev/null @@ -1,16 +0,0 @@ ---- -exclude_paths: - - tests/ -enable_list: - - yaml -skip_list: - # We don't want to enforce new Ansible versions for Galaxy: - - meta-runtime[unsupported-version] - # We do not want to use checks which are marked as experimental: - - experimental - # We use ignore_errors for all the assert tasks, which should be acceptable: - - ignore-errors - # We want to allow single digit version numbers in a role's meta/main.yml file: - - schema - # Allow templating inside name because it creates more detailed output: - - name[template] diff --git a/roles/sap_hypervisor_node_preconfigure/.yamllint.yml b/roles/sap_hypervisor_node_preconfigure/.yamllint.yml deleted file mode 100644 index 57ef427c1..000000000 --- a/roles/sap_hypervisor_node_preconfigure/.yamllint.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# Based on ansible-lint config -extends: default - -rules: - braces: {max-spaces-inside: 1, level: error} - brackets: {max-spaces-inside: 1, level: error} -# colons: {max-spaces-after: -1, level: error} -# commas: {max-spaces-after: -1, level: error} - comments: disable - comments-indentation: disable -# document-start: disable -# empty-lines: {max: 3, level: error} -# hyphens: {level: error} -# indentation: disable -# key-duplicates: enable - line-length: disable -# new-line-at-end-of-file: disable -# new-lines: {type: unix} -# trailing-spaces: disable - truthy: disable diff --git a/roles/sap_hypervisor_node_preconfigure/README.md b/roles/sap_hypervisor_node_preconfigure/README.md deleted file mode 100644 index 2dfe015d0..000000000 --- a/roles/sap_hypervisor_node_preconfigure/README.md +++ /dev/null @@ -1,239 +0,0 @@ -`EXPERIMENTAL` - -# sap_hypervisor_node_preconfigure - -This role will configure the following hypervisors in order to run SAP workloads: -* Red Hat OpenShift Virtualization (OCPV) -* Red Hat Enterprise Virtualization (RHV) - -## Platform: Red Hat OpenShift Virtualization - -Will configure a plain vanilla OpenShift cluster so it can be used for SAP workloads. - -### Requirements -* An OpenShift cluster, best without any previous customization. -* The worker nodes should have > 96GB of memory. -* Worker nodes need to have Intel CPUs that provide TSX feature. -* Storage is required, e.g. via NFS, OpenShift Data Foundation or local storage. This role can setup access to a Netapp Filer via Trident storage connector. -Local storage will be configures using host path provisioner. -* Point the `KUBECONFIG` environment variable to your `kubeconfig`. -* Make the role available in case you didn't install it already in an ansible roles directory, e.g. -* Make sure to install the dependencies mentioned below are installed. -* To ensure your local checkout it found by ansible: -``` -mkdir -p ~/.ansible/roles/ -ln -sf ~/community.sap_install/roles/sap_hypervisor_node_preconfigure ~/.ansible/roles/ -``` -### Dependencies - -Needs the ansible kubernetes module and the python3 kubernetes binding. On a RHEL based system the are named -* python3-kubernetes -* ansible-collection-kubernetes-core - -Needs `oc` binary available in path. - -### Role Variables -General variables are defined in sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_ocp_virt.yml -``` -# Install the trident NFS storage provider. If yes, expects configuration details under -# sap_hypervisor_node_preconfigure_cluster_config.trident, see example config. -sap_hypervisor_node_preconfigure_install_trident: True|False -# URL of the trident installer package to use -sap_hypervisor_node_preconfigure_install_trident_url: https://github.com/NetApp/trident/releases/download/v23.01.0/trident-installer-23.01.0.tar.gz - -# should SRIOV be enabled for unsupported NICs -sap_hypervisor_node_preconfigure_sriov_enable_unsupported_nics: True|False - -# Amount of memory [GB] to be reserved for the hypervisor on hosts >= 512GB -sap_hypervisor_node_preconfigure_hypervisor_reserved_ram_host_ge_512: 64 #GB -# Amount of memory [GB] to be reserved for the hypervisor on hosts < 512GB -sap_hypervisor_node_preconfigure_hypervisor_reserved_ram_host_lt_512: 32 #GB - -# Should the check for the minimal amount of memory be ignored? Minimal amount is 96 GB -# If ignored, the amount of $hostmemory - $reserved is allocated with a lower bound of 0 in case $reserved > $hostmemory -sap_hypervisor_node_preconfigure_ignore_minimal_memory_check: True|False - -# Define if the host path provisioner should be installed in order to use a local disk as storage device. -# Uses the following variable to be set to the storage device to be used, e.g.: -# sap_hypervisor_node_preconfigure_cluster_config.worker_localstorage_device: /dev/sdb -sap_hypervisor_node_preconfigure_install_hpp: True|False -``` -The following variables are describing the nodes and networks to be used. It can make sense to have them in a separate file, e.g. see `playbooks/vars/sample-variables-sap-hypervisor-node-preconfigure-rh_ocp_virt.yml` for an example. -``` -sap_hypervisor_node_preconfigure_cluster_config: - # URL under which the OCP cluster is reachable - cluster_url: ocpcluster.domain.org - - # namespace under which the VMs are created, note this has to be - # openshift-sriov-network-operator in case of using SRIOV network - # devices - vm_namespace: sap - - # Optional, configuration for trident driver for Netapp NFS filer - trident: - management: management.domain.org - data: datalif.netapp.domain.org - svm: sap_svm - backend: nas_backend - aggregate: aggregate_Name - username: admin - password: xxxxx - storage_driver: ontap-nas - storage_prefix: ocpv_sap_ - - # CPU cores which will be reserved for kubernetes - worker_kubernetes_reserved_cpus: "0,1" - - # Storage device used for host path provisioner as local storage. - worker_localstorage_device: /dev/vdb - - # detailed configuration for every worker that should be configured - workers: - - name: worker-0 # name must match the node name - networks: # Example network config - - name: sapbridge # using a bridge - description: SAP bridge - state: up - type: linux-bridge - ipv4: - enabled: false - auto-gateway: false - auto-dns: false - bridge: - options: - stp: - enabled: false - port: - - name: ens1f0 # network IF name - - name: storage # an SRIOV device - interface: ens2f0 # network IF name - type: sriov - - - bridge: # another bridge - options: - stp: - enabled: false - port: - - name: ens2f0 # network IF name - description: storage - mtu: 9000 - ipv4: - address: - - ip: 192.168.1.51 # IP config - prefix-length: 24 - auto-dns: false - auto-gateway: false - enabled: true - name: storagebridge - state: up - type: linux-bridge - - name: multi # another SRIOV device - interface: ens2f1 # network IF name - type: sriov - - - name: worker-1 # second worker configuration - networks: # Example network config - - name: sapbridge # using a bridge - description: SAP bridge - state: up - type: linux-bridge - ipv4: - enabled: false - auto-gateway: false - auto-dns: false - bridge: - options: - stp: - enabled: false - port: - - name: ens1f0 # network IF name - - name: storage # an SRIOV device - interface: ens2f0 # network IF name - type: sriov -``` -### Example Playbook -See `playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml` for an example. - -### Example Usage -Make sure to set the `KUBECONFIG` environment variable, e.g. -``` -export KUBECONFIG=~/.kubeconfig -``` -To invoke the example playbook with the example configuration using your localhost as ansible host use the following command line: -``` -ansible-playbook --connection=local -i localhost, playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml -e @s/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml -``` - -## Platform: RHEL KVM -This Ansible Role allows preconfigure of Red Hat Virtualization (RHV), formerly called Red Hat Enterprise Virtualization (RHEV) prior to version 4.4 release. Red Hat Virtualization (RHV) consists of 'Red Hat Virtualization Manager (RHV-M)' and the 'Red Hat Virtualization Host (RHV-H)' hypervisor nodes that this Ansible Role preconfigures. Please note, Red Hat Virtualization is discontinued and maintenance support will end mid-2024. Extended life support for RHV ends mid-2026. -This Ansible Role does not preconfigure RHEL KVM (RHEL-KVM) hypervisor nodes. Please note that RHEL KVM is standalone, and does not have Management tooling (previously provided by RHV-M). - -### Requirements -* A RHV hypervisor. - -### Role Variables -`sap_hypervisor_node_preconfigure_reserved_ram (default: 100)` Reserve memory [GB] for hypervisor host. Depending in the use case should be at least 50-100GB. - -`sap_hypervisor_node_preconfigure_reserve_hugepages (default: static)` Hugepage allocation method: {static|runtime}. -static: done at kernel command line which is slow, but safe -runtime: done with hugeadm which is faster, but can in some cases not ensure all HPs are allocated. - -`sap_hypervisor_node_preconfigure_kvm_nx_huge_pages (default: "auto")` Setting for the huge page shattering kvm.nx_huge_pages: {"auto"|"on"|"off"}. Note the importance of the quotes, otherwise off will be mapped to false. See https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html for additional information: -``` - kvm.nx_huge_pages= - [KVM] Controls the software workaround for the - X86_BUG_ITLB_MULTIHIT bug. - force : Always deploy workaround. - off : Never deploy workaround. - auto : Deploy workaround based on the presence of - X86_BUG_ITLB_MULTIHIT. - - Default is 'auto'. - - If the software workaround is enabled for the host, - guests do need not to enable it for nested guests. -``` - -`sap_hypervisor_node_preconfigure_tsx (default: "off")` Intel Transactional Synchronization Extensions (TSX): {"on"|"off"}. Note the importance of the quotes, otherwise off will be mapped to false. - -`sap_hypervisor_node_preconfigure_assert (default: false)` In assert mode, the parameters on the system are checked if the confirm with what this role would set. - -`sap_hypervisor_node_preconfigure_ignore_failed_assertion (default: no)` Fail if assertion is invalid. - -`sap_hypervisor_node_preconfigure_run_grub2_mkconfig (default: yes)` Update the grub2 config. - - -### Example Playbook -Simple example that just sets the parameters. -``` ---- -- hosts: all - gather_facts: true - serial: 1 - vars: - sap_hypervisor_node_platform: redhat_rhel_kvm - tasks: - - name: Include Role - ansible.builtin.include_role: - name: sap_hypervisor_node_preconfigure -``` - -Run in assert mode to verify that parameters have been set. -``` ---- -- hosts: all - gather_facts: true - serial: 1 - vars: - sap_hypervisor_node_platform: redhat_rhel_kvm - sap_hypervisor_node_preconfigure_assert: yes - tasks: - - name: Include Role - ansible.builtin.include_role: - name: sap_hypervisor_node_preconfigure -``` -### License -Apache 2.0 - -### Author Information -Nils Koenig (nkoenig@redhat.com) diff --git a/roles/sap_hypervisor_node_preconfigure/defaults/main.yml b/roles/sap_hypervisor_node_preconfigure/defaults/main.yml deleted file mode 100644 index 741dfca6f..000000000 --- a/roles/sap_hypervisor_node_preconfigure/defaults/main.yml +++ /dev/null @@ -1,115 +0,0 @@ ---- - -# ibmpower_phyp, redhat_ocp_virt, redhat_rhel_kvm, vmware_vsphere -sap_hypervisor_node_platform: - -# Example configuration -sap_hypervisor_node_preconfigure_cluster_config: - - # URL under which the OCP cluster is reachable - cluster_url: ocpcluster.domain.org - - # namespace under which the VMs are created, note this has to be - # openshift-sriov-network-operator in case of using SRIOV network - # devices - vm_namespace: sap - - # Optional, configuration for trident driver for Netapp NFS filer - trident: - management: management.domain.org - data: datalif.netapp.domain.org - svm: sap_svm - backend: nas_backend - aggregate: aggregate_Name - username: admin - password: xxxxx - storage_driver: ontap-nas - storage_prefix: ocpv_sap_ - - # CPU cores reserved for kubernetes on worker node - worker_kubernetes_reserved_cpus: "0,1" - - # Storage device which should be used if host path provisioner is used - worker_localstorage_device: /dev/vdb - - # detailed configuration for every worker that should be configured - workers: - - name: worker-0 # name must match the node name - networks: # Example network config - - name: sapbridge # using a bridge - description: SAP bridge - state: up - type: linux-bridge - ipv4: - enabled: false - auto-gateway: false - auto-dns: false - bridge: - options: - stp: - enabled: false - port: - - name: ens1f0 # network IF name - - name: storage # an SRIOV device - interface: ens2f0 # network IF name - type: sriov - - - bridge: # another bridge - options: - stp: - enabled: false - port: - - name: ens2f0 # network IF name - description: storage - mtu: 9000 - ipv4: - address: - - ip: 192.168.1.40 # IP config - prefix-length: 24 - auto-dns: false - auto-gateway: false - enabled: true - name: storagebridge - state: up - type: linux-bridge - - name: multi # another SRIOV device - interface: ens2f1 # network IF name - type: sriov - - - name: worker-1 # second worker configuration - networks: # Example network config - - name: sapbridge # using a bridge - description: SAP bridge - state: up - type: linux-bridge - ipv4: - enabled: false - auto-gateway: false - auto-dns: false - bridge: - options: - stp: - enabled: false - port: - - name: ens1f0 # network IF name - - name: storagebridge - description: storage - state: up - type: linux-bridge - bridge: # another bridge - options: - stp: - enabled: false - port: - - name: ens2f0 # network IF name - mtu: 9000 - ipv4: - address: - - ip: 192.168.1.41 # IP config - prefix-length: 24 - auto-dns: false - auto-gateway: false - enabled: true - - name: storage # an SRIOV device - interface: ens2f0 # network IF name - type: sriov diff --git a/roles/sap_hypervisor_node_preconfigure/files/platform/ibmpower_phyp/.gitkeep b/roles/sap_hypervisor_node_preconfigure/files/platform/ibmpower_phyp/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/files/platform/redhat_ocp_virt/.gitkeep b/roles/sap_hypervisor_node_preconfigure/files/platform/redhat_ocp_virt/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/files/platform/vmware_vsphere/.gitkeep b/roles/sap_hypervisor_node_preconfigure/files/platform/vmware_vsphere/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/handlers/main.yml b/roles/sap_hypervisor_node_preconfigure/handlers/main.yml deleted file mode 100644 index d94364078..000000000 --- a/roles/sap_hypervisor_node_preconfigure/handlers/main.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -- name: Hypervisor node preconfigure - Include Handler Tasks for {{ sap_hypervisor_node_platform }} - ansible.builtin.import_tasks: "platform/{{ sap_hypervisor_node_platform }}/main.yml" diff --git a/roles/sap_hypervisor_node_preconfigure/handlers/platform/ibmpower_phyp/.gitkeep b/roles/sap_hypervisor_node_preconfigure/handlers/platform/ibmpower_phyp/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/handlers/platform/redhat_ocp_virt/.gitkeep b/roles/sap_hypervisor_node_preconfigure/handlers/platform/redhat_ocp_virt/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/handlers/platform/redhat_rhel_kvm/main.yml b/roles/sap_hypervisor_node_preconfigure/handlers/platform/redhat_rhel_kvm/main.yml deleted file mode 100644 index f773bdd89..000000000 --- a/roles/sap_hypervisor_node_preconfigure/handlers/platform/redhat_rhel_kvm/main.yml +++ /dev/null @@ -1,93 +0,0 @@ ---- -- name: "Check if server is booted in BIOS or UEFI mode" - ansible.builtin.stat: - path: /sys/firmware/efi - get_checksum: no - register: __sap_hypervisor_node_preconfigure_register_stat_sys_firmware_efi - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - when: - - sap_hypervisor_node_preconfigure_run_grub2_mkconfig|d(true) - -- name: Debug BIOS or UEFI - ansible.builtin.debug: - var: __sap_hypervisor_node_preconfigure_register_stat_sys_firmware_efi.stat.exists - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - when: - - sap_hypervisor_node_preconfigure_run_grub2_mkconfig|d(true) - -- name: "Run grub-mkconfig (BIOS mode)" - ansible.builtin.command: grub2-mkconfig -o /boot/grub2/grub.cfg - register: __sap_hypervisor_node_preconfigure_register_grub2_mkconfig_bios_mode - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - notify: __sap_hypervisor_node_preconfigure_reboot_handler - when: - - not __sap_hypervisor_node_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_hypervisor_node_preconfigure_run_grub2_mkconfig|d(true) - become: true - become_user: root - -- name: "Debug grub-mkconfig BIOS mode" - ansible.builtin.debug: - var: __sap_hypervisor_node_preconfigure_register_grub2_mkconfig_bios_mode.stdout_lines, - __sap_hypervisor_node_preconfigure_register_grub2_mkconfig_bios_mode.stderr_lines - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - when: - - not __sap_hypervisor_node_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_hypervisor_node_preconfigure_run_grub2_mkconfig|d(true) - -- name: "Set the grub.cfg location RHEL" - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_uefi_boot_dir: /boot/efi/EFI/redhat/grub.cfg - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - when: - - ansible_distribution == 'RedHat' - -- name: "Set the grub.cfg location SLES" - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_uefi_boot_dir: /boot/efi/EFI/BOOT/grub.cfg - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - when: - - ansible_distribution == 'SLES' or ansible_distribution == 'SLES_SAP' - -- name: "Run grub-mkconfig (UEFI mode)" - ansible.builtin.command: "grub2-mkconfig -o {{ __sap_hypervisor_node_preconfigure_uefi_boot_dir }}" - register: __sap_hypervisor_node_preconfigure_register_grub2_mkconfig_uefi_mode - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - notify: __sap_hypervisor_node_preconfigure_reboot_handler - when: - - __sap_hypervisor_node_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_hypervisor_node_preconfigure_run_grub2_mkconfig|d(true) - become: true - become_user: root - -- name: "Debug grub-mkconfig UEFI" - ansible.builtin.debug: - var: __sap_hypervisor_node_preconfigure_register_grub2_mkconfig_uefi_mode.stdout_lines, - __sap_hypervisor_node_preconfigure_register_grub2_mkconfig_uefi_mode.stderr_lines - listen: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - when: - - __sap_hypervisor_node_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_hypervisor_node_preconfigure_run_grub2_mkconfig|d(true) - -- name: Reboot the managed node - ansible.builtin.reboot: - test_command: /bin/true - listen: __sap_hypervisor_node_preconfigure_reboot_handler - when: - - sap_hypervisor_node_preconfigure_reboot_ok|d(false) - -- name: Let the role fail if a reboot is required - ansible.builtin.fail: - msg: Reboot is required! - listen: __sap_hypervisor_node_preconfigure_reboot_handler - when: - - sap_hypervisor_node_preconfigure_fail_if_reboot_required|d(true) - - not sap_hypervisor_node_preconfigure_reboot_ok|d(false) - -- name: Show a warning message if a reboot is required - ansible.builtin.debug: - msg: "WARN: Reboot is required!" - listen: __sap_hypervisor_node_preconfigure_reboot_handler - when: - - not sap_hypervisor_node_preconfigure_fail_if_reboot_required|d(true) - - not sap_hypervisor_node_preconfigure_reboot_ok|d(false) diff --git a/roles/sap_hypervisor_node_preconfigure/handlers/platform/vmware_vsphere/.gitkeep b/roles/sap_hypervisor_node_preconfigure/handlers/platform/vmware_vsphere/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/meta/main.yml b/roles/sap_hypervisor_node_preconfigure/meta/main.yml deleted file mode 100644 index 1b04b2f41..000000000 --- a/roles/sap_hypervisor_node_preconfigure/meta/main.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -galaxy_info: - namespace: community - role_name: sap_hypervisor_node_preconfigure - author: Nils Koenig - description: Provide the configuration of hypervisors for SAP workloads - license: Apache-2.0 - min_ansible_version: "2.9" - galaxy_tags: [ 'sap', 'hana', 'rhel', 'redhat', 'openshift' ] - platforms: - - name: RHEL - versions: - 8 -dependencies: [] diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/main.yml b/roles/sap_hypervisor_node_preconfigure/tasks/main.yml deleted file mode 100644 index 173633905..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/main.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: SAP certified hypervisor node preconfigure - Include Vars for {{ sap_hypervisor_node_platform }} - ansible.builtin.include_vars: "platform_defaults_{{ sap_hypervisor_node_platform }}.yml" - -- name: SAP certified hypervisor node preconfigure - Include Tasks for {{ sap_hypervisor_node_platform }} - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/main.yml" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/ibmpower_phyp/.gitkeep b/roles/sap_hypervisor_node_preconfigure/tasks/platform/ibmpower_phyp/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/.gitkeep b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/99-kargs-worker.yml.j2 b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/99-kargs-worker.yml.j2 deleted file mode 100644 index 32064a8d7..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/99-kargs-worker.yml.j2 +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: machineconfiguration.openshift.io/v1 -kind: MachineConfig -metadata: - labels: - machineconfiguration.openshift.io/role: worker - name: 99-kargs-worker -spec: - config: - ignition: - version: 3.2.0 - kernelArguments: - - intel_iommu=on - - iommu=pt - - default_hugepagesz=1GB - - hugepagesz=1GB - - hugepages={{ __sap_hypervisor_node_preconfigure_register_worker_reserved_hugepages }} - - tsx=on diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/configure-worker-node.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/configure-worker-node.yml deleted file mode 100644 index 3af1dcf5b..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/configure-worker-node.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- name: Label nodes - ansible.builtin.command: "oc label node {{ __sap_hypervisor_node_preconfigure_register_worker.name }} cpumanager=true --overwrite=true" - register: __sap_hypervisor_node_preconfigure_label_node_result - changed_when: __sap_hypervisor_node_preconfigure_label_node_result.rc != 0 - -- name: Include node network - ansible.builtin.include_tasks: node-network.yml - with_items: "{{ __sap_hypervisor_node_preconfigure_register_worker.networks }}" - loop_control: - loop_var: __sap_hypervisor_node_preconfigure_register_worker_network - index_var: __sap_hypervisor_node_preconfigure_register_worker_network_nr - when: __sap_hypervisor_node_preconfigure_register_worker.networks is defined - -# How to wait for node to be scheduleable? (NodeSchedulable) -- name: Wait for all k8s nodes to be ready - ansible.builtin.command: oc wait --for=condition=Ready nodes --all --timeout=3600s - register: __sap_hypervisor_node_preconfigure_register_nodes_ready - changed_when: __sap_hypervisor_node_preconfigure_register_nodes_ready.rc != 0 diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/create-sap-bridge.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/create-sap-bridge.yml deleted file mode 100644 index bbdbdfffd..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/create-sap-bridge.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -- name: Create SAP bridge NodeNetworkConfigurationPolicy - kubernetes.core.k8s: - state: present - definition: - apiVersion: nmstate.io/v1 - kind: NodeNetworkConfigurationPolicy - metadata: - name: "sap-bridge-policy-{{ worker.name }}" - spec: - nodeSelector: - kubernetes.io/hostname: "{{ worker.name }}" - desiredState: - interfaces: - - name: sapbridge - description: "Linux bridge with {{ worker.sap_bridge_interface }} as physical port to access SAP network" - type: linux-bridge - state: up - ipv4: - enabled: false - bridge: - options: - stp: - enabled: false - port: - - name: "{{ worker.sap_bridge_interface }}" - - -- name: Create SAP bridge NetworkAttachmentDefinition - kubernetes.core.k8s: - state: present - definition: - apiVersion: "k8s.cni.cncf.io/v1" - kind: NetworkAttachmentDefinition - metadata: - kubernetes.io/hostname: "{{ worker.name }}" - machineconfiguration.openshift.io/role: "{{ worker.name }}" - namespace: "{{ vm_namespace }}" - name: sap-bridge-network-definition - annotations: - k8s.v1.cni.cncf.io/resourceName: bridge.network.kubevirt.io/sapbridge - spec: - config: '{ - "cniVersion": "0.3.1", - "name": "sap-bridge-network-definition", - "type": "cnv-bridge", - "bridge": "sapbridge", - "macspoofchk": true - }' diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-cnv-operator.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-cnv-operator.yml deleted file mode 100644 index e36e26ffa..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-cnv-operator.yml +++ /dev/null @@ -1,74 +0,0 @@ ---- -- name: Create the CNV Operator namespace - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Namespace - metadata: - name: openshift-cnv - -- name: Create CNV OperatorGroup kubevirt-hyperconverged-group - kubernetes.core.k8s: - state: present - - definition: - apiVersion: operators.coreos.com/v1 - kind: OperatorGroup - metadata: - name: kubevirt-hyperconverged-group - namespace: openshift-cnv - spec: - targetNamespaces: - - openshift-cnv - -- name: Create CNV Subscription - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: Subscription - metadata: - name: hco-operatorhub - namespace: openshift-cnv - spec: - source: redhat-operators - sourceNamespace: openshift-marketplace - name: kubevirt-hyperconverged - -- name: Wait - ansible.builtin.pause: - seconds: 300 - -- name: Get Install Plan Name - retries: 10 - delay: 10 - ansible.builtin.command: oc get subscriptions/hco-operatorhub --namespace openshift-cnv --output=jsonpath='{$.status.installplan.name}' - register: __sap_hypervisor_node_preconfigure_register_cnv_subscription_install_plan_name - until: __sap_hypervisor_node_preconfigure_register_cnv_subscription_install_plan_name.stdout != "" - changed_when: __sap_hypervisor_node_preconfigure_register_cnv_subscription_install_plan_name.stdout != "" - -- name: Wait for Install Plan to finish - ansible.builtin.command: "oc wait installplan \ - {{ __sap_hypervisor_node_preconfigure_register_cnv_subscription_install_plan_name.stdout }} --namespace openshift-cnv --for=condition='Installed' --timeout='5m'" - register: __sap_hypervisor_node_preconfigure_register_wait_for_installplan - changed_when: __sap_hypervisor_node_preconfigure_register_wait_for_installplan.rc != 0 - -- name: Wait - ansible.builtin.pause: - seconds: 300 - -- name: Create CNV HyperConverged - kubernetes.core.k8s: - state: present - definition: - apiVersion: hco.kubevirt.io/v1beta1 - kind: HyperConverged - metadata: - name: kubevirt-hyperconverged - namespace: openshift-cnv - spec: - -- name: Wait - ansible.builtin.pause: - seconds: 300 diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-hpp.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-hpp.yml deleted file mode 100644 index daa713a4c..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-hpp.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -- name: Create systemd files for local storage handling - kubernetes.core.k8s: - state: present - definition: - apiVersion: machineconfiguration.openshift.io/v1 - kind: MachineConfig - metadata: - annotations: - labels: - machineconfiguration.openshift.io/role: worker - name: 50-hpp-local - spec: - config: - ignition: - version: 2.2.0 - systemd: - units: - - contents: | - [Unit] - Description=Create mountpoint /var/localstorage and initialize filesystem - Before=var-localstorage.mount - [Service] - Type=oneshot - ExecStart=/bin/bash -c "if [[ $(lsblk -o FSTYPE {{ sap_hypervisor_node_preconfigure_cluster_config.worker_localstorage_device }} --noheadings) != 'xfs' ]]; then mkfs.xfs -f {{ sap_hypervisor_node_preconfigure_cluster_config.worker_localstorage_device }}; fi" - ExecStart=/bin/mkdir -p /var/localstorage - enabled: true - name: create-mountpoint-var-localstorage.service - - contents: | - [Unit] - After=create-mountpoint-var-localstorage.service - Requires=create-mountpoint-var-localstorage.service - [Mount] - What={{ sap_hypervisor_node_preconfigure_cluster_config.worker_localstorage_device }} - Where=/var/localstorage - Type=xfs - [Install] - WantedBy=local-fs.target - enabled: true - name: var-localstorage.mount - - contents: | - [Unit] - Description=Set SELinux chcon for hostpath provisioner - Before=kubelet.service - After=var-localstorage.mount - [Service] - ExecStart=/usr/bin/chcon -Rt container_file_t /var/localstorage - [Install] - WantedBy=multi-user.target - enabled: true - name: hostpath-provisioner.service - -- name: Wait for mountpoint to be ready - ansible.builtin.pause: - minutes: 3 - -- name: Create hostpath provisioner (HPP) - kubernetes.core.k8s: - state: present - definition: - apiVersion: hostpathprovisioner.kubevirt.io/v1beta1 - kind: HostPathProvisioner - metadata: - name: hostpath-provisioner - spec: - imagePullPolicy: IfNotPresent - storagePools: - - name: localstorage - path: /var/localstorage - workload: - nodeSelector: - kubernetes.io/os: linux - machineconfiguration.openshift.io/role: worker - -- name: Create storage class for HPP - kubernetes.core.k8s: - state: present - definition: - apiVersion: storage.k8s.io/v1 - kind: StorageClass - metadata: - name: local - annotations: - storageclass.kubernetes.io/is-default-class: "true" - provisioner: kubevirt.io.hostpath-provisioner - reclaimPolicy: Delete - volumeBindingMode: WaitForFirstConsumer - parameters: - storagePool: localstorage diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-nmstate-operator.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-nmstate-operator.yml deleted file mode 100644 index 5e1e4f46a..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-nmstate-operator.yml +++ /dev/null @@ -1,70 +0,0 @@ ---- -- name: Create the nmstate operator namespace - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Namespace - metadata: - labels: - kubernetes.io/metadata.name: openshift-nmstate - name: openshift-nmstate - name: openshift-nmstate - spec: - finalizers: - - kubernetes - -- name: Create the OperatorGroup - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1 - kind: OperatorGroup - metadata: - annotations: - olm.providedAPIs: NMState.v1.nmstate.io - generateName: openshift-nmstate- - name: openshift-nmstate-tn6k8 - namespace: openshift-nmstate - spec: - targetNamespaces: - - openshift-nmstate - -- name: Pause to give operator a chance to install - ansible.builtin.pause: - minutes: 2 - -- name: Subscribe to the nmstate Operator - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: Subscription - metadata: - labels: - operators.coreos.com/kubernetes-nmstate-operator.openshift-nmstate: "" - name: kubernetes-nmstate-operator - namespace: openshift-nmstate - spec: - channel: stable - installPlanApproval: Automatic - name: kubernetes-nmstate-operator - source: redhat-operators - sourceNamespace: openshift-marketplace - -- name: Pause to give operator a chance to install - ansible.builtin.pause: - minutes: 5 - -- name: Create instance of the nmstate operator - kubernetes.core.k8s: - state: present - definition: - apiVersion: nmstate.io/v1 - kind: NMState - metadata: - name: nmstate - -- name: Pause to give instance a chance to come up - ansible.builtin.pause: - minutes: 5 diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-sriov-operator.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-sriov-operator.yml deleted file mode 100644 index 5fcb437d2..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-sriov-operator.yml +++ /dev/null @@ -1,54 +0,0 @@ ---- -- name: Create the SRIOV Operator namespace - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Namespace - metadata: - name: openshift-sriov-network-operator - -- name: Create the SRIOV Operator namespace - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1 - kind: OperatorGroup - metadata: - name: sriov-network-operators - namespace: openshift-sriov-network-operator - spec: - targetNamespaces: - - openshift-sriov-network-operator - -- name: Create the SRIOV Operator namespace - kubernetes.core.k8s: - state: present - definition: - apiVersion: operators.coreos.com/v1alpha1 - kind: Subscription - metadata: - name: sriov-network-operator-subscription - namespace: openshift-sriov-network-operator - spec: - source: redhat-operators - sourceNamespace: openshift-marketplace - name: sriov-network-operator - channel: "stable" - -- name: Pause to give operator a chance to install - ansible.builtin.pause: - minutes: 3 - -- name: Copy patch to enable unsupported NICs - ansible.builtin.copy: - src: sriov-enabled-unsupported-nics.sh - dest: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/sriov-enabled-unsupported-nics.sh" - mode: "0755" - when: sap_hypervisor_node_preconfigure_sriov_enable_unsupported_nics - -- name: Enable unsupported NICs - ansible.builtin.command: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/sriov-enabled-unsupported-nics.sh" - when: sap_hypervisor_node_preconfigure_sriov_enable_unsupported_nics - register: __sap_hypervisor_node_preconfigure_register_enable_unsupported_nics - changed_when: __sap_hypervisor_node_preconfigure_register_enable_unsupported_nics.rc != 0 diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-trident.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-trident.yml deleted file mode 100644 index c1788dbd1..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-trident.yml +++ /dev/null @@ -1,48 +0,0 @@ ---- -- name: Download trident - ansible.builtin.unarchive: - remote_src: true - src: "{{ sap_hypervisor_node_preconfigure_install_trident_url }}" - dest: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/" - -- name: Uninstall trident - ansible.builtin.command: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/trident-installer/tridentctl uninstall -n trident" - ignore_errors: true - register: __sap_hypervisor_node_preconfigure_register_uninstall_trident - changed_when: __sap_hypervisor_node_preconfigure_register_uninstall_trident.rc != 0 - -- name: Install trident - ansible.builtin.command: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/trident-installer/tridentctl install -n trident" - register: __sap_hypervisor_node_preconfigure_register_install_trident - changed_when: __sap_hypervisor_node_preconfigure_register_install_trident.rc != 0 - -- name: Copy backend file - ansible.builtin.template: - src: "trident-backend.json.j2" - dest: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/trident-backend.json" - mode: "0644" - -- name: Create trident backend - ansible.builtin.command: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}\ - /trident-installer/tridentctl -n trident create backend -f\ - {{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}\ - /trident-backend.json" - register: __sap_hypervisor_node_preconfigure_register_create_trident_backend - changed_when: __sap_hypervisor_node_preconfigure_register_create_trident_backend.rc != 0 - -- name: Create storage class - kubernetes.core.k8s: - state: present - definition: - apiVersion: storage.k8s.io/v1 - kind: StorageClass - metadata: - name: nas - annotations: - storageclass.kubernetes.io/is-default-class: "true" - provisioner: csi.trident.netapp.io - parameters: - backendType: "{{ sap_hypervisor_node_preconfigure_cluster_config.trident.storage_driver }}" - snapshots: "true" - provisioningType: "thin" - encryption: "false" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-virtctl.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-virtctl.yml deleted file mode 100644 index bd5dd818d..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/install-virtctl.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- name: Create ~/bin - ansible.builtin.file: - path: ~/bin - state: directory - mode: "0700" - -- name: Get and extract virtctl -# become: yes - ansible.builtin.unarchive: - validate_certs: false - remote_src: true - src: "https://hyperconverged-cluster-cli-download-openshift-cnv.apps.\ - {{ sap_hypervisor_node_preconfigure_cluster_config.cluster_url }}/amd64/linux/virtctl.tar.gz" - dest: ~/bin diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/kargs.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/kargs.yml deleted file mode 100644 index bd28ea55b..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/kargs.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Personalize template - ansible.builtin.template: - src: 99-kargs-worker.yml.j2 - dest: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/99-kargs-{{ __sap_hypervisor_node_preconfigure_register_worker_name }}.yml.j2" - mode: "0644" - -- name: Enable hugepages - kubernetes.core.k8s: - state: present - src: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/99-kargs-{{ __sap_hypervisor_node_preconfigure_register_worker_name }}.yml.j2" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/label-worker-invtsc.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/label-worker-invtsc.yml deleted file mode 100644 index 57a52da24..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/label-worker-invtsc.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- -- name: Label worker with invtsc flag - kubernetes.core.k8s: - state: present - definition: - apiVersion: v1 - kind: Namespace - metadata: - name: default - labels: - 'feature.node.kubernetes.io/cpu-feature-invtsc': enabled diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/main.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/main.yml deleted file mode 100644 index f815d1d54..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/main.yml +++ /dev/null @@ -1,98 +0,0 @@ ---- -- name: Get a list of all nodes from any namespace - kubernetes.core.k8s_info: - kind: Node - register: __sap_hypervisor_node_preconfigure_register_node_list - -- name: Generate list with worker node names - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_register_worker_node_name_list: - "{{ __sap_hypervisor_node_preconfigure_register_worker_node_name_list | \ - d([]) + [__sap_hypervisor_node_preconfigure_register_worker_node.name] }}" - with_items: "{{ sap_hypervisor_node_preconfigure_cluster_config.workers }}" - loop_control: - loop_var: __sap_hypervisor_node_preconfigure_register_worker_node - -- name: Filter hosts - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_register_nodes: - "{{ __sap_hypervisor_node_preconfigure_register_nodes | \ - d([]) + [__sap_hypervisor_node_preconfigure_register_host] }}" - with_items: "{{ __sap_hypervisor_node_preconfigure_register_node_list['resources'] }}" - loop_control: - loop_var: __sap_hypervisor_node_preconfigure_register_host - when: __sap_hypervisor_node_preconfigure_register_host.metadata.name in __sap_hypervisor_node_preconfigure_register_worker_node_name_list - -- name: Assert that configured nodes are found - ansible.builtin.assert: - that: __sap_hypervisor_node_preconfigure_register_nodes is defined - fail_msg: No nodes found that match configuration provided in sap_hypervisor_node_preconfigure_cluster_config - success_msg: Configured nodes found - -# Determine available memory on first worker node. -# This amount will be used for all nodes, so make sure all have an identical amount. -- name: Get worker name - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_register_worker_name: - "{{ __sap_hypervisor_node_preconfigure_register_nodes[0]['metadata']['labels']['kubernetes.io/hostname'] }}" - -- name: Get memory of first worker node (will be used for all worker nodes later on) - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_register_worker_memory_gib: - "{{ (__sap_hypervisor_node_preconfigure_register_nodes[0]['status']['capacity']['memory'] | replace('Ki', '') | int / 1048576) }}" - -- name: Check if host has minimal amount of memory (96GiB) - ansible.builtin.assert: - that: __sap_hypervisor_node_preconfigure_register_worker_memory_gib | int >= 96 - fail_msg: "Not enough memory on node {{ __sap_hypervisor_node_preconfigure_register_worker_name }}" - success_msg: "Enough memory on node {{ __sap_hypervisor_node_preconfigure_register_worker_name }}" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_minimal_memory_check }}" - -# calculate memory to be allocated as hugepages -# if system < 512GiB memory use 32GiB as upper boundary, 64GB otherwise as upper boundary -- name: Calculate amount of hugepages to reserve (host memory < 512 GiB) - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_register_worker_reserved_hugepages: "{{ __sap_hypervisor_node_preconfigure_register_worker_memory_gib | int - sap_hypervisor_node_preconfigure_hypervisor_reserved_ram_host_lt_512 }}" - when: __sap_hypervisor_node_preconfigure_register_worker_memory_gib | int < 512 - -- name: Calculate amount of hugepages to reserve (host memory >= 512 GiB) - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_register_worker_reserved_hugepages: "{{ __sap_hypervisor_node_preconfigure_register_worker_memory_gib | int - sap_hypervisor_node_preconfigure_hypervisor_reserved_ram_host_ge_512 }}" - when: __sap_hypervisor_node_preconfigure_register_worker_memory_gib | int >= 512 - -- name: Include prepare - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/prepare.yml" -- name: Include tuned virtual host - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/tuned-virtual-host.yml" -- name: Include install CNV operator - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/install-cnv-operator.yml" - when: sap_hypervisor_node_preconfigure_install_operators -- name: Include install sriov operator - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/install-sriov-operator.yml" - when: sap_hypervisor_node_preconfigure_install_operators -- name: Include install nmstate operator - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/install-nmstate-operator.yml" - when: sap_hypervisor_node_preconfigure_install_operators -- name: Include install virtctl - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/install-virtctl.yml" -- name: Include setup worker nodes - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/setup-worker-nodes.yml" - when: sap_hypervisor_node_preconfigure_setup_workers - -# How to wait for node to be scheduleable? (NodeSchedulable) -- name: Wait for all k8s nodes to be ready - ansible.builtin.command: oc wait --for=condition=Ready nodes --all --timeout=3600s - register: __sap_hypervisor_node_preconfigure_register_nodes_ready - changed_when: __sap_hypervisor_node_preconfigure_register_nodes_ready.rc != 0 - -- name: Print nodes - ansible.builtin.debug: - var: __sap_hypervisor_node_preconfigure_register_nodes_ready.stdout_lines - -- name: Include Trident installation - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/install-trident.yml" - when: sap_hypervisor_node_preconfigure_install_trident - -- name: Include local storage creation (HPP) - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/install-hpp.yml" - when: sap_hypervisor_node_preconfigure_install_hpp diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/node-network.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/node-network.yml deleted file mode 100644 index 421d24c82..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/node-network.yml +++ /dev/null @@ -1,103 +0,0 @@ ---- -- name: Print network - ansible.builtin.debug: - var: __sap_hypervisor_node_preconfigure_register_worker_network - -- name: "Create NodeNetworkConfigurationPolicy\ - {{ __sap_hypervisor_node_preconfigure_register_worker_network.name }} on \ - {{ __sap_hypervisor_node_preconfigure_register_worker.name }}" - kubernetes.core.k8s: - state: present - definition: - apiVersion: nmstate.io/v1 - kind: NodeNetworkConfigurationPolicy - metadata: - name: "{{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}-{{ __sap_hypervisor_node_preconfigure_register_worker.name }}" - spec: - nodeSelector: - kubernetes.io/hostname: "{{ __sap_hypervisor_node_preconfigure_register_worker.name }}" - desiredState: - interfaces: - - "{{ __sap_hypervisor_node_preconfigure_register_worker_network }}" - when: __sap_hypervisor_node_preconfigure_register_worker_network.type == 'linux-bridge' - -- name: "Create NetworkAttachmentDefinition {{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}" - kubernetes.core.k8s: - state: present - definition: - apiVersion: "k8s.cni.cncf.io/v1" - kind: NetworkAttachmentDefinition - metadata: - namespace: "{{ sap_hypervisor_node_preconfigure_cluster_config.vm_namespace }}" - name: "{{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}-network-definition" - annotations: - k8s.v1.cni.cncf.io/resourceName: "bridge.network.kubevirt.io/{{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}" - spec: - config: '{ - "cniVersion": "0.3.1", - "name": "sapbridge-network-definition", - "type": "cnv-bridge", - "bridge": "sapbridge", - "macspoofchk": true - }' - when: __sap_hypervisor_node_preconfigure_register_worker_network.type == 'linux-bridge' - -- name: Label the node with feature.node.kubernetes.io/network-sriov.capable=true - kubernetes.core.k8s: - definition: - apiVersion: v1 - kind: Node - metadata: - name: "{{ __sap_hypervisor_node_preconfigure_register_worker.name }}" - labels: - feature.node.kubernetes.io/network-sriov.capable: "true" - state: present - when: __sap_hypervisor_node_preconfigure_register_worker_network.type == 'sriov' - -- name: "Create SRIOV NodeNetworkConfigurationPolicy \ - {{ __sap_hypervisor_node_preconfigure_register_worker_network.name }} on \ - {{ __sap_hypervisor_node_preconfigure_register_worker.name }}" - kubernetes.core.k8s: - state: present - definition: - apiVersion: sriovnetwork.openshift.io/v1 - kind: SriovNetworkNodePolicy - metadata: - name: "iface-{{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}-sriov-{{ __sap_hypervisor_node_preconfigure_register_worker.name }}" - namespace: openshift-sriov-network-operator - spec: - resourceName: "iface{{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}sriov" - nodeSelector: - feature.node.kubernetes.io/network-sriov.capable: "true" - kubernetes.io/hostname: "{{ __sap_hypervisor_node_preconfigure_register_worker.name }}" - priority: 5 - mtu: 9000 - numVfs: 8 - nicSelector: - pfNames: ['{{ __sap_hypervisor_node_preconfigure_register_worker_network.interface }}#0-7'] - deviceType: vfio-pci - isRdma: false - when: __sap_hypervisor_node_preconfigure_register_worker_network.type == "sriov" - -- name: "Create SriovNetwork Attachment Definition {{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}" - kubernetes.core.k8s: - state: present - definition: - apiVersion: sriovnetwork.openshift.io/v1 - kind: SriovNetwork - metadata: - name: "iface-{{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}-sriov" - namespace: openshift-sriov-network-operator - spec: - ipam: | - { - "type": "host-local", - "subnet": "192.168.1.0/24", - "rangeStart": "192.168.1.200", - "rangeEnd": "192.168.1.210" - } - networkNamespace: openshift-sriov-network-operator - resourceName: "iface{{ __sap_hypervisor_node_preconfigure_register_worker_network.name }}sriov" - spoofChk: "off" - trust: "on" - when: __sap_hypervisor_node_preconfigure_register_worker_network.type == "sriov" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/prepare.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/prepare.yml deleted file mode 100644 index 0dfbfa1da..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/prepare.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: Gather Facts - ansible.builtin.gather_facts: - -- name: Create Tempdir - ansible.builtin.tempfile: - state: directory - suffix: "_sap_hypervisor_node_preconfigure" - register: __sap_hypervisor_node_preconfigure_register_tmpdir - -- name: "Create VM namespace {{ sap_hypervisor_node_preconfigure_cluster_config.vm_namespace }}" - kubernetes.core.k8s: - name: "{{ sap_hypervisor_node_preconfigure_cluster_config.vm_namespace }}" - api_version: v1 - kind: Namespace - state: present diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/setup-worker-nodes.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/setup-worker-nodes.yml deleted file mode 100644 index 29420bee6..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/setup-worker-nodes.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -- name: Include configure worker - ansible.builtin.include_tasks: "platform/{{ sap_hypervisor_node_platform }}/configure-worker-node.yml" - with_items: "{{ sap_hypervisor_node_preconfigure_cluster_config.workers }}" - loop_control: - loop_var: __sap_hypervisor_node_preconfigure_register_worker - index_var: __sap_hypervisor_node_preconfigure_register_worker_nr - -- name: Enable CPU Manager by patching MCP worker - kubernetes.core.k8s: - state: patched - definition: - apiVersion: machineconfiguration.openshift.io/v1 - kind: MachineConfigPool - metadata: - name: worker - labels: - custom-kubelet: cpumanager-enabled - -- name: Delete kubletconfig for cpumanager - kubernetes.core.k8s: - state: absent - definition: - apiVersion: machineconfiguration.openshift.io/v1 - kind: KubeletConfig - metadata: - name: cpumanager-enabled - spec: - machineConfigPoolSelector: - matchLabels: - custom-kubelet: cpumanager-enabled - kubeletConfig: - cpuManagerPolicy: static - cpuManagerReconcilePeriod: 5s - -- name: Create kubletconfig for cpumanager worker with CPUs reserved for kubernetes - when: sap_hypervisor_node_preconfigure_cluster_config.worker_kubernetes_reserved_cpus is defined - kubernetes.core.k8s: - state: present - definition: - apiVersion: machineconfiguration.openshift.io/v1 - kind: KubeletConfig - metadata: - name: cpumanager-enabled - spec: - machineConfigPoolSelector: - matchLabels: - custom-kubelet: cpumanager-enabled - kubeletConfig: - cpuManagerPolicy: static - cpuManagerReconcilePeriod: 5s - reservedSystemCPUs: "{{ sap_hypervisor_node_preconfigure_cluster_config.worker_kubernetes_reserved_cpus }}" - -- name: Create kubletconfig for cpumanager worker - when: sap_hypervisor_node_preconfigure_cluster_config.worker_kubernetes_reserved_cpus is not defined - kubernetes.core.k8s: - state: present - definition: - apiVersion: machineconfiguration.openshift.io/v1 - kind: KubeletConfig - metadata: - name: cpumanager-enabled - machineconfiguration.openshift.io/role: worker - spec: - machineConfigPoolSelector: - matchLabels: - custom-kubelet: cpumanager-enabled - kubeletConfig: - cpuManagerPolicy: static - cpuManagerReconcilePeriod: 5s - -- name: Render template - ansible.builtin.template: - src: 99-kargs-worker.yml.j2 - dest: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/99-kargs-worker.yml" - mode: "0644" - -- name: Enable hugepages - kubernetes.core.k8s: - state: present - src: "{{ __sap_hypervisor_node_preconfigure_register_tmpdir.path }}/99-kargs-worker.yml" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/sriov-enabled-unsupported-nics.sh b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/sriov-enabled-unsupported-nics.sh deleted file mode 100644 index 6cec1a678..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/sriov-enabled-unsupported-nics.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -# in order to allow unsupported SRIOV nics such as Mellanox -oc patch sriovoperatorconfig default --type=merge -n openshift-sriov-network-operator --patch '{ "spec": { "enableOperatorWebhook": false } }' diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/trident-backend.json.j2 b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/trident-backend.json.j2 deleted file mode 100644 index e422aab11..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/trident-backend.json.j2 +++ /dev/null @@ -1,18 +0,0 @@ -{ - "nfsMountOptions": "nfsvers=3", - "defaults": { - "exportPolicy": "default" - }, - "debug":false, - "managementLIF":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.management }}", - "dataLIF":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.data }}", - "svm":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.svm }}", - "backendName": "{{ sap_hypervisor_node_preconfigure_cluster_config.trident.backend }}", - "aggregate":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.aggregate }}", - "username":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.username }}", - "password":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.password }}", - "storageDriverName":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.storage_driver }}", - "storagePrefix":"{{ sap_hypervisor_node_preconfigure_cluster_config.trident.storage_prefix }}", - "version":1 -} - diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/tuned-virtual-host.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/tuned-virtual-host.yml deleted file mode 100644 index e2dd4f483..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_ocp_virt/tuned-virtual-host.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -- name: Set virtual-host for worker nodes - kubernetes.core.k8s: - state: present - definition: - apiVersion: tuned.openshift.io/v1 - kind: Tuned - metadata: - name: virtual-host - namespace: openshift-cluster-node-tuning-operator - spec: - profile: - - data: | - [main] - include=virtual-host - name: virtual-host - recommend: - - match: - - label: "node-role.kubernetes.io/worker" - priority: 10 - profile: virtual-host diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/50_hana b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/50_hana deleted file mode 100644 index 23f550efa..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/50_hana +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python3 - -import os -import sys -import traceback - -import hooking - -''' -Syntax: -hana=1 (value doesn't matter) - -The VM must be configured as High Performance with 1GB hugepages. -For that the following kernel boot line is required for the hypervisor: - -"default_hugepagesz=1GB hugepagesz=1GB hugepages=[# hugepages needed]" - -In addition the "hugepages" custom property needs to be set to 1048576. -''' - - -if 'hana' in os.environ: - try: - domxml = hooking.read_domxml() - domain = domxml.getElementsByTagName('domain')[0] - if not len(domain.getElementsByTagName('memoryBacking')): - sys.stderr.write('hugepages: VM is no High Performance VM\n') - sys.exit(0) - - if len(domain.getElementsByTagName('cpu')): - cpu = domain.getElementsByTagName('cpu')[0] - feature_tsc = domxml.createElement('feature') - feature_tsc.setAttribute('policy', 'require') - feature_tsc.setAttribute('name', 'invtsc') - feature_rdt = domxml.createElement('feature') - feature_rdt.setAttribute('policy', 'require') - feature_rdt.setAttribute('name', 'rdtscp') - feature_x2apic = domxml.createElement('feature') - feature_x2apic.setAttribute('policy', 'require') - feature_x2apic.setAttribute('name', 'x2apic') - feature_lvl3 = domxml.createElement('cache') - feature_lvl3.setAttribute('level','3') - feature_lvl3.setAttribute('mode','emulate') - cpu.appendChild(feature_tsc) - cpu.appendChild(feature_rdt) - cpu.appendChild(feature_lvl3) - cpu.appendChild(feature_x2apic) - - if len(domain.getElementsByTagName('clock')): - clock = domain.getElementsByTagName('clock')[0] - tscClock = domxml.createElement('clock') - tscClock.setAttribute('offset', 'utc') - timer = domxml.createElement('timer') - timer.setAttribute('name','tsc') - # Uncomment and adjust for live migration (adjust frequency to match the lowest value in your cluster) - #timer.setAttribute('frequency','2494140000') - tscClock.appendChild(timer) - domain.removeChild(clock) - domain.appendChild(tscClock) - - hooking.write_domxml(domxml) - except Exception: - sys.stderr.write('highperf hook: [unexpected error]: %s\n' % - traceback.format_exc()) - sys.exit(2) diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/50_iothread_pinning b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/50_iothread_pinning deleted file mode 100644 index 1a7d70d9c..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/50_iothread_pinning +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python3 - -import os -import sys -import traceback - -import hooking - -''' -Syntax: -iothread=, - -This hook will bind the iothread in RHV to the named core(s). -A maximum of 2 Cores is allowed, ideally pinned to the core (plus its hyperthread) that is bound to the Interrupt -Allowed syntax is also a range - as well as a mix. -engine-config -s UserDefinedVMProperties='iothread=^[0-9,-]+$' --cver=4.2 -''' - - -if 'iothread' in os.environ: - try: - iopin = os.environ['iothread']; - domxml = hooking.read_domxml() - domain = domxml.getElementsByTagName('domain')[0] - if len(domain.getElementsByTagName('iothreads')): - if len(domain.getElementsByTagName('iothreadids')): - iothreadids = domain.getElementsByTagName('iothreadids')[0] - else: - iothreadids = domxml.createElement('iothreadids') - domain.appendChild(iothreadids) - - if len(iothreadids.getElementsByTagName('iothread')): - ids = iothreadids.getElementsByTagName('iothread')[0] - else: - ids = domxml.createElement('iothread') - iothreadids.appendChild(ids) - ids.setAttribute('id', '1') - - if len(domain.getElementsByTagName('cputune')): - cputune = domain.getElementsByTagName('cputune')[0] - else: - cputune = domxml.createElement('cputune') - domain.appendChile(cputune) - - if len(cputune.getElementsByTagName('iothreadpin')): - iothreadpin = cputune.getElementsByTagName('iothreadpin')[0] - else: - iothreadpin = domxml.createElement('iothreadpin') - cputune.appendChild(iothreadpin) - iothreadpin.setAttribute('iothread', '1') - iothreadpin.setAttribute('cpuset', iopin) - - if len(cputune.getElementsByTagName('emulatorpin')): - emulatorpin = cputune.getElementsByTagName('emulatorpin')[0] - else: - emulatorpin = domxml.createElement('emulatorpin') - cputune.appendChild(emulatorpin) - emulatorpin.setAttribute('cpuset', iopin) - - hooking.write_domxml(domxml) - except Exception: - sys.stderr.write('iothreads hook: [unexpected error]: %s\n' % - traceback.format_exc()) - sys.exit(2) - diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/allocate-hugepages-at-runtime.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/allocate-hugepages-at-runtime.yml deleted file mode 100644 index 8c30bc771..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/allocate-hugepages-at-runtime.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -- name: Install libhugetlbfs - ansible.builtin.yum: - name: libhugetlbfs, libhugetlbfs-utils - state: present - -#XXX better location than rc.local? -- name: Add hugepage allocation to /etc/rc.local - ansible.builtin.blockinfile: - path: /etc/rc.local - marker: "" - block: | - hugeadm --create-mounts --pool-pages-min 1G:$(free -g | grep "Mem:" | awk '{print $2-"{{ sap_hypervisor_node_preconfigure_reserved_ram }}"}') - -- name: Set default hugepage size - ansible.builtin.lineinfile: - path: /etc/default/grub - backup: yes - backrefs: yes - state: present - regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ item }}).*). *$' - line: "\\1 {{ item }}\"" - with_items: - - default_hugepagesz=1GB - - hugepagesz=1GB - notify: "Regenerate grub2 conf handler" - tags: grubconfig diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-configuration.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-configuration.yml deleted file mode 100644 index f4ddb2543..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-configuration.yml +++ /dev/null @@ -1,135 +0,0 @@ ---- -# tasks file for sap_hypervisor_node_preconfigure - -- name: Get kernel command line - ansible.builtin.command: cat /proc/cmdline - register: __sap_hypervisor_node_preconfigure_kernelcmdline_assert - changed_when: __sap_hypervisor_node_preconfigure_kernelcmdline_assert.rc != 0 - -- name: "Assert - Kernel same page merging (KSM): Get status" - ansible.builtin.command: systemctl status ksm - register: __sap_hypervisor_node_preconfigure_ksmstatus_assert - ignore_errors: yes - changed_when: __sap_hypervisor_node_preconfigure_ksmstatus_assert.rc != 0 - -- name: "Assert - Kernel same page merging (KSM): Check if stopped" - ansible.builtin.assert: - that: "'Active: inactive (dead)' in __sap_hypervisor_node_preconfigure_ksmstatus_assert.stdout" - fail_msg: "FAIL: ksm is running" - success_msg: "PASS: ksm not running" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - -- name: "Assert - Kernel same page merging (KSM) Tuning Daemon: Get status" - ansible.builtin.command: systemctl status ksmtuned - register: __sap_hypervisor_node_preconfigure_ksmtunedstatus_assert - ignore_errors: yes - changed_when: __sap_hypervisor_node_preconfigure_ksmtunedstatus_assert.rc != 0 - -- name: "Assert - Kernel same page merging (KSM) Tuning Daemon: Check if stopped" - ansible.builtin.assert: - that: "'Active: inactive (dead)' in __sap_hypervisor_node_preconfigure_ksmtunedstatus_assert.stdout" - fail_msg: "FAIL: ksmtuned is running" - success_msg: "PASS: ksmtuned not running" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - -- name: Check CPU Stepping - ansible.builtin.shell: set -o pipefail && lscpu | awk '/Stepping/{print $2}' - register: __sap_hypervisor_node_preconfigure_cpu_stepping_output_assert - changed_when: __sap_hypervisor_node_preconfigure_cpu_stepping_output_assert.rc != 0 - -- name: Register stepping as fact - ansible.builtin.set_fact: - __sap_hypervisor_node_preconfigure_cpu_stepping_assert: "{{ __sap_hypervisor_node_preconfigure_cpu_stepping_output_assert.stdout }}" - -- name: Print CPU Stepping - ansible.builtin.debug: - var: __sap_hypervisor_node_preconfigure_cpu_stepping_assert - -# skylake: -- name: Assert - Check Intel Skylake CPU Platform - when: __sap_hypervisor_node_preconfigure_cpu_stepping_assert == "4" - block: - - name: Get ple_gap - ansible.builtin.command: grep -E '^options\s+kvm_intel.*?ple_gap\s*=\s*0.*$' /etc/modprobe.d/kvm.conf - register: __sap_hypervisor_node_preconfigure_skylake_plegap_assert - ignore_errors: yes - changed_when: __sap_hypervisor_node_preconfigure_skylake_plegap_assert.rc != 0 - - - name: Assert - Check if ple_gap=0 - ansible.builtin.assert: - that: "__sap_hypervisor_node_preconfigure_skylake_plegap_assert.rc == 0" - fail_msg: "FAIL: ple_gap is not set to 0" - success_msg: "PASS: ple_gap is set to 0" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - - - name: Assert - Check for spectre_v2=retpoline - ansible.builtin.assert: - that: "'spectre_v2=retpoline' in __sap_hypervisor_node_preconfigure_kernelcmdline_assert.stdout" - fail_msg: "FAIL: spectre_v2=retpoline is not on Kernel command line" - success_msg: "PASS: spectre_v2=retpoline is on Kernel command line" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - -- name: Assert - check sap_hypervisor_node_preconfigure_nx_huge_pages - when: sap_hypervisor_node_preconfigure_kvm_nx_huge_pages is defined - block: - - name: Set fact for sap_hypervisor_node_preconfigure_register_assert_nx_huge_pages - ansible.builtin.set_fact: - sap_hypervisor_node_preconfigure_register_assert_nx_huge_pages: "{{ __sap_hypervisor_node_preconfigure_kernelcmdline_assert.stdout | regex_search('kvm.nx_huge_pages=(.+)', '\\1') | first }}" - - name: "Assert - Check kvm.nx_huge_pages is {{ sap_hypervisor_node_preconfigure_kvm_nx_huge_pages }}" - ansible.builtin.assert: - that: sap_hypervisor_node_preconfigure_register_assert_nx_huge_pages == sap_hypervisor_node_preconfigure_kvm_nx_huge_pages - fail_msg: "FAIL: kvm.nx_huge_pages is not {{ sap_hypervisor_node_preconfigure_kvm_nx_huge_pages }}" - success_msg: "PASS: kvm.nx_huge_pages is {{ sap_hypervisor_node_preconfigure_kvm_nx_huge_pages }}" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - -- name: Assert - check seccomp_sandbox=0 - block: - - name: Get seccomp setting - ansible.builtin.command: grep -E '^seccomp_sandbox\s+=\s+0.*$' /etc/libvirt/qemu.conf - register: __sap_hypervisor_node_preconfigure_seccomp_assert - ignore_errors: yes - changed_when: __sap_hypervisor_node_preconfigure_seccomp_assert.rc != 0 - - - name: "Assert - Check seccomp_sandbox=0 is in /etc/libvirt/qemu.conf" - ansible.builtin.assert: - that: __sap_hypervisor_node_preconfigure_seccomp_assert is success - fail_msg: "FAIL: seccomp_sandbox != 0" - success_msg: "PASS: seccomp_sanbox == 0" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - -- name: Assert - check amount of 1G hugepages - block: - - name: Get amount of 1G hugepages - ansible.builtin.shell: set -o pipefail && hugeadm --pool-list | grep 1073741824 | awk '{print $3}' - register: __sap_hypervisor_node_preconfigure_1g_hugepages_assert - changed_when: __sap_hypervisor_node_preconfigure_1g_hugepages_assert.rc != 0 - - - name: "Check that at least {{ sap_hypervisor_node_preconfigure_reserved_ram }} GB are available for the hypervisor and the rest are 1G hugepages" - ansible.builtin.assert: - that: ((ansible_memtotal_mb / 1024) | int - sap_hypervisor_node_preconfigure_reserved_ram | int) >= (__sap_hypervisor_node_preconfigure_1g_hugepages_assert.stdout | int) - fail_msg: "FAIL: Not enough memory reserved for hypervisor" - success_msg: "PASS: Enough memory reserved for hypervisor" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - -- name: Assert - check Kernel command line - block: - - name: Ensure iommu is enabled - ansible.builtin.assert: - that: "'intel_iommu=on' in __sap_hypervisor_node_preconfigure_kernelcmdline_assert.stdout" - fail_msg: "FAIL: intel_iommu=on not on Kernel command line" - success_msg: "PASS: intel_iommu=on on Kernel command line" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - - - name: Ensure iommu passthrough is enabled - ansible.builtin.assert: - that: "'iommu=pt' in __sap_hypervisor_node_preconfigure_kernelcmdline_assert.stdout" - fail_msg: "FAIL: iommu=pt not on Kernel command line" - success_msg: "PASS: iommu=pt on Kernel command line" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - - - name: Ensure tsx is on - ansible.builtin.assert: - that: "'tsx=on' in __sap_hypervisor_node_preconfigure_kernelcmdline_assert.stdout" - fail_msg: "FAIL: tsx=on not in Kernel command line" - success_msg: "PASS: tsx=on in Kernel command line" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-installation.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-installation.yml deleted file mode 100644 index 34aa3014e..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-installation.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Gather package facts - ansible.builtin.package_facts: - -- name: Assert that all required packages are installed - ansible.builtin.assert: - that: line_item in ansible_facts.packages - fail_msg: "FAIL: Package '{{ line_item }}' is not installed!" - success_msg: "PASS: Package '{{ line_item }}' is installed." - with_items: - - "{{ sap_hypervisor_node_preconfigure_packages }}" - loop_control: - loop_var: line_item - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-rhv-hooks.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-rhv-hooks.yml deleted file mode 100644 index 4838f18fd..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-rhv-hooks.yml +++ /dev/null @@ -1,37 +0,0 @@ ---- -- name: Check file permissions - ansible.builtin.command: "stat -c%a /usr/libexec/vdsm/hooks/before_vm_start/{{ item }}" - register: __sap_hypervisor_node_preconfigure_register_file_permissions_assert - changed_when: __sap_hypervisor_node_preconfigure_register_file_permissions_assert.rc != 0 - -- name: Assert hook file permissions - ansible.builtin.assert: - that: "__sap_hypervisor_node_preconfigure_register_file_permissions_assert.stdout == '755'" - fail_msg: "FAIL: Hook {{ item }} does not have the correct file permissions (!= 755)." - success_msg: "PASS: Hook {{ item }} does have the correct file permissions (755)." - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" - -- name: Create tmp dir - ansible.builtin.file: - path: /tmp/sap_hypervisor_node_preconfigure - state: directory - mode: "0755" - -- name: Copy hook for checking - ansible.builtin.copy: - dest: "/tmp/sap_hypervisor_node_preconfigure/{{ item }}" - src: "{{ item }}" - mode: "0755" - -- name: Diff hook - ansible.builtin.command: "diff -uw /tmp/sap_hypervisor_node_preconfigure/{{ item }} /usr/libexec/vdsm/hooks/before_vm_start/{{ item }}" - register: __sap_hypervisor_node_preconfigure_register_hook_diff_assert - ignore_errors: yes - changed_when: __sap_hypervisor_node_preconfigure_register_hook_diff_assert.rc != 0 - -- name: Assert hook content - ansible.builtin.assert: - that: "__sap_hypervisor_node_preconfigure_register_hook_diff_assert.rc == 0" - fail_msg: "FAIL: Hook {{ item }} has been modified, please investigate manually." - success_msg: "PASS: Hook {{ item }} not modified" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-set-tuned-profile.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-set-tuned-profile.yml deleted file mode 100644 index ab0d0c9b3..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/assert-set-tuned-profile.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Assert - Check tuned profile - block: - - name: Get tuned profile - ansible.builtin.command: tuned-adm active - register: __sap_hypervisor_node_preconfigure_tuned_profile_assert - changed_when: __sap_hypervisor_node_preconfigure_tuned_profile_assert.rc != 0 - - - name: Verify tuned profile - ansible.builtin.assert: - that: "'Current active profile: sap-hana-kvm-host' in __sap_hypervisor_node_preconfigure_tuned_profile_assert.stdout" - fail_msg: "FAIL: tuned profile is not sap-hana-kvm-host" - success_msg: "PASS: tuned profile is sap-hana-kvm-host" - ignore_errors: "{{ sap_hypervisor_node_preconfigure_ignore_failed_assertion }}" diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/configuration.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/configuration.yml deleted file mode 100644 index b49399e4f..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/configuration.yml +++ /dev/null @@ -1,131 +0,0 @@ ---- -# tasks file for sap_hypervisor_node_preconfigure - -- name: Stop and disable kernel same page merging (KSM) - ansible.builtin.systemd: - name: ksm - state: stopped - enabled: false - -- name: Stop and disable kernel same page merging (KSM) tuning daemon - ansible.builtin.systemd: - name: ksmtuned - state: stopped - enabled: false - -- name: Check CPU Stepping - ansible.builtin.shell: set -o pipefail && lscpu | awk '/Stepping/{print $2}' - register: cpu_stepping_output - changed_when: cpu_stepping_output.rc != 0 - -- name: Register CPU stepping as fact - ansible.builtin.set_fact: - cpu_stepping: "{{ cpu_stepping_output.stdout }}" - become: true - become_user: root - -# skylake: -- name: Set ple_gap=0 on Intel Skylake CPU Platform - ansible.builtin.lineinfile: - path: /etc/modprobe.d/kvm.conf - line: options kvm_intel ple_gap=0 - when: cpu_stepping == "4" - become: true - become_user: root - -# skylake -- name: Set spectre_v2=retpoline on Intel Skylake CPU Platform - ansible.builtin.lineinfile: - path: /etc/default/grub - backup: yes - backrefs: yes - state: present - regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ item }}).*). *$' - line: "\\1 {{ item }}\"" - with_items: - - "spectre_v2=retpoline" - notify: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - tags: grubconfig - when: cpu_stepping == "4" - become: true - become_user: root - -- name: "Set kvm.nx_huge_pages to {{ sap_hypervisor_node_preconfigure_kvm_nx_huge_pages }}" - ansible.builtin.lineinfile: - path: /etc/default/grub - backup: yes - backrefs: yes - state: present - regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ item }}).*). *$' - line: "\\1 {{ item }}\"" - with_items: - - "kvm.nx_huge_pages={{ sap_hypervisor_node_preconfigure_kvm_nx_huge_pages }}" - notify: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - tags: grubconfig - when: sap_hypervisor_node_preconfigure_kvm_nx_huge_pages is defined - become: true - become_user: root - -- name: Set seccomp_sanbox=0 - ansible.builtin.lineinfile: - path: /etc/libvirt/qemu.conf - backup: yes - backrefs: yes - state: present - regexp: 'seccomp_sandbox' - line: "seccomp_sandbox = 0" - become: true - become_user: root - -- name: Include allocate hughepages at runtime - ansible.builtin.include_tasks: allocate-hugepages-at-runtime.yml - when: sap_hypervisor_node_preconfigure_reserve_hugepages == "runtime" - -- name: Reserve Hugepages statically - ansible.builtin.lineinfile: - path: /etc/default/grub - backup: yes - backrefs: yes - state: present - regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ item }}).*). *$' - line: "\\1 {{ item }}\"" - with_items: - - default_hugepagesz=1GB - - hugepagesz=1GB - - hugepages={{ (ansible_memtotal_mb / 1024) | int - sap_hypervisor_node_preconfigure_reserved_ram }} - notify: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - tags: grubconfig - when: sap_hypervisor_node_preconfigure_reserve_hugepages == "static" - become: true - become_user: root - -- name: Enable IOMMU PT - ansible.builtin.lineinfile: - path: /etc/default/grub - backup: yes - backrefs: yes - state: present - regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ item }}).*). *$' - line: "\\1 {{ item }}\"" - with_items: - - intel_iommu=on - - iommu=pt - notify: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - tags: grubconfig - become: true - become_user: root - -- name: Enable TSX - ansible.builtin.lineinfile: - path: /etc/default/grub - backup: yes - backrefs: yes - state: present - regexp: '^(GRUB_CMDLINE_LINUX=(?!.* {{ item }}).*). *$' - line: "\\1 {{ item }}\"" - with_items: - - "tsx={{ sap_hypervisor_node_preconfigure_tsx }}" - notify: __sap_hypervisor_node_preconfigure_regenerate_grub2_conf_handler - tags: grubconfig - become: true - become_user: root diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/installation.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/installation.yml deleted file mode 100644 index c38cf3aba..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/installation.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- name: Ensure required packages are installed - ansible.builtin.package: - state: present - name: "{{ sap_hypervisor_node_preconfigure_packages }}" - become: true - become_user: root diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/main.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/main.yml deleted file mode 100644 index dd405a44b..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/main.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -- name: Display sap_hypervisor_node_preconfigure_assert - ansible.builtin.debug: - var: sap_hypervisor_node_preconfigure_assert - -- name: Set filename prefix to empty string if role is run in normal mode - ansible.builtin.set_fact: - assert_prefix: "" - -- name: Prepend filename with assert string if role is run in assert mode - ansible.builtin.set_fact: - assert_prefix: "assert-" - when: sap_hypervisor_node_preconfigure_assert - -- name: Include "{{ assert_prefix }}installation.yml" - ansible.builtin.include_tasks: '{{ assert_prefix }}installation.yml' - -- name: Include "{{ assert_prefix }}configuration.yml" - ansible.builtin.include_tasks: '{{ assert_prefix }}configuration.yml' - -- name: Include "{{ assert_prefix }}set-tuned-profile.yml" - ansible.builtin.include_tasks: '{{ assert_prefix }}set-tuned-profile.yml' - -- name: Include "{{ assert_prefix }}rhv-hooks.yml" - ansible.builtin.include_tasks: "{{ assert_prefix }}rhv-hooks.yml" - loop: - - 50_hana - - 50_iothread_pinning diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/rhv-hooks.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/rhv-hooks.yml deleted file mode 100644 index ee0d63a8d..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/rhv-hooks.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -- name: Create hook dir - ansible.builtin.file: - path: /usr/libexec/vdsm/hooks/before_vm_start - state: directory - mode: "0755" - become: true - become_user: root - -- name: Copy hook - ansible.builtin.copy: - dest: "/usr/libexec/vdsm/hooks/before_vm_start/{{ item }}" - src: "{{ item }}" - mode: "0755" - become: true - become_user: root diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/set-tuned-profile.yml b/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/set-tuned-profile.yml deleted file mode 100644 index 91c3d7757..000000000 --- a/roles/sap_hypervisor_node_preconfigure/tasks/platform/redhat_rhel_kvm/set-tuned-profile.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -- name: Create tuned profile directory /usr/lib/tuned/sap-hana-kvm-host - ansible.builtin.file: - path: /usr/lib/tuned/sap-hana-kvm-host - state: directory - mode: "0755" - become: true - become_user: root - -- name: Create sap-hana-kvm-host tuned profile - ansible.builtin.copy: - dest: "/usr/lib/tuned/sap-hana-kvm-host/tuned.conf" - mode: "0644" - content: | - # - # tuned configuration - # - [main] - summary=Optimize for running as KVM host for SAP HANA as virtual guest - include=throughput-performance - - [sysctl] - # Start background writeback (via writeback threads) at this percentage (system - # default is 10%) - vm.dirty_background_ratio = 5 - - # The total time the scheduler will consider a migrated process - # "cache hot" and thus less likely to be re-migrated - # (system default is 500000, i.e. 0.5 ms) - kernel.sched_migration_cost_ns = 5000000 - - [cpu] - # Setting C3 state sleep mode/power savings on X86 - # and force_latency=70 on Power - force_latency=cstate.id:3|70 - become: true - become_user: root - -- name: Activate tuned profile - ansible.builtin.command: tuned-adm profile sap-hana-kvm-host - register: __sap_hypervisor_node_preconfigre_register_tuned_activation_output - become: true - become_user: root - changed_when: __sap_hypervisor_node_preconfigre_register_tuned_activation_output.rc != 0 diff --git a/roles/sap_hypervisor_node_preconfigure/tasks/platform/vmware_vsphere/.gitkeep b/roles/sap_hypervisor_node_preconfigure/tasks/platform/vmware_vsphere/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_hypervisor_node_preconfigure/vars/main.yml b/roles/sap_hypervisor_node_preconfigure/vars/main.yml deleted file mode 100644 index ed97d539c..000000000 --- a/roles/sap_hypervisor_node_preconfigure/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_ocp_virt.yml b/roles/sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_ocp_virt.yml deleted file mode 100644 index 8cc402c9a..000000000 --- a/roles/sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_ocp_virt.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# vars file for sap_hypervisor_node_preconfigure -# - -# Install and configure the host path provisioner (hpp) for a local storage disk -sap_hypervisor_node_preconfigure_install_hpp: False - -# Install the trident NFS storage provider -sap_hypervisor_node_preconfigure_install_trident: False -# URL of the trident installer package to use -sap_hypervisor_node_preconfigure_install_trident_url: https://github.com/NetApp/trident/releases/download/v23.01.0/trident-installer-23.01.0.tar.gz - -# should SRIOV be enabled for unsupported NICs -sap_hypervisor_node_preconfigure_sriov_enable_unsupported_nics: True - -# Amount of memory [GiB] to be reserved for the hypervisor on hosts >= 512GiB -sap_hypervisor_node_preconfigure_hypervisor_reserved_ram_host_ge_512: 64 #GiB -# Amount of memory [GiB] to be reserved for the hypervisor on hosts < 512GiB -sap_hypervisor_node_preconfigure_hypervisor_reserved_ram_host_lt_512: 32 #GiB - -# Should the check for the minimal amount of be ignored? Minimal amount is 96 GiB -sap_hypervisor_node_preconfigure_ignore_minimal_memory_check: False - -# Should the operators be installed -sap_hypervisor_node_preconfigure_install_operators: True - -# Configure the workers? -sap_hypervisor_node_preconfigure_setup_workers: True diff --git a/roles/sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_rhel_kvm.yml b/roles/sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_rhel_kvm.yml deleted file mode 100644 index fb02f0bbc..000000000 --- a/roles/sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_rhel_kvm.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- - -# defaults file for sap_hypervisor_node_preconfigure - -# packages to install -sap_hypervisor_node_preconfigure_packages: - - libhugetlbfs-utils - - qemu-kvm - - libvirt - - tuned - -# is it okay to reboot host? -sap_hypervisor_node_preconfigure_reboot_ok: true - -# should the role fail if a reboot is required -sap_hypervisor_node_preconfigure_fail_if_reboot_required: false - -# recreate kernel command line with grub2-mkconfig -sap_hypervisor_node_preconfigure_run_grub2_mkconfig: yes - -# Reserve memory [GB] for hypervisor host -sap_hypervisor_node_preconfigure_reserved_ram: 100 - -# allocate hugepages: {static|runtime} -# static: done at kernel command line which is slow, but safe -# runtime: done through tuned-profile -sap_hypervisor_node_preconfigure_reserve_hugepages: static - -# kvm.nx_huge_pages: {"auto"|"on"|"off"} -# Note the importance of the quotes, otherwise off will be mapped to false -sap_hypervisor_node_preconfigure_kvm_nx_huge_pages: "auto" - -# Intel Transactional Synchronization Extensions (TSX): {"on"|"off"} -# Note the importance of the quotes, otherwise off will be mapped to false -sap_hypervisor_node_preconfigure_tsx: "on" - -# fail if assertion is invalid -sap_hypervisor_node_preconfigure_ignore_failed_assertion: no diff --git a/roles/sap_vm_preconfigure/.ansible-lint b/roles/sap_vm_preconfigure/.ansible-lint deleted file mode 100644 index 8a5df4d43..000000000 --- a/roles/sap_vm_preconfigure/.ansible-lint +++ /dev/null @@ -1,16 +0,0 @@ ---- -exclude_paths: - - tests/ -enable_list: - - yaml -skip_list: - # We don't want to enforce new Ansible versions for Galaxy: - - meta-runtime[unsupported-version] - # We do not want to use checks which are marked as experimental: - - experimental - # We use ignore_errors for all the assert tasks, which should be acceptable: - - ignore-errors - # We want to allow single digit version numbers in a role's meta/main.yml file: - - schema - # Allow templating inside name because it creates more detailed output: - - name[template] diff --git a/roles/sap_vm_preconfigure/.yamllint.yml b/roles/sap_vm_preconfigure/.yamllint.yml deleted file mode 100644 index 57ef427c1..000000000 --- a/roles/sap_vm_preconfigure/.yamllint.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -# Based on ansible-lint config -extends: default - -rules: - braces: {max-spaces-inside: 1, level: error} - brackets: {max-spaces-inside: 1, level: error} -# colons: {max-spaces-after: -1, level: error} -# commas: {max-spaces-after: -1, level: error} - comments: disable - comments-indentation: disable -# document-start: disable -# empty-lines: {max: 3, level: error} -# hyphens: {level: error} -# indentation: disable -# key-duplicates: enable - line-length: disable -# new-line-at-end-of-file: disable -# new-lines: {type: unix} -# trailing-spaces: disable - truthy: disable diff --git a/roles/sap_vm_preconfigure/README.md b/roles/sap_vm_preconfigure/README.md deleted file mode 100644 index c6dafdeab..000000000 --- a/roles/sap_vm_preconfigure/README.md +++ /dev/null @@ -1,70 +0,0 @@ -`EXPERIMENTAL` - -sap_vm_preconfigure -================== - -This role will set and check the required settings and parameters for a guest (VM) running on RHV/KVM for SAP HANA. - - -Requirements ------------- - -VM with at least RHEL 8.2 installed. -The roles sap_preconfigure and sap_hana_preconfigure have been run on that system. - - -Role Variables --------------- - -### Run the role in assert mode -```yaml -sap_vm_preconfigure_assert (default: no) -``` -If the following variable is set to `yes`, the role will only check if the configuration of the managed mmachines is according to this role. Default is `no`. - - -### Behavior of the role in assert mode -```yaml -sap_vm_preconfigure_assert_ignore_errors (default: no) -``` -If the role is run in assert mode and the following variable is set to `yes`, assertion errors will not cause the role to fail. This can be useful for creating reports. -Default is `no`, meaning that the role will fail for any assertion error which is discovered. This variable has no meaning if the role is not run in assert mode. - - - -Dependencies ------------- - -The roles [sap_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_preconfigure) and [sap_hana_preconfigure](https://github.com/sap-linuxlab/community.sap_install/tree/main/roles/sap_hana_preconfigure). - - -Example Playbook ----------------- - -Simple example that just sets the parameters. -``` -- hosts: all - roles: - - sap_preconfigure - - sap_hana_preconfigure - - sap_vm_preconfigure -``` - -Run in assert mode to verify that parameters have been set. -``` -- hosts: all - roles: - - sap_vm_preconfigure - vars: - - sap_vm_preconfigure_assert: yes -``` - -License -------- - -Apache-2.0 - -Author Information ------------------- - -Nils Koenig (nkoenig@redhat.com) diff --git a/roles/sap_vm_preconfigure/defaults/main.yml b/roles/sap_vm_preconfigure/defaults/main.yml deleted file mode 100644 index 45de6c6fc..000000000 --- a/roles/sap_vm_preconfigure/defaults/main.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -# For setting Ansible Var sap_vm_platform, unless overridden -sap_vm_platform_detect: false - -# For reuse of this Ansible Role to establish which platform, without running any of the preconfigure Ansible Tasks for that platform -sap_vm_platform_detect_only: false - -# Static definition, required if detection boolean is set to false -# cloud_aliyun_ecs_vm, cloud_aws_ec2_vs, cloud_gcp_ce_vm, cloud_ibmcloud_powervs, cloud_ibmcloud_vs, cloud_msazure_vm, hyp_ibmpower_lpar, hyp_redhat_ocp_virt_vm, hyp_redhat_rhel_kvm_vm, hyp_vmware_vsphere_vm -sap_vm_platform: diff --git a/roles/sap_vm_preconfigure/files/platform/cloud_aliyun_ecs_vm/.gitkeep b/roles/sap_vm_preconfigure/files/platform/cloud_aliyun_ecs_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/cloud_aws_ec2_vs/.gitkeep b/roles/sap_vm_preconfigure/files/platform/cloud_aws_ec2_vs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/cloud_gcp_ce_vm/.gitkeep b/roles/sap_vm_preconfigure/files/platform/cloud_gcp_ce_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/cloud_ibmcloud_powervs/.gitkeep b/roles/sap_vm_preconfigure/files/platform/cloud_ibmcloud_powervs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/cloud_ibmcloud_vs/.gitkeep b/roles/sap_vm_preconfigure/files/platform/cloud_ibmcloud_vs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/cloud_msazure_vm/.gitkeep b/roles/sap_vm_preconfigure/files/platform/cloud_msazure_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/ibmpower_lpar/.gitkeep b/roles/sap_vm_preconfigure/files/platform/ibmpower_lpar/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/redhat_ocp_virt_vm/.gitkeep b/roles/sap_vm_preconfigure/files/platform/redhat_ocp_virt_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana-kvm-guest/haltpoll.sh b/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana-kvm-guest/haltpoll.sh deleted file mode 100644 index e2a14ed3a..000000000 --- a/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana-kvm-guest/haltpoll.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [ "$1" == "start" ]; then - modprobe cpuidle-haltpoll force -fi - -## Question: Does this also need another "if" checking to see if $1 is "stop" to unload the module? diff --git a/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana-kvm-guest/tuned.conf b/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana-kvm-guest/tuned.conf deleted file mode 100644 index 82ad6af4c..000000000 --- a/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana-kvm-guest/tuned.conf +++ /dev/null @@ -1,24 +0,0 @@ -# -# tuned configuration -# -[main] -summary=Optimize for running SAP HANA on KVM inside a virtual guest -include=sap-hana - -[haltpoll] -type=script -script=${i:PROFILE_DIR}/haltpoll.sh - -[sysfs] -/sys/devices/system/clocksource/clocksource0/current_clocksource=tsc -/sys/module/haltpoll/parameters/guest_halt_poll_ns=2400000 -/sys/module/haltpoll/parameters/guest_halt_poll_grow_start=2400000 - -[sysctl] -kernel.sched_latency_ns=12000000 -kernel.sched_migration_cost_ns=500000 -kernel.sched_min_granularity_ns=12000000 -kernel.sched_wakeup_granularity_ns=15000000 - -[bootloader] -cmdline_saphana=skew_tick=1 diff --git a/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana/tuned.conf b/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana/tuned.conf deleted file mode 100644 index ba688f97a..000000000 --- a/roles/sap_vm_preconfigure/files/platform/redhat_rhel_kvm_vm/tuned/sap-hana/tuned.conf +++ /dev/null @@ -1,24 +0,0 @@ -# -# tuned configuration -# -[main] -summary=Optimize for SAP HANA - -[cpu] -force_latency=cstate.id:3|70 -governor=performance -energy_perf_bias=performance -min_perf_pct=100 - -[vm] -transparent_hugepages=never - -[sysctl] -kernel.sem = 32000 1024000000 500 32000 -kernel.numa_balancing = 0 -kernel.sched_min_granularity_ns = 3000000 -kernel.sched_wakeup_granularity_ns = 4000000 -vm.dirty_ratio = 40 -vm.dirty_background_ratio = 10 -vm.swappiness = 10 - diff --git a/roles/sap_vm_preconfigure/files/platform/vmware_vsphere_vm/.gitkeep b/roles/sap_vm_preconfigure/files/platform/vmware_vsphere_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/main.yml b/roles/sap_vm_preconfigure/handlers/main.yml deleted file mode 100644 index c3d3be107..000000000 --- a/roles/sap_vm_preconfigure/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- - -- name: SAP virtual machine preconfigure - Include Handler Tasks for {{ sap_vm_platform }} - ansible.builtin.include_tasks: "{{ role_path }}/handlers/platform/{{ sap_vm_platform }}/main.yml" diff --git a/roles/sap_vm_preconfigure/handlers/platform/cloud_aliyun_ecs_vm/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/cloud_aliyun_ecs_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/cloud_aws_ec2_vs/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/cloud_aws_ec2_vs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/cloud_gcp_ce_vm/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/cloud_gcp_ce_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/cloud_ibmcloud_powervs/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/cloud_ibmcloud_powervs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/cloud_ibmcloud_vs/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/cloud_ibmcloud_vs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/cloud_msazure_vm/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/cloud_msazure_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/ibmpower_lpar/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/ibmpower_lpar/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/redhat_ocp_virt_vm/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/redhat_ocp_virt_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/handlers/platform/redhat_rhel_kvm_vm/main.yml b/roles/sap_vm_preconfigure/handlers/platform/redhat_rhel_kvm_vm/main.yml deleted file mode 100644 index 4a89b9f84..000000000 --- a/roles/sap_vm_preconfigure/handlers/platform/redhat_rhel_kvm_vm/main.yml +++ /dev/null @@ -1,94 +0,0 @@ ---- - -- name: "Check if server is booted in BIOS or UEFI mode" - stat: - path: /sys/firmware/efi - get_checksum: no - register: __sap_vm_preconfigure_register_stat_sys_firmware_efi - listen: __sap_vm_preconfigure_regenerate_grub2_conf_handler - when: - - sap_vm_preconfigure_run_grub2_mkconfig|d(true) - -- name: Debug BIOS or UEFI - debug: - var: __sap_vm_preconfigure_register_stat_sys_firmware_efi.stat.exists - listen: __sap_vm_preconfigure_regenerate_grub2_conf_handler - when: - - sap_vm_preconfigure_run_grub2_mkconfig|d(true) - -- name: "Run grub-mkconfig (BIOS mode)" - command: grub2-mkconfig -o /boot/grub2/grub.cfg - register: __sap_vm_preconfigure_register_grub2_mkconfig_bios_mode - listen: __sap_vm_preconfigure_regenerate_grub2_conf_handler - notify: __sap_vm_preconfigure_reboot_handler - when: - - not __sap_vm_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_vm_preconfigure_run_grub2_mkconfig|d(true) - -- name: "Debug grub-mkconfig BIOS mode" - debug: - var: __sap_vm_preconfigure_register_grub2_mkconfig_bios_mode.stdout_lines, - __sap_vm_preconfigure_register_grub2_mkconfig_bios_mode.stderr_lines - listen: __sap_vm_preconfigure_regenerate_grub2_conf_handler - when: - - not __sap_vm_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_vm_preconfigure_run_grub2_mkconfig|d(true) - -- name: "Set the grub.cfg location RHEL" - set_fact: - __sap_vm_preconfigure_uefi_boot_dir: /boot/efi/EFI/redhat/grub.cfg - when: - - ansible_distribution == 'RedHat' - -- name: "Set the grub.cfg location SLES" - set_fact: - __sap_vm_preconfigure_uefi_boot_dir: /boot/efi/EFI/BOOT/grub.cfg - when: - - ansible_distribution == 'SLES' or ansible_distribution == 'SLES_SAP' - -- name: "Run grub-mkconfig (UEFI mode)" - command: "grub2-mkconfig -o {{ __sap_vm_preconfigure_uefi_boot_dir }}" - register: __sap_vm_preconfigure_register_grub2_mkconfig_uefi_mode - listen: __sap_vm_preconfigure_regenerate_grub2_conf_handler - notify: __sap_vm_preconfigure_reboot_handler - when: - - __sap_vm_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_vm_preconfigure_run_grub2_mkconfig|d(true) - -- name: "Debug grub-mkconfig UEFI" - debug: - var: __sap_vm_preconfigure_register_grub2_mkconfig_uefi_mode.stdout_lines, - __sap_vm_preconfigure_register_grub2_mkconfig_uefi_mode.stderr_lines - listen: __sap_vm_preconfigure_regenerate_grub2_conf_handler - when: - - __sap_vm_preconfigure_register_stat_sys_firmware_efi.stat.exists - - sap_vm_preconfigure_run_grub2_mkconfig|d(true) - -- name: "Run grubby for enabling TSX" - command: grubby --args="tsx=on" --update-kernel=ALL - register: __sap_vm_preconfigure_register_grubby_update - listen: __sap_vm_preconfigure_grubby_update_handler - notify: __sap_vm_preconfigure_reboot_handler - -- name: Reboot the managed node - reboot: - test_command: /bin/true - listen: __sap_vm_preconfigure_reboot_handler - when: - - sap_vm_preconfigure_reboot_ok|d(false) - -- name: Let the role fail if a reboot is required - fail: - msg: Reboot is required! - listen: __sap_vm_preconfigure_reboot_handler - when: - - sap_vm_preconfigure_fail_if_reboot_required|d(true) - - not sap_vm_preconfigure_reboot_ok|d(false) - -- name: Show a warning message if a reboot is required - debug: - msg: "WARN: Reboot is required!" - listen: __sap_vm_preconfigure_reboot_handler - when: - - not sap_vm_preconfigure_fail_if_reboot_required|d(true) - - not sap_vm_preconfigure_reboot_ok|d(false) diff --git a/roles/sap_vm_preconfigure/handlers/platform/vmware_vsphere_vm/.gitkeep b/roles/sap_vm_preconfigure/handlers/platform/vmware_vsphere_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/meta/main.yml b/roles/sap_vm_preconfigure/meta/main.yml deleted file mode 100644 index 8078ca342..000000000 --- a/roles/sap_vm_preconfigure/meta/main.yml +++ /dev/null @@ -1,10 +0,0 @@ ---- -galaxy_info: - namespace: community - role_name: sap_vm_preconfigure - author: Nils Koenig - description: Provide the configuration of Virtual Machines running on SAP certified Cloud IaaS or SAP certified Hypervisors - license: Apache-2.0 - min_ansible_version: 2.9 - galaxy_tags: [ 'sap', 'hana', 'rhel', 'redhat', 'sles', 'suse' ] -dependencies: [] diff --git a/roles/sap_vm_preconfigure/tasks/detect_platform/main.yml b/roles/sap_vm_preconfigure/tasks/detect_platform/main.yml deleted file mode 100644 index ee7161ce1..000000000 --- a/roles/sap_vm_preconfigure/tasks/detect_platform/main.yml +++ /dev/null @@ -1,131 +0,0 @@ ---- -# Platform detection for cloud and other infrastructure platforms. - -### Facts already available to Ansible -# -### Amazon Web Services EC2 Virtual Server. Not applicable for AWS Classic. -# ansible_chassis_asset_tag: "Amazon EC2" # SMBIOS Chassis Asset Tag -# ansible_board_asset_tag: "i-043d3c1a889ed9016" # SMBIOS Baseboard Asset Tag, ID of virtual machine on platform -# ansible_chassis_vendor: "Amazon EC2" -# ansible_product_name: "r5.8xlarge" # IaaS profile name -# ansible_system_vendor: "Amazon EC2" -# -### Google Cloud Compute Engine Virtual Machine. -# ansible_chassis_asset_tag: "NA" # SMBIOS Chassis Asset Tag -# ansible_board_asset_tag: "9EAF3038-7EF5-3F1E-6620-FB3BDA7A3709" # SMBIOS Baseboard Asset Tag, ID of virtual machine on platform -# ansible_chassis_vendor: "Google" -# ansible_product_name: "Google Compute Engine" -# ansible_system_vendor: "Google" -# -### IBM Cloud Virtual Server. Not applicable for IBM Cloud Classic Infrastructure. -# ansible_chassis_asset_tag: "ibmcloud" # SMBIOS Chassis Asset Tag -# ansible_board_asset_tag: "0c7d4459-xxxx-yyyy-zzzz-abcdefghijkl" # SMBIOS Baseboard Asset Tag, ID of virtual machine on platform -# ansible_chassis_vendor: "IBM:Cloud Compute Server 1.0:mx2-16x128" # IaaS profile name -# ansible_product_name: "Standard PC (i440FX + PIIX, 1996)" -# ansible_system_vendor: "QEMU" -# -### Microsoft Azure Virtual Machine. Not applicable for MS Azure Classic/ASM. -# ansible_chassis_asset_tag: "7783-xxxx-yyyy-zzzz-aaaa-bbbb-cc" # SMBIOS Chassis Asset Tag -# ansible_board_asset_tag: "None" # SMBIOS Baseboard Asset Tag -# ansible_chassis_vendor: "Virtual Machine" -# ansible_product_name: "Microsoft Corporation" -# ansible_system_vendor: "70f4a858-1eea-4c35-b9e1-e179c32fc6b5" # ID of virtual machine on platform -# -### VMware vSphere -# ansible_product_name: "VMware7,1", -# ansible_system_vendor: "VMware, Inc.", -# ansible_virtualization_type: "VMware" -# -### End of comment - - -# TODO: detection based on multiple facts and providing one standard -# name for use as platform type in related include files -# cloud_aliyun_ecs_vm, cloud_aws_ec2_vs, cloud_gcp_ce_vm, cloud_ibmcloud_powervs, cloud_ibmcloud_vs, cloud_msazure_vm, -# hyp_ibmpower_lpar, hyp_redhat_ocp_virt_vm, hyp_redhat_rhel_kvm_vm, hyp_vmware_vsphere_vm - -- name: "SAP VM Preconfigure - Check if platform is Amazon Web Services EC2 Virtual Server" - when: - - ansible_system_vendor == 'Amazon EC2' - ansible.builtin.set_fact: - sap_vm_platform: cloud_aws_ec2_vs - -# - name: "SAP VM Preconfigure - Check if platform is Google Cloud Compute Engine Virtual Machine" -# when: -# - ansible_product_name == 'Google Compute Engine' -# ansible.builtin.set_fact: -# sap_vm_platform: cloud_gcp_ce_vm - -- name: "SAP VM Preconfigure - Check if platform is IBM Cloud Virtual Server" - when: - - ansible_chassis_asset_tag == 'ibmcloud' - ansible.builtin.set_fact: - sap_vm_platform: cloud_ibmcloud_vs - -# - name: "SAP VM Preconfigure - Check if platform is Microsoft Azure Virtual Machine" -# when: -# - ansible_chassis_vendor == 'Virtual Machine' -# - ansible_product_name == 'Microsoft Corporation' -# ansible.builtin.set_fact: -# sap_vm_platform: cloud_msazure_vm - -# - name: "SAP VM Preconfigure - Check if platform is VMware vSphere" -# when: -# - ansible_virtualization_type == 'VMware' -# ansible.builtin.set_fact: -# sap_vm_platform: hyp_vmware_vsphere_vm - - -- name: SAP VM Preconfigure - confirm AWS EC2 Virtual Server - when: sap_vm_platform == cloud_aws_ec2_vs - block: - - - name: (AWS) Get instance metadata token - ansible.builtin.uri: - headers: - X-aws-ec2-metadata-token-ttl-seconds: 21600 - method: PUT - return_content: true - url: http://169.254.169.254/latest/api/token - register: detect_cloud_provider_aws_token - changed_when: false - ignore_errors: true - - - name: (AWS) Get instance metadata ami-id - ansible.builtin.uri: - headers: - X-aws-ec2-metadata-token: "{{ detect_cloud_provider_aws_token.content }}" - method: GET - return_content: true - url: http://169.254.169.254/latest/meta-data/ami-id - register: detect_cloud_provider_aws_ami_id - changed_when: false - ignore_errors: true - - - name: (AWS) Fail if cannot reach Instance Metadata Service - ansible.builtin.fail: - msg: Detected MS Azure, but could not confirm with the Instance Metadata Service - when: - - detect_cloud_provider_aws_ami_id.failed - - -- name: SAP VM Preconfigure - confirm Microsoft Azure Virtual Machine - when: sap_vm_platform == cloud_msazure_vm - block: - - - name: (Azure) Get instance metadata - ansible.builtin.uri: - headers: - Metadata: true - method: GET - url: http://169.254.169.254/metadata/instance/compute?api-version=2021-10-01 - register: detect_cloud_provider_azure_instance_metadata - changed_when: false - ignore_errors: true - - - name: (Azure) Fail if cannot reach Instance Metadata Service - ansible.builtin.fail: - msg: Detected MS Azure, but could not confirm with the Instance Metadata Service - when: - - detect_cloud_provider_azure_instance_metadata.json.azEnvironment is not defined - - detect_cloud_provider_azure_instance_metadata.json.azEnvironment != "AzurePublicCloud" diff --git a/roles/sap_vm_preconfigure/tasks/main.yml b/roles/sap_vm_preconfigure/tasks/main.yml deleted file mode 100644 index 3beaf778d..000000000 --- a/roles/sap_vm_preconfigure/tasks/main.yml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -- name: SAP virtual machine detect platform - ansible.builtin.include_tasks: "{{ role_path }}/tasks/detect_platform/main.yml" - when: sap_vm_platform_detect or sap_vm_platform_detect_only - -- name: SAP virtual machine preconfigure - Include Defaults Vars for {{ sap_vm_platform }} - ansible.builtin.include_vars: "{{ role_path }}/vars/platform_defaults_{{ sap_vm_platform }}.yml" - when: not sap_vm_platform_detect_only - -- name: SAP virtual machine preconfigure - Include Tasks for {{ sap_vm_platform }} - ansible.builtin.include_tasks: "{{ role_path }}/tasks/platform/{{ sap_vm_platform }}/main.yml" - when: not sap_vm_platform_detect_only diff --git a/roles/sap_vm_preconfigure/tasks/platform/cloud_aliyun_ecs_vm/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/cloud_aliyun_ecs_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/cloud_aws_ec2_vs/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/cloud_aws_ec2_vs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/cloud_gcp_ce_vm/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/cloud_gcp_ce_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/cloud_ibmcloud_powervs/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/cloud_ibmcloud_powervs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/cloud_ibmcloud_vs/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/cloud_ibmcloud_vs/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/cloud_msazure_vm/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/cloud_msazure_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/hyp_ibmpower_lpar/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/hyp_ibmpower_lpar/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_ocp_virt_vm/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_ocp_virt_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/assert-set-tuned-profile.yml b/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/assert-set-tuned-profile.yml deleted file mode 100644 index 720fa49f7..000000000 --- a/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/assert-set-tuned-profile.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Assert - Check tuned profile - block: - - name: Get tuned profile - ansible.builtin.command: tuned-adm active - register: __sap_vm_preconfigure_register_tuned_profile_assert - changed_when: __sap_vm_preconfigure_register_tuned_profile_assert.rc != 0 - - - name: Verify tuned profile - ansible.builtin.assert: - that: "'Current active profile: sap-hana-kvm-host' in __sap_vm_preconfigure_register_tuned_profile_assert.stdout" - fail_msg: "FAIL: tuned profile is not sap-hana-kvm-guest" - success_msg: "PASS: tuned profile is sap-hana-kvm-guest" - ignore_errors: "{{ sap_vm_preconfigure_ignore_failed_assertion }}" diff --git a/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/main.yml b/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/main.yml deleted file mode 100644 index 26a234fdb..000000000 --- a/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/main.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# tasks file for sap_vm_preconfigure - -- name: Trigger tuned profile sap-hana-kvm-guest activation - ansible.builtin.include_tasks: set-tuned-profile.yml - -- name: Set filename prefix to empty string if role is run in normal mode - ansible.builtin.set_fact: - __sap_vm_preconfigure_fact_assert_prefix: "" - when: not sap_vm_preconfigure_assert|d(false) - -- name: Prepend filename with assert string if role is run in assert mode - ansible.builtin.set_fact: - __sap_vm_preconfigure_fact_assert_prefix: "assert-" - when: sap_hypervisor_node_preconfigure_assert|d(false) - -- name: Include '{{ __sap_vm_preconfigure_fact_assert_prefix }}set-tuned-profile.yml' - ansible.builtin.include_tasks: '{{ __sap_vm_preconfigure_fact_assert_prefix }}set-tuned-profile.yml' diff --git a/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/set-tuned-profile.yml b/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/set-tuned-profile.yml deleted file mode 100644 index 080f207c3..000000000 --- a/roles/sap_vm_preconfigure/tasks/platform/hyp_redhat_rhel_kvm_vm/set-tuned-profile.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -- name: Create tuned profile directory /usr/lib/tuned/sap-hana - ansible.builtin.file: - path: /usr/lib/tuned/sap-hana - state: directory - mode: "0755" - -- name: Create sap-hana tuned profile - ansible.builtin.copy: - dest: "/usr/lib/tuned/sap-hana/tuned.conf" - mode: "0644" - content: | - # - # tuned configuration - # - [main] - summary=Optimize for SAP HANA - - [cpu] - force_latency=cstate.id:3|70 - governor=performance - energy_perf_bias=performance - min_perf_pct=100 - - [vm] - transparent_hugepages=never - - [sysctl] - kernel.sem = 32000 1024000000 500 32000 - kernel.numa_balancing = 0 - kernel.sched_min_granularity_ns = 3000000 - kernel.sched_wakeup_granularity_ns = 4000000 - vm.dirty_ratio = 40 - vm.dirty_background_ratio = 10 - vm.swappiness = 10 - - -- name: Create tuned profile directory /usr/lib/tuned/sap-hana-kvm-guest - ansible.builtin.file: - path: /usr/lib/tuned/sap-hana-kvm-guest - mode: "0755" - state: directory - -- name: Add haltpoll.sh for tuned sap-hana-kvm-guest - ansible.builtin.copy: - dest: "/usr/lib/tuned/sap-hana-kvm-guest/haltpoll.sh" - mode: "0744" - content: | - #!/bin/bash - - if [ "$1" == "start" ]; then - modprobe cpuidle-haltpoll force - fi - - ## Question: Does this also need another "if" checking to see if $1 is "stop" to unload the module? - - -- name: Create sap-hana-kvm-guest tuned profile - ansible.builtin.copy: - dest: "/usr/lib/tuned/sap-hana-kvm-guest/tuned.conf" - mode: "0644" - content: | - # - # tuned configuration - # - [main] - summary=Optimize for running SAP HANA on KVM inside a virtual guest - include=sap-hana - - [haltpoll] - type=script - script=${i:PROFILE_DIR}/haltpoll.sh - - [sysfs] - /sys/devices/system/clocksource/clocksource0/current_clocksource=tsc - /sys/module/haltpoll/parameters/guest_halt_poll_ns=2400000 - /sys/module/haltpoll/parameters/guest_halt_poll_grow_start=2400000 - - [sysctl] - kernel.sched_latency_ns=12000000 - kernel.sched_migration_cost_ns=500000 - kernel.sched_min_granularity_ns=12000000 - kernel.sched_wakeup_granularity_ns=15000000 - - [bootloader] - cmdline_saphana=skew_tick=1 - -- name: Activate tuned profile - ansible.builtin.command: tuned-adm profile sap-hana-kvm-guest - register: __sap_provision_vm_register_tuned_sap_hana_kvm_guest_status - changed_when: __sap_provision_vm_register_tuned_sap_hana_kvm_guest_status.rc != 0 diff --git a/roles/sap_vm_preconfigure/tasks/platform/hyp_vmware_vsphere_vm/.gitkeep b/roles/sap_vm_preconfigure/tasks/platform/hyp_vmware_vsphere_vm/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/roles/sap_vm_preconfigure/vars/main.yml b/roles/sap_vm_preconfigure/vars/main.yml deleted file mode 100644 index ed97d539c..000000000 --- a/roles/sap_vm_preconfigure/vars/main.yml +++ /dev/null @@ -1 +0,0 @@ ---- diff --git a/roles/sap_vm_preconfigure/vars/platform_defaults_redhat_rhel_kvm.yml b/roles/sap_vm_preconfigure/vars/platform_defaults_redhat_rhel_kvm.yml deleted file mode 100644 index db93406e4..000000000 --- a/roles/sap_vm_preconfigure/vars/platform_defaults_redhat_rhel_kvm.yml +++ /dev/null @@ -1,11 +0,0 @@ ---- - -# defaults file for sap_vm_preconfigure - -sap_vm_preconfigure_run_grub2_mkconfig: yes - -# run role in assert mode? -sap_vm_preconfigure_assert: false - -# fail if assertion is invalid -sap_vm_preconfigure_ignore_failed_assertion: no