Hands-on: Maximo 7.x to MAS Manage Upgrade Lab 1261
1 Install Single Node OpenShift via APIs
1.1 Prepare token and secrets
1.1.1 API token
- Open Terminal. Change directory.
cd 1261
- Refresh provided token.
source ./refresh-token
- Verify that you can access the API by running the following command:
curl -s https://api.openshift.com/api/assisted-install/v2/component-versions \
-H "Authorization: Bearer ${API_TOKEN}" \
| jq
Expected outcome
{
"release_tag": "v2.33.1",
"versions": {
"assisted-installer": "registry.redhat.io/rhai-tech-preview/assisted-installer-rhel8:v1.0.0-353",
"assisted-installer-controller": "registry.redhat.io/rhai-tech-preview/assisted-installer-reporter-rhel8:v1.0.0-431",
"assisted-installer-service": "quay.io/app-sre/assisted-service:4b0d0eb",
"discovery-agent": "registry.redhat.io/rhai-tech-preview/assisted-installer-agent-rhel8:v1.0.0-332"
}
}
1.1.2 Software (pull) secret
- Software (pull) secret in JSON format has been made available to you in advance. Save it as a variable.
PULL_SECRET=$(cat ./pull-secret-escaped.json)
1.1.3 Secure Shell (SSH) key
- SSH key has been made available to you in advance. Save it as a variable.
SSH_KEY=$(cat ~/.ssh/id_ed25519.pub)
1.1.4 Name your OpenShift
-
Locate your assigned workstation name from the passwords.txt file on the desktop.
-
Save your assigned name as a variable. Replace XX with your number before executing the command.
export NAME=ocpwksXX
1.1.5 OpenShift version
- At the time of this workshop, we are working with version 4.15. Save it as a variable.
export VERSION=4.15
1.2 Create the instance
- Using the above saved values, create your instance.
RESPONSE=$(curl -s -X POST "https://api.openshift.com/api/assisted-install/v2/clusters" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${API_TOKEN}" \
-d '{
"name": "'"${NAME}"'",
"high_availability_mode": "None",
"openshift_version": "4.15",
"base_dns_domain": "gym.lan",
"ssh_public_key": "'"${SSH_KEY}"'",
"pull_secret": "'"${PULL_SECRET}"'",
"network_type": "OVNKubernetes",
"schedulable_masters": true
}') ; echo $RESPONSE
- Identify the clusterID.
CLUSTER_ID=$(echo $RESPONSE | jq -r \
'.cluster_networks[0].cluster_id') ; echo $CLUSTER_ID
- Get Instance Status.
STATUS=$(curl -s -X GET \
"https://api.openshift.com/api/assisted-install/v2/clusters/${CLUSTER_ID}" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_TOKEN") ; echo $STATUS
- Create Infrastructure environment.
export INFRA_ENV_ID=$(curl -s -X POST \
"https://api.openshift.com/api/assisted-install/v2/infra-envs" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${API_TOKEN}" \
-d '{
"ssh_authorized_key": "'"${SSH_KEY}"'",
"pull_secret": "'"${PULL_SECRET}"'",
"name": "'"${NAME}"'",
"image_type": "full-iso",
"cluster_id": "'"${CLUSTER_ID}"'",
"openshift_version": "4.15"
}') ; echo $INFRA_ENV_ID
- Get ISO URL.
ISO_URL=$(echo $INFRA_ENV_ID | jq -r '.download_url')
- Download ISO file.
wget -O ~/Downloads/${NAME}.iso $ISO_URL
1.3 Create VMware Virtual Machine
- Create VM.
./govc_create_vm.sh
You must wait at least two minutes here before proceeding forward. Check your clock.
1.3 Install SNO
- After about a few minutes, install OpenShift.
source ./refresh-token
curl -X POST \
"https://api.openshift.com/api/assisted-install/v2/clusters/${CLUSTER_ID}/actions/install" \
-H "Authorization: Bearer ${API_TOKEN}"
- Get Status using the while loop.
while [ "$STATUS" != "installed" ]; do
STATUS=$(curl -s -X GET "https://api.openshift.com/api/assisted-install/v2/clusters/${CLUSTER_ID}" \
-H "Authorization: Bearer ${API_TOKEN}" | jq -r .status)
echo "Current Status: $STATUS"
if [ "$STATUS" != "installed" ]; then
# Wait for a while before checking again
sleep 90
fi
done
Expected outcome:
Current Status: preparing-for-installation
Current Status: installing
Current Status: installing
Current Status: finalizing
Current Status: null
The while loop times out when the token expires. Take the following actions when you see the null message...
- Press Ctrl+c to exit the while loop.
- Run
source ./refresh-token - Copy/paste the while loop command to start getting the status again.
⏰ ~45 minutes
While we wait for OpenShift to finish the installation, we'll switch gears and work on Maximo customization and database migration. We'll return to OpenShift after the installation is successfully completed.
For now, jump down below to section number 3.
2 OpenShift Day two operations
2.1 OpenShift credentials
2.1.1 Retrieve OpenShift credentials
- Refresh your API token.
source ./refresh-token
- Retrieve credentials.
curl -s -X GET \
"https://api.openshift.com/api/assisted-install/v2/clusters/${CLUSTER_ID}/credentials" \
-H "Authorization: Bearer ${API_TOKEN}" | jq
2.1.2 Save credentials.
-
Copy/paste the retreived credentials to the passwords.txt file.
-
Replace xxxx-xxxx with the kubeadmin password.
2.2 MAS CLI
2.2.1 Setup MAS CLI
- Change directory.
cd mas9
- Start MAS CLI container.
podman run -it --pull always -v ${PWD}:/mas9:Z --name ibmmas quay.io/ibmmas/cli:10.9.1
- Change directory.
cd /mas9
- Copy/paste this single command.
cp /mascli/ansible-devops/common_vars/default_storage_classes.yml /mascli/ansible-devops/common_vars/default_storage_classes.yml.bak && mv default_storage_classes.yml /mascli/ansible-devops/common_vars/default_storage_classes.yml
2.3 Command line login to OpenShift
- Copy/paste the
oc login ...string from your passwords.txt file to login to your OpenShift from inside the MASCLI container.
2.4 LVM Storage operator
- Install LVM operator for OpenShift.
./install_lvm_storage.sh
2.5 Container image registry server
- Install registry server.
./install_lvm_registry.sh
3 Maximo 7.x customization
- Instructor-led session.
4 Maximo 7.x database migration
- Instructor-led session.
Your OpenShift must have been installed by now. Jump back up to the Day 2 operations.
5 Maximo Application Suite & Manage
./install_mas.sh