So you want to install your SAP workload on Red Hat OpenShift? The good news is that it’s technically possible. The bad news is that it’s not supported by SAP for production workloads. But assume for a moment that you want to install a development or training or demo system. In that case, you can run your workload in a traditional virtual machine (VM) using OpenShift Virtualization. You want the setup and tuning to be done automatically? There are Ansible roles to cover that.
First, of course, you need an OpenShift cluster. If you don't already have one, read Installing a user-provisioned cluster on bare meta to learn more about how to set one up, or you can get one from your preferred cloud provider. You can also automate the install.
What is OpenShift Virtualization?
OpenShift Virtualization is a feature of OpenShift that enables you to run and manage both virtualized and containerized workloads together within the Kubernetes-based OpenShift environment. Developed by Red Hat, OpenShift Virtualization provides the ability to unify diverse workloads by allowing you to deploy and manage traditional virtual machines alongside containerized applications. This integration helps you leverage the benefits of both virtualization and containerization, providing better optimized resource utilization, scalability, and flexibility in your IT infrastructure. OpenShift Virtualization is based on KVM, an open-source virtualization technology integrated into the Linux kernel. It is widely used in data centers and cloud environments for its scalability, flexibility, and efficient utilization of hardware resources. OpenShift Virtualization is designed to help simplify the management of mixed workloads, offering a more consistent and efficient solution for running applications across various deployment models within the OpenShift application platform.
Configuring the OpenShift cluster
Your worker nodes must all be identical, with the same amount of RAM, CPUs, disks, and network cards. The network cards must be in the same PCI slots as the ports, which must be named identically.
Next, install the Ansible (version 1.3.5 or above) collection from Ansible galaxy.
# ansible-galaxy collection install community.sap_install
Make sure your KUBECONFIG environment variable is set, and that you're logged into your cluster:
# export KUBECONFIG=$HOME/.kube/config
# oc login
Verify that you're logged in by getting a list of all nodes in your cluster:
# oc get nodes
To start a new deployment, create a working directory and change to it:
# mkdir sap
# cd sap
Create a copy of the example playbook in your working directory, and copy the example variable definition:
# cp ~/.ansible/collections/ansible_collections/community/sap_install/playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml my-sap-deployment.yml
# cp ~/.ansible/collections/ansible_collections/community/sap_install/playbooks/vars/sample-variables-sap-hypervisor-node-preconfigure-rh_ocp_virt.yml my-sap-hypervisor-config.yml
Adjust the my-sap-hypervisor-config.yml
configuration to your needs. Each worker node you need configured for SAP workloads must be present in the file. You can also configure a local disk to be used for local storage using the variable sap_hypervisor_node_preconfigure_cluster_config.worker_localstorage_device
.
It’s important that you add at least one storage class to the cluster, either localstorage or NFS, with the help of this role or later manually before you deploy your first VM.
You can also configure networks, as shown in the example.
Once done with the configuration, it’s time to let Ansible get to work configuring the cluster:
# ansible-playbook -i localhost, my-sap-deployment.yml \
-e @my-sap-hypervisor-config.yml
In case the entry Virtualization
does not appear in the OpenShift UI, clear your browser cache.
Create a Virtual Machine
Use the role sap_create_vm
from https://github.com/newkitlabs/sap_create_vm to create virtual machines with the performance tunings for SAP workloads. Ensure that your cluster has a default storage class setup along with enough storage space.
Install the following packages on your jumphost:
# sudo dnf install python3-kubernetes \
ansible-collection-kubernetes-core
Use Git to clone the sap_create_vm
role in your working directory:
# cd
# mkdir -p data/git
# cd data/git
# git clone https://github.com/newkitlabs/sap_create_vm.git
# cd sap_create_vm
Move or link that checkout to a directory in your Ansible path. Create ~/.ansible/roles
if it doesn't exist:
# ln -sf ~/data/git/sap_create_vm/roles/sap_create_vm
~/.ansible/roles/
Make sure you’ve exported your kubeconfig
file so it's available to your shell environment:
# export KUBECONFIG=$HOME/.kube/config
To create a VM named sapvm01
with 24GB of RAM and a password of passw0rd
, run the following command:
# ansible-playbook -vvv \
--connection=local -i localhost, playbooks/sap-create-vm.yml \
-e sap_create_vm_names="['sapvm01']" \
-e sap_create_vm_memory=24 \
-e sap_create_vm_cloud_user_passwd=passw0rd
Prepare the OS for the SAP workload
From the community.sap_install
repository, use the role sap_general_preconfigure
to configure your OS as necessary. For the installation of SAP HANA, use the role sap_hana_preconfigure
and then sap_hana_install
. For Netweaver, use sap_netweaver_preconfigure
and then sap_swpm
.
Install the application
To install the roles on your Ansible path, set the KUBECONFIG
environment variable to point at your kubeconfig
file. Have a look at the configuration file
sap_hypervisor_node_preconfigure/vars/platform_defaults_redhat_ocp_virt.yml
Create a copy of that file and adjust it to reflect your configuration (localstorage, network and other details).
The simple playbook playbooks/sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml
calls the role and selects the OpenShift Platform through the sap_hypervisor_node_platform variable.
Start the install:
# ansible-playbook -v --connection=local -i localhost, \ sample-sap-hypervisor-redhat_ocp_virt-preconfigure.yml \
-e @<your copy of the config>
This starts the install for you. Once it's complete, test the application to ensure it works as expected.
References
저자 소개
Learn and unlearn has been my mantra for the last many years. This has helped me become a better writer, blogger, and content creator. I have been working as a senior technical writer with an interest in blogging. Currently, I am working for Red Hat Enterprise Linux for SAP Solutions.
Started using Linux in the 90's working with SAP since 2013 and being a fan of virtualization and automation.
채널별 검색
오토메이션
기술, 팀, 인프라를 위한 IT 자동화 최신 동향
인공지능
고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트
오픈 하이브리드 클라우드
하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요
보안
환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보
엣지 컴퓨팅
엣지에서의 운영을 단순화하는 플랫폼 업데이트
인프라
세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보
애플리케이션
복잡한 애플리케이션에 대한 솔루션 더 보기
오리지널 쇼
엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리
제품
- Red Hat Enterprise Linux
- Red Hat OpenShift Enterprise
- Red Hat Ansible Automation Platform
- 클라우드 서비스
- 모든 제품 보기
툴
체험, 구매 & 영업
커뮤니케이션
Red Hat 소개
Red Hat은 Linux, 클라우드, 컨테이너, 쿠버네티스 등을 포함한 글로벌 엔터프라이즈 오픈소스 솔루션 공급업체입니다. Red Hat은 코어 데이터센터에서 네트워크 엣지에 이르기까지 다양한 플랫폼과 환경에서 기업의 업무 편의성을 높여 주는 강화된 기능의 솔루션을 제공합니다.