# Preparing the execution environment for RHOCP worker3 node

Prerequisites:

Setting up RHEL 8.6 installer machine

This section assumes the following considerations for our deployment environment:

  • A server running Red Hat Enterprise Linux (RHEL) 8.6 exists within the deployment environment and is accessible to the installation user to be used as an installer machine. This server must have internet connectivity.
  • A virtual machine is used to act as an installer machine and the same host is utilized as an Ansible Engine host. We are using one of the worker3 machines as an installer machine to execute Ansible Playbook.

Prerequisites:

RHEL 8.6 installer machine must have the following configurations:

  1. The installer machine must have at least 500 GB disk space (especially in the "/" partition), 4 CPU cores and 16 GB RAM.
  2. RHEL 8.6 installer machine must be subscribed with valid Red Hat credentials. To register the installer machine for the Red Hat subscription, run the following command:
$ sudo subscription-manager register --username=<username> --password=<password> --auto-attach 
  1. Sync time with NTP server.
  2. SSH key pair must be available on the installer machine. If the SSH key is not available, generate a new SSH key pair with the following command:
$ ssh-keygen 

To set up the installer machine:

5 Create and activate a Python3 virtual environment for deploying this solution with the following commands:

$ python3 -m venv <virtual_environment_name> 

$ source <virtual_environment_name>/bin/activate 

6 Download the OpenShift repositories using the following commands in the Ansible Engine:

$ mkdir /opt 

$ cd /opt 

$ yum install -y git 

$ git clone < https://github.com/HewlettPackard/hpe-solutions-openshift.git > 

7 Setup the installer machine to configure the nginx, development tools, and other python packages required for LTI installation. Navigate to the /opt/hpe-solutions-openshift/DL-LTI-Openshift/ directory and run the following command:

$ sh setup.sh 

8 As part of setup.sh script it will create nginx service, so user must download and copy Rhel 8.5 and Rhel 7.9 DVD ISO to /usr/share/nginx/html/

9.Minimum Storage requirement for management servers

Management Servers Host OS disk Storage Pool disk
Server 1 2 x 960GB 1 TB
Server 2 2 x 960GB 1 TB
Server 3 2 x 960GB 1 TB

Host OS disk – raid1 for redundancy

  1. Creating and deleting logical drives

Create and delete logical drives on the head nodes following below steps.

Input File Update:-

1. User has to update the input.yaml file in /opt/ISV-Openshit/create_delete_logicaldrives directory to  execute the logical drive script.

2. User needs to update all the details in the input.yaml file which include:-


		ILOServers:

			- ILOIP: 172.28.*.*

				ILOuser: admin

				ILOPassword: Password

				controller: 12  

				RAID: Raid1

				PhysicalDrives: 1I:1:1,1I:1:2  

			- ILOIP: 172.28.*.*

				ILOuser: admin

				ILOPassword: Password

				controller: 1

				RAID: Raid1

				PhysicalDrives: 1I:3:1,1I:3:2

			- ILOIP: 172.28.*.*

				ILOuser: admin

				ILOPassword: Password

				controller: 11

				RAID: Raid1

				PhysicalDrives: 1I:3:1,1I:3:2   

Note:-

1. To find controller id login to the respective ILO -> System Information -> Storage tab where inside Location find the **slot number** as the controller id. 

			 # Example - Slot = 12 

2. To find the PhysicalDrives login to the respective ILO -> System Information -> Storage tab inside Unconfigured Drives where under Location you can deduce PhysicalDrives based on these information:



		 # Slot: 12:Port=1I:Box=1:Bay=1

		# Example - 1I:1:1 ('Port:Box:Bay')

		# Slot: 12:Port=1I:Box=1:Bay=2

		# Example - 1I:1:2 ('Port:Box:Bay') 

Playbook Execution:-

To delete all the existing logical drives in the server in case if any and to create new logical drives named 'RHEL Boot Volume' in respective ILO servers run the site.yml playbook inside create_delete_logicaldrives directory with the below mentioned command                   

			$ ansible-playbook site.yml 

Note:- For server type ProLiant DL360 Gen10, Bonding_Interface1 = eno5 Bonding_Interface2 = eno6. For server type ProLiant DL365 Gen10 Plus, Bonding_Interface1 = ens2 Bonding_Interface2 = ens3

We can provide the input variables in any one of the below methods

Method 1. Input.py : Automation way of taking input

