Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lpar integration - installation on LPAR as nodes #241

Merged
merged 4 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
The documentation for this project can be found [here](https://ibm.github.io/Ansible-OpenShift-Provisioning/).

## What's new:
* Added support for LPAR based installation. The process for installing based on LPAR will largely use the same playbooks with some modifications to the configuration which can be found in the updated docs.
* Infra nodes on LPAR is currently unsupported, will be added in a later patch.
* Installation with bastion and bootstrap as KVM nodes and also extra worker or compute nodes as KVM along with lpar nodes is supported.

### Variables renamed:

Expand Down
2 changes: 2 additions & 0 deletions docs/set-variables-group-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
## 1 - Controller
**Variable Name** | **Description** | **Example**
:--- | :--- | :---
**env.installation_type** | Can be of type kvm or lpar. Some packages will be ignored for installation in case of non lpar based installation. | kvm
**env.controller.sudo_pass** | The password to the machine running Ansible (localhost).<br /> This will only be used for two things. To ensure you've installed the<br /> pre-requisite packages if you're on Linux, and to add the login URL<br /> to your /etc/hosts file. | Pas$w0rd!

## 2 - LPAR(s)
Expand Down Expand Up @@ -41,6 +42,7 @@
**env.file_server.user** | Username to connect to the file server. Must have sudo and SSH access. | user1
**env.file_server.pass** | Password to connect to the file server as above user. | user1pa$s!
**env.file_server.protocol** | Protocol used to serve the files, either 'ftp' or 'http' | http
**env.file_server.iso_os_variant** | The os variant for the bastion kvm to be created | rhel8.8
**env.file_server.iso_mount_dir** | Directory path relative to the HTTP/FTP accessible directory where RHEL ISO is mounted. For example, if the FTP root is at /home/user1<br /> and the ISO is mounted at /home/user1/RHEL/8.7 then this variable would be<br /> RHEL/8.7 - no slash before or after. | RHEL/8.7
**env.file_server.cfgs_dir** | Directory path relative to to the HTTP/FTP accessible directory where configuration files can be stored. For example, if FTP root is /home/user1<br /> and you would like to store the configs at /home/user1/ocpz-config then this variable would be<br /> ocpz-config. No slash before or after. | ocpz-config

Expand Down
15 changes: 14 additions & 1 deletion docs/set-variables-host-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
:--- | :--- | :---
**networking.hostname** | The hostname of the LPAR with RHEL installed natively (the KVM host). | kvm-host-01
**networking.ip** | The IPv4 address of the LPAR with RHEL installed natively (the KVM host). | 192.168.10.2
**networking.ipv6** | IPv6 address for the bastion if use_ipv6 variable is 'True'. | fd00::3
**networking.subnetmask** | The subnet that the LPAR resides in within your network. | 255.255.255.0
**networking.gateway** | The IPv4 address of the gateway to the network where the KVM host resides. | 192.168.10.0
**networking.ipv6_gateway** | IPv6 of he bastion's gateway server. | fd00::1
**networking.ipv6_prefix** | IPv6 prefix. | 64
**networking.nameserver1** | The IPv4 address from which the KVM host gets its hostname resolved. | 192.168.10.200
**networking.nameserver2** | <b>(Optional)</b> A second IPv4 address from which the KVM host can get its hostname<br /> resolved. Used for high availability. | 192.168.10.201
**networking.device1** | The network interface card from Linux's perspective. Usually enc and then a number that comes<br /> from the dev_num of the network adapter. | enc100
Expand All @@ -25,8 +28,11 @@

## Important Note
* You can skip the rest of the variables on this page IF you are using existing LPAR(s) that has RHEL already installed.
* If you are installing an LPAR based cluster then the information below must be provided and are not optional. You must create a host file corresponding to each lpar node.
* Since this is how most production deployments on-prem are done on IBM zSystems, these variables have been marked as optional.
* With pre-existing LPARs with RHEL installed, you can also skip [1_create_lpar.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/1_create_lpar.yaml) and [2_create_kvm_host.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/2_create_kvm_host.yaml) playbooks. Make sure to still do [0_setup.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/0_setup.yaml) first though, then skip to [3_setup_kvm_host.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/3_setup_kvm_host.yaml)
* In the scenario of lpar based installation you can skip [1_create_lpar.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/1_create_lpar.yaml) and [2_create_kvm_host.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/2_create_kvm_host.yaml). You can also optionally skip [3_setup_kvm_host.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/3_setup_kvm_host.yaml) and [4_create_bastion.yaml](https://github.com/IBM/Ansible-OpenShift-Provisioning/blob/main/playbooks/3_setup_kvm_host.yaml) unless you are planning on having the bastion on the same host.
* In case of lpar based installation one is expected to have a tessia live disk accessible by the lpar nodes for network boot. The details of which are to be filled in section #7 below. The steps to create a tessia livedisk can be found [here](https://gitlab.com/tessia-project/tessia-baselib/-/blob/master/doc/users/live_image.md).

## 2 - (Optional) CPC & HMC
**Variable Name** | **Description** | **Example**
Expand Down Expand Up @@ -81,4 +87,11 @@
**lpar.storage_group_2.type** | <b>(Optional)</b> Storage type. FCP is the only tested type as of now. | fcp
**lpar.storage_group_2_.storage_wwpn** | <b>(Optional)</b> World-wide port numbers for storage group. Use provided list formatting. | 500708680235c3f0<br />500708680235c3f1<br />500708680235c3f2<br />500708680235c3f3
**lpar.storage_group_2_.dev_num** | <b>(Optional)</b> The logical device number of the Host Bus Adapter (HBA) for the storage group. | C001
**lpar.storage_group_2_.lun_name** | <b>(Optional)</b> he Logical Unit Numbers (LUN) that points to a specific virtual disk<br /> behind the WWPN. | 4200569309ahhd240000000000000c001
**lpar.storage_group_2_.lun_name** | <b>(Optional)</b> he Logical Unit Numbers (LUN) that points to a specific virtual disk<br /> behind the WWPN. | 4200569309ahhd240000000000000c001

## 7 - (Optional) Livedisk info
**Variable Name** | **Description** | **Example**
sandisamp marked this conversation as resolved.
Show resolved Hide resolved
:--- | :--- | :---
**lpar.livedisk.livedisktype** | <b>(Optional)</b> Storage type. DASD is the only tested type as of now. | dasd
**lpar.livedisk.devicenr** | <b>(Optional)</b> the device no of the DASD live disk | c6h1
**lpar.livedisk.livedisk_root_pass** | <b>(Optional)</b> root password for the livedisk | p@ssword
3 changes: 2 additions & 1 deletion inventories/default/group_vars/all.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

# Section 1 - Ansible Controller
env:
installation_type: #X
controller:
sudo_pass: #X

Expand Down Expand Up @@ -479,7 +480,7 @@ day2_compute_node:

# Section 19 - Agent Based Installer ( Optional )
abi:
flag: True
flag: Flase
ansible_workdir: 'ansible_workdir'
ocp_installer_version: '4.15.0-rc.8'
ocp_installer_url: 'https://mirror.openshift.com/pub/openshift-v4/s390x/clients/ocp/'
17 changes: 14 additions & 3 deletions inventories/default/host_vars/KVMhostname1-here.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
networking:
hostname: #X
ip: #X
ipv6: #X
subnetmask: #X
ipv6_prefix: #X
gateway: #X
ipv6_gateway: #X
nameserver1: #X
# nameserver2:
device1: #X
Expand All @@ -14,9 +17,11 @@ storage:

##############################################################
# Variables below this point only need to be filled out if #
# env.z.lpar1.create is True. Meaning, if the LPARs you will #
# env.z.lpar1.create is True or if you are doing a lpar #
# based installation. Meaning, if the LPARs you will #
# be using as KVM host(s) already exist and have RHEL #
# installed, the variables below are not required. #
# installed, the variables below are not required. However #
# for lpar based installation you must provide below vars #
##############################################################

# Section 2 - CPC & HMC
Expand Down Expand Up @@ -81,4 +86,10 @@ lpar:
# -
# -
# dev_num:
# lun_name:
# lun_name:

# Section 7 -live disk info
sandisamp marked this conversation as resolved.
Show resolved Hide resolved
livedisk:
livedisktype: #X
devicenr: #X
livedisk_root_pass: #X
17 changes: 14 additions & 3 deletions inventories/default/host_vars/KVMhostname2-here.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
networking:
hostname: #X
ip: #X
ipv6: #X
subnetmask: #X
ipv6_prefix: #X
gateway: #X
ipv6_gateway: #X
nameserver1: #X
# nameserver2:
device1: #X
Expand All @@ -14,9 +17,11 @@ storage:

##############################################################
# Variables below this point only need to be filled out if #
# env.z.lpar2.create is True. Meaning, if the LPARs you will #
# env.z.lpar2.create is True or if you are doing a lpar #
# based installation. Meaning, if the LPARs you will #
# be using as KVM host(s) already exist and have RHEL #
# installed, the variables below are not required. #
# installed, the variables below are not required. However #
# for lpar based installation you must provide below vars #
##############################################################

# Section 2 - CPC & HMC
Expand Down Expand Up @@ -81,4 +86,10 @@ lpar:
# -
# -
# dev_num:
# lun_name:
# lun_name:
sandisamp marked this conversation as resolved.
Show resolved Hide resolved

# Section 7 -live disk info
livedisk:
livedisktype: #X
devicenr: #X
livedisk_root_pass: #X
17 changes: 14 additions & 3 deletions inventories/default/host_vars/KVMhostname3-here.yaml.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
networking:
hostname: #X
ip: #X
ipv6: #X
subnetmask: #X
ipv6_prefix: #X
gateway: #X
ipv6_gateway: #X
nameserver1: #X
# nameserver2:
device1: #X
Expand All @@ -14,9 +17,11 @@ storage:

##############################################################
# Variables below this point only need to be filled out if #
# env.z.lpar3.create is True. Meaning, if the LPARs you will #
# env.z.lpar3.create is True or if you are doing a lpar #
# based installation. Meaning, if the LPARs you will #
# be using as KVM host(s) already exist and have RHEL #
# installed, the variables below are not required. #
# installed, the variables below are not required. However #
# for lpar based installation you must provide below vars #
##############################################################

# Section 2 - CPC & HMC
Expand Down Expand Up @@ -81,4 +86,10 @@ lpar:
# -
# -
# dev_num:
# lun_name:
# lun_name:
sandisamp marked this conversation as resolved.
Show resolved Hide resolved

# Section 7 -live disk info
livedisk:
livedisktype: #X
devicenr: #X
livedisk_root_pass: #X
5 changes: 4 additions & 1 deletion playbooks/1_create_lpar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@
- name: Create an LPAR for a third KVM host.
import_role:
name: create_lpar
when: env.z.lpar3.create == True
when: env.z.lpar3.create == True


#TODO: create all lpars defined in the host vars section
23 changes: 12 additions & 11 deletions playbooks/5_setup_bastion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
- { role: haproxy, when: env.bastion.options.loadbalancer.on_bastion }
- { role: sno_haproxy, when: env.bastion.options.loadbalancer.on_bastion and control_node_count | int == 1 }
- httpd
- { role: install_tessia_baselib, when: env.installation_type|lower == "lpar" }

- hosts: bastion
tags: services, section_2, openvpn
Expand All @@ -89,8 +90,8 @@
openvpn_role: "server"
roles:
#- { role: robertdebock.bootstrap, tags: openvpn, when: env.z.high_availability == True }
- { role: robertdebock.epel, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True }
- { role: robertdebock.openvpn, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True }
sandisamp marked this conversation as resolved.
Show resolved Hide resolved
- { role: robertdebock.epel, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar" }
- { role: robertdebock.openvpn, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar" }

- hosts: localhost
tags: services, section_2, openvpn
Expand All @@ -101,7 +102,7 @@
file:
state: directory
path: tmp
when: env.setup_openvpn == True and env.z.high_availability == True
when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar"

- hosts: bastion
tags: services, section_2, openvpn
Expand All @@ -118,7 +119,7 @@
- issued/client.crt
- private/client.key
- ta.key
when: env.setup_openvpn == True and env.z.high_availability == True
when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar"

- name: setup OpenVPN on KVM host(s).
hosts: kvm_host
Expand All @@ -131,7 +132,7 @@
pre_tasks:
- name: Gather facts.
setup:
when: env.setup_openvpn == True and env.z.high_availability == True
when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar"

- name: Create landing directories for certificates and keys on KVM hosts.
tags: openvpn
Expand All @@ -142,7 +143,7 @@
loop:
- issued
- private
when: env.setup_openvpn == True and env.z.high_availability == True
when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar"

- name: Copy certificates and keys from controller to KVM hosts.
tags: openvpn
Expand All @@ -155,10 +156,10 @@
- client.crt
- client.key
- ta.key
when: env.setup_openvpn == True and env.z.high_availability == True
when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "zvm" and env.installation_type|lower != "lpar"
roles:
sandisamp marked this conversation as resolved.
Show resolved Hide resolved
- { role: robertdebock.epel, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True }
- { role: robertdebock.openvpn, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True }
- { role: robertdebock.epel, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar" }
- { role: robertdebock.openvpn, tags: openvpn, when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar" }

- hosts: localhost
tags: services, section_2, openvpn
Expand All @@ -169,7 +170,7 @@
file:
state: absent
path: tmp
when: env.setup_openvpn == True and env.z.high_availability == True
sandisamp marked this conversation as resolved.
Show resolved Hide resolved
when: env.setup_openvpn == True and env.z.high_availability == True and env.installation_type|lower != "lpar"

- hosts: bastion
tags: get_ocp, section_3
Expand All @@ -178,4 +179,4 @@
- "{{ inventory_dir }}/group_vars/all.yaml"
roles:
- common
- { role: get_ocp, when: abi.flag is defined and abi.flag != True }
- { role: get_ocp, when: abi.flag is not defined or abi.flag != True }