Shutting down and restarting services

In some situations, when you are not using a service but you plan to use it in the future, you can manually shut the service down to prevent it from using resources. You can restart the service when you need to use it again.

Who needs to complete this task?
You must be either:
  • A cluster administrator
  • An instance administrator
When do you need to complete this task?
When you want to temporarily shutdown a service that you are not using.
Important: You cannot shut down a service when autoscaling is enabled for the service. For more information, see Automatically scaling resources for services.

You can shut down a service temporarily when you are not using it. For example, over holidays or during maintenance, you might shut down a service to conserve CPU and memory resources, and then restart the service when you want to use it again.

Shutdown
You shut down a service by using the cpd-cli manage shutdown command.

The command accepts the following options:

--components
The main component to shut down, and any dependent components, which are separated by commas. If you attempt to shut down a component that has dependencies that you don't specify, the process shuts down as many components as possible. You might receive an error message. To determine the dependencies of the component that you want to shut down, include the --preview option when you run the command. You can also run the following commands to get more information:
  • Run the cpd-cli manage list-dependents command to see which components are dependent on the component you want to shut down.
  • Run the cpd-cli manage get-cr-status command to see which components are running in the namespace.
--cpd_instance_ns
The project (namespace) where the component that you want to shut down is installed.

Use the ${PROJECT_CPD_INST_OPERANDS} environment variable to specify the project.

--tethered_instance_ns
A tethered project (namespace) where the shutdown command will shut down installed service instances.

Use the ${PROJECT_CPD_INSTANCE_TETHERED} environment variable to specify the project.

--force
Specify =true to shut down the service without waiting for jobs to exit. Any service instances that are running are shut down. Wait for the status to progress from shutdownInProgress to shutdown. When you restart a service, any instances that were forcibly shut down restart automatically.
--include_dependency
Specify --include_dependency=true to shut down any dependencies when you shut down the main component.

You can run the cpd-cli manage list-dependents command to see which components are dependent on the component you want to shut down.

--preview
Specify --preview=true to preview the commands that will run when you issue this CLI command.

For more information about the cpd-cli manage shutdown command, see manage shutdown in the cpd-cli command reference.

Restart
You restart a service by using the cpd-cli manage restart command. The command restarts the specified component and any dependencies. The component is restarted after the dependencies are restarted. When you restart a service, any instances that were forcibly shut down restart automatically.

The command accepts the following options:

--components
The component or components to restart. If a component has any dependencies, the dependencies will also be restarted.
--cpd_instance_ns
The project (namespace) where the component that you want to restart is installed.

Use the ${PROJECT_CPD_INST_OPERANDS} environment variable to specify the project.

--tethered_instance_ns
A tethered project (namespace) where the restart command will restart installed service instances.

Use the ${PROJECT_CPD_INSTANCE_TETHERED} environment variable to specify the project.

--preview
Specify --preview=true to preview the commands that will run when you issue this CLI command.

For more information about the cpd-cli manage restart command, see manage restart in the cpd-cli command reference.

Note: Some services support shutdown and restart but do not support the use of the cpd-cli manage shutdown command. To shut down and restart these services, you run the oc patch command to update the shutdown parameter in the service custom resource (CR) to manually shut down the service. Only the specified service is shut down or restarted. No dependent services are shut down.
The shutdown parameter accepts the following values:
true
The operator shuts down its deployments and any dynamic workloads such as jobs and environments. The operator might wait for running jobs to end before it shuts down fully. During that time, the service must not start any new dynamic workloads.

If you shut down a service that has running instances, the CR has a status of shutdownError. Otherwise, the status initially is shutdownInProgress and then eventually shutdown.

force
The service immediately shuts down without waiting for jobs to exit. Any service instances that are running are shut down. Wait for the status to progress from shutdownInProgress to shutdown.
false
The service is restarted. If you previously forced a shutdown that shut down service instances, this setting also restarts those service instances. You can also remove the shutdown setting from the CR to restart the service. Wait for the status to progress from shutdown to InProgress to Completed.

The following table shows the services that you can manually shut down and restart. You can see detailed instructions for each service in the procedure for shutting down and restarting services.