This method will parse the inputs from json files generated from SCID tool.

  1. Copy base-Configuration.json and ocp.json to working directory (/opt/ISV-OpenShift)
  2. Go to the directory /opt/ISV-OpenShift and run the below command.
   python ocpParser.py

Here it will prompt for values which are not obtained from SCID json files.

A sample input collection through ocpParser.py is as follows.

   Name of the file: input.yaml

	Enter HTTP_server_base_url with installer IP ( Example: http://InstallerIP/ ): http://172.28.*.*/

	Enter HTTP_file_path : /usr/share/nginx/html/

	Enter Operating System type : rhel8

	Enter Operating System Image name : rhel-8.5-x86_64-dvd.iso

	Enter Base Kickstart file path : /opt/ISV-Openshift/playbooks/roles/rhel8_os_deployment/tasks/ks_rhel8.cfg

	Enter RedHat Subscription Details

	Enter Valid Redhat Subscription Username : ******

	Enter Valid  Redhat Subscription Password : ******

	Enter Pool ID for Redhat OpenShift Container Platform : 8a*****

	Enter common details

	Enter DNS reverse zone ( Example: 230.28.192.in-addr.arpa ) : 230.28.192.in-addr.arpa

	Enter the customer forwarder DNS fqdn ( Example: resolver.companycorp.net ) : resolver.companycorp.net

	Enter worker node ip used as installer ( Example: 192.28.230.16 ) : 192.28.230.16

	Enter Upstream DNS Forwarder Details

	Enter the customer's first upstream DNS forwarder ip : 16.153.*.*

	Enter the customer's second upstream DNS forwarder ip : 16.53.*.*

	Enter the ocp version : 4.10.16

	Enter redhat pull secret & Installer machine public key

	Enter Redhat pull secret in single quotes (Login to the RedHat Portal and get the pull secret):

	Enter the Installer machine public key in single quotes (Generate using 'ssh-keygen' and provide the pub key):

	Enter base path Directory

	Enter base path in single quotes ( Example: '/opt/ISV-OpenShift' ): /opt/ISV-OpenShift

	Enter dhcp range that is used for OCP nodes

	Enter comma separated values of dhcp range that is used for OCP nodes ( Example: 192.28.230.10,192.28.230.24 ) : 192.28.230.10,192.28.230.24

	Name of the file: hosts

After execution of ocpParser.py, it will generate input.yaml and hosts file in the same location.

Method 2. Input.yaml: Manually editing input file

Go to the directory /opt/ISV-OpenShift, here we will have input_sample.yaml and hosts_sample files

Rename those two files as input.yaml and hosts and open the files and fill the values as per your setup.

A sample input.yaml file is as follows with a few filled parameters.

			 - Server_serial_number: 2M20510XXX

				ILO_Address: 172.28.*.*

				ILO_Username: admin

				ILO_Password: *****

				Hostname: headnode1.XX.XX                #ex. headnode1.isv.local

				Host_Username: root

				Host_Password: ******

				Bonding_Interface1: eno5

				Bonding_Interface2: eno6

				Host_OS_disk: sda

				Host_VlanID: ***

				Host_IP: 172.28.*.*

				Host_Netmask: 255.*.*.*

				Host_Prefix: XX                          #ex. 8,24,32

				Host_Gateway: 172.28.*.*

				Host_DNS: 172.28.*.*

				Host_Domain: XX.XX                       #ex. isv.com

				corporate_proxy: 172.28.*.*              #provide corporate proxy, ex. proxy.houston.hpecorp.net

				corporate_proxy_port: XX               #corporate proxy port no, ex. 8080

				config:

				HTTP_server_base_url: http://172.28.*.*/  #Installer IP address

				HTTP_file_path: /usr/share/nginx/html/    

				OS_type: rhel8

				OS_image_name: rhel-8.5-x86_64-dvd.iso

				base_kickstart_filepath: /opt/ISV-OpenShift-develop/playbooks/roles/rhel8_os_deployment/tasks/ks_rhel8.cfg

A sample hosts files is as follows

		   [kvm_nodes]

			172.28.*.*

			172.28.*.*

			172.28.*.*

			[ansible_host]

			172.28.*.*

			[rhel7_installerVM]

			172.28.*.*

			[binddns_masters]

			172.28.*.*

			[binddns_slaves]

			172.28.*.*

			172.28.*.*

			[masters_info]

			master1 ip=172.28.*.* hostname=headnode1

			[slaves_info]

			slave1 ip=172.28.*.* hostname=headnode2

			slave2 ip=172.28.*.* hostname=headnode3