Online upgrade of IBM Cloud Pak for AIOps (CLI method)
Use these instructions to upgrade an online starter or production deployment of IBM Cloud Pak® for AIOps 4.7.0 or later to 4.8.0.
Overview
This procedure is for deployments of IBM Cloud Pak for AIOps on Red Hat® OpenShift® Container Platform. This procedure can be used on an online deployment of IBM Cloud Pak for AIOps 4.7.0 or later, and can still be used if the deployment has had hotfixes applied.
You cannot use these instructions to upgrade deployments of IBM Cloud Pak for AIOps 4.6.1 or earlier. For more information, see Upgrade paths.
If you have an offline deployment of IBM Cloud Pak for AIOps on Red Hat OpenShift, follow the instructions in Upgrading IBM Cloud Pak for AIOps (offline).
If you have a deployment of IBM Cloud Pak for AIOps on Linux, follow the instructions in Online upgrade of IBM Cloud Pak for AIOps on Linux.
Important: If IBM® Netcool® Operations Insight® is deployed on the same cluster as IBM Cloud Pak for AIOps, ensure that Netcool Operations Insight is at version 1.6.13 or later before you upgrade IBM Cloud Pak for AIOps. Failure to do so may result in a broken Netcool Operations Insight deployment, as the IBM Cloud Pak for AIOps upgrade process updates a shared component that is used by both applications.
Before you begin
Notes:
- Ensure that you are on a version of Red Hat OpenShift that your current and target versions of IBM Cloud Pak for AIOps both support. If you already have a qualifying version of Red Hat OpenShift but you want to upgrade it, then complete the IBM Cloud Pak for AIOps upgrade first. For more information, see Guidance for upgrades that require an Red Hat OpenShift upgrade.
- Ensure that you are logged in to your Red Hat OpenShift cluster with
oc loginfor any steps that use the Red Hat OpenShift command-line interface (CLI). - Red Hat OpenShift requires a user with
cluster-adminprivileges for the following operations:
Warnings:
- Custom patches, labels, and manual adjustments to IBM Cloud Pak for AIOps resources are lost when IBM Cloud Pak for AIOps is upgraded, and must be manually reapplied after upgrade. For more information, see Manual adjustments are not persisted.
- The upgrade cannot be removed or rolled back.
- If you previously increased the size of a PVC directly, then you must follow the correct procedure that is supplied in Resizing storage to ensure that the size is updated by the operator. Failure to do so before upgrading IBM Cloud Pak for AIOps causes the operator to attempt to restore a lower default value for the PVC, and causes an error in your IBM Cloud Pak for AIOps deployment.
Database migration during upgrade
The IBM Cloud Pak for AIOps 4.7.x to v4.8 upgrade process migrates the Elasticsearch database to an OpenSearch database.
Extra resources are needed during the upgrade, and are shown in the following table. These resources can be released after the upgrade is complete.
| Size | vCPU | Memory | Disk |
|---|---|---|---|
| Starter | 2 | 8Gi | 100Gi |
| Production | 6 | 24Gi | 300Gi |
If IBM Sales representatives and Business Partners supplied you with a custom profile, then you must calculate the additional resource requirements as follows:
-
Run the following commands to view your custom profile ConfigMap.
export PROJECT_CP4AIOPS=<project> oc get configmap -n "${PROJECT_CP4AIOPS}" $(oc get installation.orchestrator.aiops.ibm.com -n "${PROJECT_CP4AIOPS}" -o jsonpath='{.items[0].status.customProfileConfigmap}') -o yamlWhere
<project>is the namespace (project) that IBM Cloud Pak for AIOps is deployed in. -
Locate the section for
elasticsearchin the output, and calculate the additional resources that are needed for the duration of upgrade.The additional vCPU needed is
replicasmultiplied byrequests.cpu, and the additional memory needed isreplicasmultiplied burequests.memory.Example output for an
elasticsearchsection, where upgrade will need 15 additional vCPU (5 x 3) and 40960 Mi memory (5 x 8192).elasticsearch: replicas: 5 resources: requests: cpu: 3000m memory: 8192Mi limits: cpu: 6000m memory: 8192Mi
The migration causes approximately 10 minutes of downtime for the following IBM Cloud Pak for AIOps components: log integrations, ticket integrations, log anomaly model training, and the Insights Dashboard. If alert archiving to Elasticsearch is enabled on your deployment, then the downtime for the migration might be extended depending on the quantity of alerts stored.
During upgrade, you can run the following command to monitor the status of the migration:
oc describe installation -n ${PROJECT_CP4AIOPS}
Example output for a migration in progress:
Conditions:
Last Transition Time: 2024-10-29T16:58:55Z
Message: Foreground Elasticsearch migration in progress
Observed Generation: 2
Reason: ForegroundMigrationInProgress
Status: True
Type: MigratingElastic
When migration is complete, Message has a value of Elasticsearch migration completed.
Note: Some integrations might be marked as Not Running while the migration is in progress. This is expected behavior, and the integrations must not be altered until the migration is complete.
After all services resume function, historic log data is migrated in the background. Historic log data is not accessible for training new models while this migration occurs. The duration of this background migration depends on the quantity of historic log data stored.
Upgrade procedure
Follow these steps to upgrade your online IBM Cloud Pak for AIOps deployment.
1. Ensure cluster readiness
Recommended: Take a backup before upgrading. For more information, see Backup and restore.
-
Ensure that your cluster still meets all of the prerequisites for deployment. For more information, see Planning.
Ensure that your cluster has the additional resources that are required for upgrade, as outlined in Database migration during upgrade.
-
If you still have
waiops_var.shfrom when you installed IBM Cloud Pak for AIOps, then run the following command from the directory that the script is in, to set the environment variables that are used later.. ./waiops_var.shIf you do not have
waiops_var.sh, then run the following commands to set the environment variables that you need for upgrade.export PROJECT_CP4AIOPS=<project> export INSTALL_MODE_NAMESPACE=<install_namespace>Where
<project>is the namespace (project) that your IBM Cloud Pak for AIOps subscription is deployed in.<install_namespace>is ${PROJECT_CP4AIOPS} if your deployment is namespace scoped, oropenshift-operatorsif your deployment has a cluster-wide scope.
-
Run the IBM Cloud Pak for AIOps prerequisite checker script.
Run the prerequisite checker script to ensure that your Red Hat OpenShift Container Platform cluster is correctly set up for an IBM Cloud Pak for AIOps upgrade.
Download the prerequisite checker script from github.com/IBM
, and run it with the following command:
./prereq.sh -n ${PROJECT_CP4AIOPS} --ignore-allocatedImportant: If you are installing on a multi-zone cluster, then also specify the
-mflag to assess whether there are sufficient resources to withstand a zone outage.Note: The prerequisite checker script might show inadequate resources in the Resource Summary because the script does not account for resources already being in use by the upgrading deployment. This can be ignored, as can the following message: [ FAIL ] Small or Large Profile Install Resources.
Example output:
# ./prereq.sh -n cp4aiops --ignore-allocated [INFO] Starting IBM Cloud Pak for AIOps prerequisite checker v4.8... CLI: oc [INFO] =================================Platform Version Check================================= [INFO] Checking Platform Type.... [INFO] You are using Openshift Container Platform [INFO] OCP version 4.16.7 is compatible but only nodes with AMD64 architectures are supported at this time. [INFO] =================================Platform Version Check================================= [INFO] =================================Storage Provider================================= [INFO] Checking storage providers [INFO] No IBM Storage Fusion Found... Skipping configuration check. [INFO] No Portworx StorageClusters found with "Running" or "Online" status. Skipping configuration check for Portworx. [INFO] Openshift Data Foundation found. [INFO] No IBM Cloud Storage found... Skipping configuration check for IBM Cloud Storage Check. Checking Openshift Data Foundation Configuration... Verifying if Red Hat Openshift Data Foundation pods are in "Running" or "Completed" status [INFO] Pods in openshift-storage project are "Running" or "Completed" [INFO] ocs-storagecluster-ceph-rbd exists. [INFO] ocs-storagecluster-cephfs exists. [INFO] No warnings or failures found when checking for Storage Providers. [INFO] =================================Storage Provider================================= [INFO] =================================Cert Manager Check================================= [INFO] Checking for Cert Manager operator [INFO] Successfully functioning cert-manager found. CLUSTERSERVICEVERSION NAMESPACE ibm-cert-manager-operator.v4.2.8 ibm-cert-manager [INFO] =================================Cert Manager Check================================= [INFO] =================================Licensing Service Operator Check================================= [INFO] Checking for Licensing Service operator [INFO] Successfully functioning licensing service operator found. CLUSTERSERVICEVERSION NAMESPACE ibm-licensing-operator.v4.2.8 ibm-licensing [INFO] =================================Licensing Service Operator Check================================= [INFO] =================================Starter or Production Install Resources================================= [INFO] Checking for cluster resources [INFO] ==================================Resource Summary===================================================== [INFO] Nodes | vCPU | Memory(GB) [INFO] Starter (Non-HA) Base (available/required) [ 9 / 3 ] [ 144 / 47 ] [ 289 / 123 ] [INFO] (+ Log Anomaly Detection & Ticket Analysis) [ 9 / 3 ] [ 144 / 55 ] [ 289 / 136 ] [INFO] Production (HA) Base (available/required) [ 9 / 6 ] [ 144 / 136 ] [ 289 / 310 ] [INFO] (+ Log Anomaly Detection & Ticket Analysis) [ 9 / 6 ] [ 144 / 162 ] [ 289 / 368 ] [INFO] ==================================Resource Summary===================================================== [INFO] Cluster currently has resources available to create a Starter (Non-HA) install of Cloud Pak for AIOps [INFO] =================================Prerequisite Checker Tool Summary================================= [ PASS ] Platform Version Check [ PASS ] Storage Provider [ PASS ] Starter (Non-HA) Base Install Resources [ FAIL ] Production (HA) Base Install Resources [ PASS ] Cert Manager Operator Installed [ PASS ] Licensing Service Operator Installed [INFO] =================================Prerequisite Checker Tool Summary=================================
Note: If you are not using IBM Cloud Pak® foundational services Cert Manager, then ignore any errors that are returned by the Cert Manager check.
-
Delete any evicted
connector-orchestratorpods.-
Run the following command to check if there are any evicted
connector-orchestratorpods.oc get pods -n ${PROJECT_CP4AIOPS} | grep connector-orchestrator -
Cleanup any evicted connector-orchestrator pods.
If the previous command returned any pods with a STATUS of
Evicted, then run the following command to delete each of them.oc delete pod -n ${PROJECT_CP4AIOPS} <connector_orchestrator>Where
<connector_orchestrator>is a pod returned in the previous step.
-
-
Run the following command to ensure the safety of the Postgres database during upgrade.
Important: Failure to run this step might lead to a complete loss of data.
oc label clusters.postgresql.k8s.enterprisedb.io -n $PROJECT_CP4AIOPS $(oc get installations.orchestrator.aiops.ibm.com -n $PROJECT_CP4AIOPS -o jsonpath='{.items[].metadata.name}')-edb-postgres operator.ibm.com/opreq-do-not-uninstall='true'
2. Update the catalog
Update the ibm-aiops-catalog to use the v4.8.0 digest.
-
Run the following command:
cat << EOF | oc apply -f - apiVersion: operators.coreos.com/v1alpha1 kind: CatalogSource metadata: name: ibm-aiops-catalog namespace: openshift-marketplace spec: displayName: ibm-aiops-catalog publisher: IBM Content sourceType: grpc image: icr.io/cpopen/ibm-aiops-catalog@sha256:58c0082ad5e9de6bc2869b528e847702f6c183a06ac49a82d64ad8efd339f753 EOF -
Verify that the ibm-aiops-catalog, ibm-cert-manager-catalog and ibm-licensing-catalog CatalogSource objects are in the output that is returned by the following command:
oc get CatalogSources -n openshift-marketplaceExample output:
oc get CatalogSources -n openshift-marketplace NAME DISPLAY TYPE PUBLISHER AGE ibm-aiops-catalog ibm-aiops-catalog grpc IBM 2m ibm-cert-manager-catalog ibm-cert-manager grpc IBM 2m ibm-licensing-catalog IBM License Service Catalog grpc IBM 2m
Note: During the upgrade of Cloud Pak for AIOps, Kubernetes jobs might fail and re-run. If a job succeeds on the second or third attempt, there can be one or two pods in Error state and one pod in the Completed state. If the job fails repeatedly, the attempt is abandoned, and the logs from failed pods are used to determine the cause of the failure. When you determine the cause for the failure, you can delete the job, and the operator can recreate
it to reattempt the operations.
3. Update the operator subscription
-
Update the
spec.channelvalue of the IBM Cloud Pak for AIOps subscription to the release that you want to upgrade to, v4.8.oc patch subscription.operators.coreos.com ibm-aiops-orchestrator -n ${INSTALL_MODE_NAMESPACE} --type=json -p='[{'op': 'replace', 'path': '/spec/channel', 'value': 'v4.8'}]' -
If you are installing in
AllNamespacesmode, run the following command to refresh the connectors' secret:oc delete secret cp4waiops-connectors-deploy-cert-secret -n "${PROJECT_CP4AIOPS}"For more information about installation modes, see Operator installation mode.
4. Verify the deployment
4.1 Check the deployment
Run the following command to check that the PHASE of your deployment is Updating.
oc get installations.orchestrator.aiops.ibm.com -n ${PROJECT_CP4AIOPS}
Example output:
NAME PHASE LICENSE STORAGECLASS STORAGECLASSLARGEBLOCK AGE
ibm-cp-aiops Updating Accepted rook-cephfs rook-ceph-block 3m
It takes around 60-90 minutes for the upgrade to complete (subject to the speed with which images can be pulled). When installation is complete and successful, the PHASE of your installation changes to Running.
If your installation phase does not change to Running, then use the following command to find out which components are not ready:
oc get installation.orchestrator.aiops.ibm.com -o yaml -n ${PROJECT_CP4AIOPS} | grep 'Not Ready'
Example output:
lifecycleservice: Not Ready
zenservice: Not Ready
To see details about why a component is Not Ready run the following command, where <component> is the component that is not ready, for example zenservice.
oc get <component> -o yaml -n ${PROJECT_CP4AIOPS}
(Optional) You can also download and run a status checker script to see information about the status of your deployment. For more information about how to download and run the script, see github.com/IBM.
If the upgrade fails, or is not complete and is not progressing, then see Troubleshooting installation and upgrade and Known Issues to help you identify any installation problems.
Important: Wait for the deployment to enter a Running phase before continuing to the next step.
4.2 Verify database migration
-
Verify that the database migration was successful.
Run the following command, and check that the
MigratingElasticcondition has a status offalseand a reason ofMigrationCompleted.oc get installation.orchestrator.aiops.ibm.com -o yaml -n ${PROJECT_CP4AIOPS} | grep 'MigratingElastic' -B 5Example output for a successful migration:
Conditions: - lastTransitionTime: "2024-10-29T17:16:55Z" message: Elasticsearch migration completed observedGeneration: 2 reason: MigrationComplete status: "False" type: MigratingElastic
-
Verify that all data is available in IBM Cloud Pak for AIOps as expected.
Important: If database migration is not complete, review the troubleshooting entry Database migration is stuck. If this does not resolve the problem, then do not continue to the next step and contact IBM Support.
4.3 Check the version
Run the following command and check that the VERSION that is returned is 4.8.0.
oc get csv -l operators.coreos.com/ibm-aiops-orchestrator.${INSTALL_MODE_NAMESPACE} -n ${INSTALL_MODE_NAMESPACE}
Example output:
oc get csv -l operators.coreos.com/ibm-aiops-orchestrator.cp4aiops -n cp4aiops
NAME DISPLAY VERSION REPLACES PHASE
ibm-aiops-orchestrator.v4.8.0 IBM Cloud Pak for AIOps 4.8.0 ibm-aiops-orchestrator.v4.7.1 Succeeded
5. Post upgrade actions
-
Delete the persistent volumes that were used for storing data in Elasticsearch, the database that was migrated from.
Run the following command:
oc delete pvc -l app.kubernetes.io/managed-by=ibm-elastic-operator -n ${PROJECT_CP4AIOPS} -
If you previously set up backup or restore on your deployment, then you must follow the instructions in Upgrading IBM Cloud Pak for AIOps backup and restore artifacts.
-
If the EXPIRY_SECONDS environment variable was set for configuring log anomaly alerts, the environment variable was not retained in the upgrade. After the upgrade is completed, set the environment variable again. For more information about setting the variable, see Configuring expiry time for log anomaly alerts.
-
If you have a metric integration configured that stops working after upgrade, then you must follow the instructions in After upgrade, a metric integration goes into a failed state.