Important: Shut down the Cloud Pak for Data control plane and the Scheduling service only if you already shut down the services that are running on top of the Cloud Pak for Data control plane.
Service name Supports the use of the shutdown setting to manually shut down and restart the service
Cloud Pak for Data control plane
Scheduling service
Common core services
IBM Cloud Pak foundational services  
AI Factsheets
Anaconda Repository for IBM Cloud Pak for Data  
Analytics Engine powered by Apache Spark  
Cognos® Analytics
Cognos Dashboards
Data Privacy  
Data Refinery
Data Replication  
DataStage®
Db2®
Db2 Big SQL
Db2 Data Gate
Db2 Data Management Console
Db2 Warehouse
Decision Optimization
EDB Postgres
Execution Engine for Apache Hadoop
IBM® Match 360 with Watson™
Informix®  
MANTA Automated Data Lineage
OpenPages®
Planning Analytics
Product Master
RStudio® Server Runtimes
SPSS® Modeler
Voice Gateway  
Watson Assistant
Watson Discovery
Watson Knowledge Catalog  
Watson Knowledge Studio  
Watson Machine Learning
Watson Machine Learning Accelerator
Watson OpenScale
Watson Pipelines
Watson Query
Watson Speech services
Watson Studio
Watson Studio Runtimes
watsonx.data

Before you begin

Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

Procedure

  1. Run the cpd-cli manage login-to-ocp command to log in to the cluster as a user with sufficient permissions to complete this task. For example:
    cpd-cli manage login-to-ocp \
    --username=${OCP_USERNAME} \
    --password=${OCP_PASSWORD} \
    --server=${OCP_URL}
    Tip: The login-to-ocp command takes the same input as the oc login command. Run oc login --help for details.
  2. Shut down or restart any of the following services as needed.
    • Shut down

      Run the following command to shut down the common core services:

      Restriction: The common core services are a dependency for multiple services. The common core services can be shut down only when the services that have a dependency on the common core services are also shut down. You can run the cpd-cli manage list-dependents command to determine which components have a dependency on the common core services.
      oc patch ccs ccs-cr \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
      Restart

      Run the following command to restart the common core services service:

      oc patch ccs ccs-cr \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge
    • Shut down

      Run the following command to shut down the AI Factsheets service:

      cpd-cli manage shutdown \
      --components=factsheet \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the AI Factsheets service:

      cpd-cli manage restart \
      --components=factsheet \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Shut down any Cognos Analytics service instances before you shut down the service.

      1. Run the following command to list all of the Cognos Analytics service instances on the cluster:
        oc get caserviceinstance --all-namespaces

        Identify the service instances that are associated with the instance of Cognos Analytics that you want to shut down.

      2. For each service instance that is associated with the instance of Cognos Analytics that you want to shut down, run the following command to shut down the service instance.
        Each time that you run the command, replace the following values:
        • Replace <instance-id> with the appropriate ID from the list of service instances.
        • Replace <instance-namespace> with the namespace where the service instance is deployed.
        oc patch caserviceinstance <instance-id> \
        --namespace <instance-namespace> \
        --patch '{"spec":{"shutdown":"true"}}' \
        --type=merge
      3. Run the following command to shut down the Cognos Analytics service:
        cpd-cli manage shutdown \
        --components=cognos_analytics \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Note: You can also run the cpd-cli manage shutdown command with the --force option set to true to shut down all instances and the service.
      Restart

      Restart the Cognos Analytics service and then restart the service instances that are associated with the service.

      1. Run the following command to restart the Cognos Analytics service:
        cpd-cli manage restart \
        --components=cognos_analytics \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
        Note: Any instances that were shut down forcibly are automatically restarted.
      2. Run the following command to list all of the Cognos Analytics service instances on the cluster:
        oc get caserviceinstance --all-namespaces

        Identify the service instances that are associated with the instance of Cognos Analytics that you want to restart.

      3. For each instance, run the following command to restart the Cognos Analytics service instance.
        Each time that you run the command, replace the following values:
        • Replace <instance-id> with the appropriate ID from the list of service instances.
        • Replace <instance-namespace> with the namespace where the service instance is deployed.
        oc patch caserviceinstance <instance-id> \
        --namespace <instance-namespace> \
        --patch '{"spec":{"shutdown":"false"}}' \
        --type=merge
    • Shut down

      Run the following command to shut down the Cognos Dashboards service:

      cpd-cli manage shutdown \
      --components=dashboard \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Cognos Dashboards service:

      cpd-cli manage restart \
      --components=dashboard \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Before you begin: Get the name of the Data Refinery custom resource:
      oc get DataRefinery --namespace=${PROJECT_CPD_INST_OPERANDS}
      Shut down

      Run the appropriate command for your environment:

      The name of the Data Refinery custom resource is datarefinery-cr
      oc patch DataRefinery datarefinery-cr \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
      The name of the Data Refinery custom resource is datarefinery-sample
      oc patch DataRefinery datarefinery-sample \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --patch '{"spec":{"shutdown":"true"}}' \
      --type=merge
      Restart

      Run the appropriate command for your environment:

      The name of the Data Refinery custom resource is datarefinery-cr
      oc patch DataRefinery datarefinery-cr \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge
      The name of the Data Refinery custom resource is datarefinery-sample
      oc patch DataRefinery datarefinery-sample \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --patch '{"spec":{"shutdown":"false"}}' \
      --type=merge
    • Shut down

      Run the following command to shut down the DataStage service:

      cpd-cli manage shutdown \
      --components=datastage_ent \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the DataStage service:

      cpd-cli manage restart \
      --components=datastage_ent \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Before you can shut down the Db2 service, you must shut down all instances. For instructions, see Shutting down and restarting a Db2 instance.

      When all instances are shut down, run the following command to shut down the Db2 service:

      cpd-cli manage shutdown \
      --components=db2oltp \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Note: You can forcibly shut down the service and all running instances by including --force=true when you run the cpd-cli manage shutdown command.
      Restart

      Run the following command to restart the Db2 service:

      cpd-cli manage restart \
      --components=db2oltp \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Note: Any instances that were shut down forcibly are automatically restarted.
    • Shut down

      Shut down the Db2 Big SQL service instances before you shut down the service.

      1. Run the following command to get the list of Db2 Big SQL service instance IDs:
        oc get cm \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        -l component=db2bigsql \
        -o custom-columns="Instance Id:{.data.instance_id}, \
        InstanceName:{.data.instance_name}, \
        Created:{.metadata.creationTimestamp}"
      2. For each service instance, run the following command to shut down the Db2 Big SQL service instance.

        Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

        oc patch bigsql bigsql-<instance-id> \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"true"}}' \
        --type=merge
        Note: If you run this command with the true option, you might still interrupt workloads. Running queries might fail before the graceful shutdown deadline. Ensure that workloads are complete before you shut down the service instance.
      3. Run the following command to shut down the Db2 Big SQL service:
        cpd-cli manage shutdown \
        --components=bigsql \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Restart the Db2 Big SQL service and then restart the service instances.

      1. Run the following command to restart the Db2 Big SQL service:
        cpd-cli manage restart \
        --components=bigsql \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      2. Run the following command to get the list of Db2 Big SQL service instance IDs:
        oc get cm \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        -l component=db2bigsql \
        -o custom-columns="Instance Id:{.data.instance_id}, \
        InstanceName:{.data.instance_name}, \
        Created:{.metadata.creationTimestamp}"
      3. For each service instance, run the following command to restart the Db2 Big SQL service instance.

        Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

        oc patch bigsql bigsql-<instance-id> \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"false"}}' \
        --type=merge
    • Shut down

      Shut down the Db2 Data Gate service instances before you shut down the service.

      1. Run the following command to list all of the service instances in the project where Db2 Data Gate is installed:
        oc get datagateinstanceservices --namespace ${PROJECT_CPD_INST_OPERANDS}
      2. For each service instance, run the following command to shut down the Db2 Data Gate service instance.

        Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

        oc patch datagateinstanceservices <instance-id> \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"true"}}' \
        --type=merge
      3. Run the following command to shut down the Db2 Data Gate service:
        oc patch datagateservices datagateservice-cr \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"true"}}' \
        --type=merge
      Restart

      Restart the Db2 Data Gate service and then restart the service instances.

      1. Run the following command to restart the Db2 Data Gate service:
        oc patch datagateservices datagateservice-cr \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"false"}}' \
        --type=merge
      2. Run the following command to list all of the service instances in the project where Db2 Data Gate is installed:
        oc get datagateinstanceservices --namespace ${PROJECT_CPD_INST_OPERANDS}
      3. For each service instance, run the following command to restart the Db2 Data Gate service instance.

        Each time that you run the command, replace <instance-id> with the appropriate ID from the list of service instances.

        oc patch datagateinstanceservices <instance-name> \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"false"}}' \
        --type=merge
    • Shut down

      Shut down the Db2 Data Management Console service instance before you shut down the service.

      1. Run the following command to shut down the Db2 Data Management Console service instance:

        oc patch dmc data-management-console \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"true"}}' \
        --type=merge
      2. Run the following command to shut down the Db2 Data Management Console service:
        cpd-cli manage shutdown \
        --components=dmc \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Restart the Db2 Data Management Console service and then restart the service instances.

      1. Run the following command to restart the Db2 Data Management Console service:
        cpd-cli manage restart \
        --components=dmc \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      2. Run the following command to restart the Db2 Data Management Console service instance:

        oc patch dmc data-management-console \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec":{"shutdown":"false"}}' \
        --type=merge
    • Shut down

      Before you can shut down the Db2 Warehouse service, you must shut down all instances. For instructions, see Shutting down and restarting a Db2 Warehouse.

      When all instances are shut down, run the following command to shut down the Db2 Warehouse service:

      cpd-cli manage shutdown \
      --components=db2wh \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Note: You can forcibly shut down the service and all running instances by including --force=true when you run the cpd-cli manage shutdown command.
      Restart

      Run the following command to restart the Db2 Warehouse service:

      cpd-cli manage restart \
      --components=db2wh \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Note: Any instances that were shut down forcibly are automatically restarted.
    • Shut down

      Run the following command to shut down the Decision Optimization service:

      cpd-cli manage shutdown \
      --components=dods \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Decision Optimization service:

      cpd-cli manage restart \
      --components=dods \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down
      Restriction: EDB Postgres does not fully shut down. When you try to shut down EDB Postgres, it continues to run, but pods are reduced to their minimum supported configuration.

      Run the following command to scale down the EDB Postgres service:

      oc patch CPDEdbInstance <yourEDBInstanceName> \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --type=merge \
      --patch '{"spec": {"shutdown": true}}'
      Restart
      Run the following command to restart the EDB Postgres service:
      oc patch CPDEdbInstance <yourEDBInstanceName> \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --type=merge \
      --patch '{"spec": {"shutdown": false}}'
    • Shut down

      Run the following command to shut down the Execution Engine for Apache Hadoop service:

      cpd-cli manage shutdown \
      --components=hee \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Execution Engine for Apache Hadoop service:

      cpd-cli manage restart \
      --components=hee \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Run the following command to shut down the IBM Match 360 with Watson service:

      oc patch mdm mdm-cr \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --type=merge \
      --patch '{"spec": {"shutdown": "true"}}'
      Restart

      Run the following command to restart the IBM Match 360 with Watson service:

      oc patch mdm mdm-cr \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --type=merge \
      --patch '{"spec": {"shutdown": "false"}}'
    • Shut down

      Run the following command to shut down the MANTA Automated Data Lineage service:

      cpd-cli manage shutdown \
      --components=mantaflow \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the MANTA Automated Data Lineage service:

      cpd-cli manage restart \
      --components=mantaflow \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Ensure that you shut down any OpenPages service instances before you shut down the service.

      Run the following command to shut down an OpenPages instance or service. Replace <service_or_instance> with openpages to shut down the service or openpages_instance to shut down an instance. Use --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME} in the command only when you need to specify the instance name because the instance does not use the default name.

      cpd-cli manage shutdown --components=<service_or_instance> --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME}
      Restart

      Restart the OpenPages service and then restart the service instances that are associated with the service.

      Run the following command to restart an OpenPages instance or service. Replace <service_or_instance> with openpages to restart the service or openpages_instance to restart an instance. Use --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME} in the command only when you need to specify the instance name because the instance doesn't use the default name.

      cpd-cli manage restart --components=<service_or_instance> --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} --extra-vars=cr_name=${OPENPAGES_INSTANCE_NAME}
      You can include the --tethered_instance_ns argument to specify an instance namespace when you use the cpd-cli manage restart command to restart OpenPages instances that are installed in tethered projects.
    • Shut down

      Shut down any Planning Analytics service instances before you shut down the service.

      1. Run the following command to list all of the Planning Analytics service instances on the cluster:
        oc get paserviceinstance --all-namespaces

        Identify the service instances that are associated with the instance of Planning Analytics that you want to shut down.

      2. For each service instance that is associated with the instance of Planning Analytics that you want to shut down, run the following command to shut down the service instance.
        Each time that you run the command, replace the following values:
        • Replace <instance-id> with the appropriate ID from the list of service instances.
        • Replace <instance-namespace> with the namespace where the service instance is deployed.
        oc patch paserviceinstance <instance-id> \
        --namespace <instance-namespace> \
        --patch '{"spec":{"shutdown":"true"}}' \
        --type=merge
      3. Run the following command to shut down the Planning Analytics service:
        cpd-cli manage shutdown \
        --components=planning_analytics \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Restart the Planning Analytics service and then restart the service instances that are associated with the service.

      1. Run the following command to restart the Planning Analytics service:
        cpd-cli manage restart \
        --components=planning_analytics \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      2. Run the following command to list all of the Planning Analytics service instances on the cluster:
        oc get paserviceinstance --all-namespaces

        Identify the service instances that are associated with the instance of Planning Analytics that you want to restart.

      3. For each instance, run the following command to restart the Planning Analytics service instance.
        Each time that you run the command, replace the following values:
        • Replace <instance-id> with the appropriate ID from the list of service instances.
        • Replace <instance-namespace> with the namespace where the service instance is deployed.
        oc patch paserviceinstance <instance-id> \
        --namespace <instance-namespace> \
        --patch '{"spec":{"shutdown":"false"}}' \
        --type=merge
    • Shut down

      Run the following command to shut down the Product Master service:

      cpd-cli manage shutdown \
      --components=productmaster_instance \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Product Master service:

      cpd-cli manage restart \
      --components=productmaster_instance \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Run the following command to shut down the RStudio Server Runtimes service:

      cpd-cli manage shutdown \
      --components=rstudio \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the RStudio Server Runtimes service:

      cpd-cli manage restart \
      --components=rstudio \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Run the following command to shut down the SPSS Modeler service:

      cpd-cli manage shutdown \
      --components=spss \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the SPSS Modeler service:

      cpd-cli manage restart \
      --components=spss \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down
      1. Go to the project where Watson Assistant is installed:
        oc project ${PROJECT_CPD_INST_OPERANDS}
      2. Export the name of your Watson Assistant instance as an environment variable:
        export INSTANCE=`oc get wa -n ${PROJECT_CPD_INST_OPERANDS} |grep -v NAME| awk '{print $1}'`
      3. Run the following command to shut down the Watson Assistant service instance:

        oc patch wa ${INSTANCE} \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --patch '{"spec": {"shutdown": true}}' \
        --type=merge
      Restart

      Run the following command to restart the Watson Assistant service instance:

      oc patch wa ${INSTANCE} \
      --namespace ${PROJECT_CPD_INST_OPERANDS} \
      --patch '{"spec": {"shutdown": false}}' \
      --type=merge
    • Shut down

      Run the following command to shut down the Watson Discovery service:

      cpd-cli manage shutdown \
      --components=watson_discovery \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Watson Discovery service:

      cpd-cli manage restart \
      --components=watson_discovery \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Run the following command to shut down the Watson Machine Learning service:

      cpd-cli manage shutdown \
      --components=wml \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Watson Machine Learning service:

      cpd-cli manage restart \
      --components=wml \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down
      Run the following command to shut down the Watson Machine Learning Accelerator service:
      cpd-cli manage shutdown \
      --components=wml_accelerator \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart
      Run the following command to restart the Watson Machine Learning Accelerator service:
      cpd-cli manage restart \
      --components=wml_accelerator \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down
      cpd-cli manage shutdown \
      --components=openscale \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Watson OpenScale service.

      cpd-cli manage restart \
      --components=openscale \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Run the following command to shut down the Watson Pipelines service:

      cpd-cli manage shutdown \
      --components=ws_pipelines \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Watson Pipelines service:

      cpd-cli manage restart \
      --components=ws_pipelines \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down

      Shut down the Watson Query service instance before you shut down the service.

      1. Shut down the Watson Query service instance:
        1. Set the INSTANCE_PROJECT to the project where the service instance exists:
          • If the service instance is in the operands project, run:
            export INSTANCE_PROJECT=${PROJECT_CPD_INST_OPERANDS}
          • If the service instance is in a tethered project, run:
            export INSTANCE_PROJECT=${PROJECT_CPD_INSTANCE_TETHERED}
            Important: If multiple tethered projects are associated with this instance of Cloud Pak for Data, make sure that the ${PROJECT_CPD_INSTANCE_TETHERED} environment variable is set to the correct project name before you run the export command:
            echo $PROJECT_CPD_INSTANCE_TETHERED
        2. Run the following command to shut down the Watson Query service instance:
          oc patch bigsql db2u-dv \
          --namespace ${INSTANCE_PROJECT} \
          --patch '{"spec": {"shutdown": "true"}}' \
          --type=merge
          Note: If you run this command with the true option, you might still interrupt workloads. Running queries might fail before the graceful shutdown deadline. Ensure that workloads are complete before you shut down the service instance.
      2. Run the following command to shut down the Watson Query service:
        cpd-cli manage shutdown \
        --components=dv \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}

        4.7.3 or later You can include the --tethered_instance_ns=<project-name> argument to shut down an instance in a tethered project.

        4.7.0, 4.7.1, and 4.7.2 If you use the --tethered_instance_ns=<project-name> argument, you might encounter an issue where the service shuts down successfully even if instances in tethered namespaces are not shut down. For more information, see Limitations and known issues for Watson Query.

      Restart

      Restart the Watson Query service and then restart the service instance:

      1. Run the following command to restart the Watson Query service:
        cpd-cli manage restart \
        --components=dv \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      2. Restart the Watson Query service instances:
        1. Set the INSTANCE_PROJECT to the project where the service instance exists:
          • If the service instance is in the operands project, run:
            export INSTANCE_PROJECT=${PROJECT_CPD_INST_OPERANDS}
          • If the service instance is in a tethered project, run:
            export INSTANCE_PROJECT=${PROJECT_CPD_INSTANCE_TETHERED}
            Important: If multiple tethered projects are associated with this instance of Cloud Pak for Data, make sure that the ${PROJECT_CPD_INSTANCE_TETHERED} environment variable is set to the correct project name before you run the export command:
            echo $PROJECT_CPD_INSTANCE_TETHERED
          • Run the following command to restart the Watson Query service instance:
            oc patch bigsql db2u-dv \
            --namespace ${INSTANCE_PROJECT} \
            --type=merge \
            --patch '{"spec": {"shutdown": "false"}}'
    • Shut down

      Run the following command to shut down the Watson Speech services:

      cpd-cli manage shutdown \
      --components=watson_speech \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Note: When the Watson Speech services are shut down, the PostgreSQL server process stops. However, the PostgreSQL pods that are associated with the Watson Speech services remain in Running state.
      Restart

      Run the following command to restart the Watson Speech services:

      cpd-cli manage restart \
      --components=watson_speech \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down
      Shut down only the Watson Studio service

      Run the following command to shut down the Watson Studio service:

      cpd-cli manage shutdown \
      --components=ws \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Shut down the Watson Studio service and its dependencies

      Data Refinery is a dependency of the Watson Studio service. You might need to complete additional steps to shut down the Data Refinery service when you shut down the Watson Studio service.

      1. Get the name of the Data Refinery custom resource:
        oc get DataRefinery --namespace=${PROJECT_CPD_INST_OPERANDS}
      2. If the name of the Data Refinery custom resource is datarefinery-sample, create a file named refinery-cr.yaml in your work directory with the following content:
        override_components_meta:
          datarefinery:
            cr_name: datarefinery-sample
      3. Run the appropriate command based on the name of the Data Refinery custom resource:
        The name of the Data Refinery custom resource is datarefinery-cr
        cpd-cli manage shutdown \
        --components=ws \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
        --include_dependency=true
        The name of the Data Refinery custom resource is datarefinery-sample
        cpd-cli manage shutdown \
        --components=ws \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
        --include_dependency=true \
        --param-file=/tmp/work/refinery-cr.yaml
      Restart

      Run the following command to restart the Watson Studio service:

      Restart only the Watson Studio service

      Run the following command to shut down the Watson Studio service:

      cpd-cli manage restart \
      --components=ws \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart the Watson Studio service and its dependencies

      Data Refinery is a dependency of the Watson Studio service. You might need to complete additional steps to restart the Data Refinery service when you restart the Watson Studio service.

      1. Get the name of the Data Refinery custom resource:
        oc get DataRefinery --namespace=${PROJECT_CPD_INST_OPERANDS}
      2. If the name of the Data Refinery custom resource is datarefinery-sample, create a file named refinery-cr.yaml in your work directory with the following content:
        override_components_meta:
          datarefinery:
            cr_name: datarefinery-sample
      3. Run the appropriate command based on the name of the Data Refinery custom resource:
        The name of the Data Refinery custom resource is datarefinery-cr
        cpd-cli manage restart \
        --components=ws \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
        --include_dependency=true
        The name of the Data Refinery custom resource is datarefinery-sample
        cpd-cli manage restart \
        --components=ws \
        --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
        --include_dependency=true \
        --param-file=/tmp/work/refinery-cr.yaml
    • Shut down

      Run the following command to shut down the Watson Studio Runtimes service:

      cpd-cli manage shutdown \
      --components=ws_runtimes \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
      Restart

      Run the following command to restart the Watson Studio Runtimes service:

      cpd-cli manage restart \
      --components=ws_runtimes \
      --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    • Shut down
      Complete the following steps to shut down the watsonx.data service.
      To shut down the watsonx.data service, you must shut down the following components of the service:
      • wxdEngine, which provides the Presto engines.
      • wxd, which provides the watsonx.data service instance.
      • wxdAddon, which provides the watsonx.data service.

      When the watsonx.data service is shutdown, the PostgreSQL server process stops. However, the PostgreSQL pods that are associated with watsonx.data instance remain in Running state.

      Tip: If you are running multiple Presto engines and you want to free up resources without shutting down the entire service, you can shut down some of the Presto engines.
      1. Shut down the Presto engines:
        1. Get the name of the Presto engines:
          oc get wxdengine \
          --namespace=${PROJECT_CPD_INST_OPERANDS}

          The command returns one or more Presto engines.

        2. For each engine that you want to shut down, run the following command.

          Replace <engine-name> with the name of engine to shut down.

          oc patch wxdEngine <engine-name> \
          --namespace ${PROJECT_CPD_INST_OPERANDS} \
          --type=merge \
          --patch '{"spec":{"shutdown":"true"}}'
      2. Run the following command to shut down the service instance (the wxd component):
        oc patch wxd lakehouse \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --type=merge \
        --patch '{"spec":{"shutdown":"true"}}'
      3. Run the following command to shut down the service (the wxdAddon component):
        oc patch wxdAddon wxdaddon \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --type=merge \
        --patch '{"spec":{"shutdown":"true"}}'
      Restart
      Complete the following steps to restart the watsonx.data service.
      To restart the watsonx.data service, you must restart the following components of the service:
      • wxdAddon, which provides the watsonx.data service.
      • wxd, which provides the watsonx.data service instance.
      • wxdEngine, which provides the Presto engines.
      1. Run the following command to restart the service (the wxdAddon component):
        oc patch wxdAddon wxdaddon \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --type=merge \
        --patch '{"spec":{"shutdown":"false"}}'
      2. Run the following command to restart the service instance (the wxd component):
        oc patch wxd lakehouse \
        --namespace ${PROJECT_CPD_INST_OPERANDS} \
        --type=merge \
        --patch '{"spec":{"shutdown":"false"}}'
      3. Restart the Presto engines:
        1. Get the name of the Presto engines:
          oc get wxdengine \
          --namespace=${PROJECT_CPD_INST_OPERANDS}

          The command returns one or more Presto engines.

        2. For each engine that you want to restart, run the following command.

          Replace <engine-name> with the name of engine to shut down.

          oc patch wxdEngine <engine-name> \
          --namespace ${PROJECT_CPD_INST_OPERANDS} \
          --type=merge \
          --patch '{"spec":{"shutdown":"false"}}'
  3. If you shut down all services that are running on the Cloud Pak for Data control plane, except for the Scheduling service, if it is installed, you can shut down the Cloud Pak for Data control plane as needed.
    Shut down

    Run the following command to shut down the control plane:

    cpd-cli manage shutdown \
    --components=cpd_platform \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
    Important: The control plane must restart to the same status it was in before it was shut down. Do not change the spec of the control plane custom resource, perform upgrades, or perform rollbacks while the control plane is shut down.
    Restart
    Note: If you installed the Scheduling service, you must restart it before you restart the control plane. See Step 4.

    Run the following command to restart the control plane:

    cpd-cli manage restart \
    --components=cpd_platform \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS}
  4. If you installed the Scheduling service, you must shut it down after you shut down all other services and the control plane, and you must restart it before you restart the control plane and any other services.
    Shut down
    1. Run the following command to shut down the scheduling service:
      oc patch Scheduling ibm-cpd-scheduler \
      --namespace ${PROJECT_SCHEDULING_SERVICE} \
      --type=merge \
      --patch '{"spec": {"shutdown": "true"}}'
    2. After you shut down the scheduling service, delete any pending pods that are waiting to be scheduled by the scheduling service. When the pods restart, they are scheduled by the default OpenShift scheduler.
      1. Run the following command to see which projects have pods that are under the control of the scheduling service:
        oc get po -A --no-headers | while read namespace name ready status misc; do
          schedulerName=`oc get po -n$namespace $name -o=jsonpath="{.spec.schedulerName}"`
          if [ "$schedulerName" == "ibm-cpd-scheduler" -a "$status" == "Pending" ]; then
            echo "$namespace"
          fi
        done | sort -u

        The command returns a list of projects.

      2. For each project returned by the preceding command, complete the following steps:
        1. Change to the project:
          oc project project-name
        2. Run the command to list the pending pods in the project that are still under the control of the scheduling service:
          oc get po --no-headers | while read name ready status misc; do
           schedulerName=`oc get po $name -o=jsonpath='{.spec.schedulerName}'`
           if [ "$schedulerName" == "ibm-cpd-scheduler" -a $status == "Pending" ]; then
            echo "Pod $name is pending, and schedulerName is set to ibm-cpd-scheduler"
           fi
          done

          The command returns a list of pods. If the command does not return any pods, there are no pending pods that need to be restarted in this project.

        3. Run the following command to delete the pods:
          oc get po --no-headers | while read name ready status misc; do
           schedulerName=`oc get po $name -o=jsonpath='{.spec.schedulerName}'`
           if [ "$schedulerName" == "ibm-cpd-scheduler" -a $status == "Pending" ]; then
            oc delete po $name
           fi
          done
        4. Repeat the preceding steps for each project that was returned in the output for step 1.
    Restart

    Run the following command to restart the scheduling service

    oc patch Scheduling ibm-cpd-scheduler \
    --namespace ${PROJECT_SCHEDULING_SERVICE} \
    --type=merge \
    --patch '{"spec": {"shutdown": "false"}}'