psm jcs scale-in

This command removes a managed server from a cluster, scaling-in the Oracle Java Cloud Service instance by one node.

With this command, you can:
  • Remove one node in the WLS application cluster

  • Remove the secondary OTD node (if Oracle Traffic Director is provisioned as a local load balancer)

  • Remove one node in the WLS caching (data grid) cluster

You cannot scale in a service instance:
  • If the instance was provisioned at the Virtual Image (BASIC) service level

  • If a snapshot of the instance has already been taken

When you are scaling in a service instance that uses IP reservations (application cluster nodes only), the IP reservation associated with the removed node is released but not deleted.

See Scaling In an Oracle Java Cloud Service Cluster in Administering Oracle Java Cloud Service.

Syntax

psm jcs scale-in -s|--service-name serviceName 
    -c|--config-payload pathToJson
      [-of|-–output-format json|html|short]
      [-wc|--wait-until-complete true|false] 

Parameters

All parameters are required unless otherwise noted.

Parameter Description
-s|--service-name serviceName Name of the Oracle Java Cloud Service instance.
-c|—config-payload Specifies the path to the JSON file containing the information necessary to scale-in a Java Cloud Service instance. The format of this file, as shown in Sample Payload, is the same as the request body you provide when scaling in a Java Cloud Service instance by using the REST API. For information about this format, see the Request/Body (scalein-putrequestm) section of Scale In a Service Instance in the REST API for Oracle Java Cloud Service.
-of|-–output-format json|html|short (Optional) Output format of the command’s response:

Accepted values: json, html, short

The default output format is the one you specified when using the psm setup command to configure the psm CLI.

-wc|--wait-until-complete true|false

(Optional) A boolean value that, when set to true, makes the command behave synchronously; that is, it does not return until the submitted job is complete. The following message is displayed until the job is complete:
Waiting for the job to complete... (it cannot be cancelled)
Default: false

Sample Payload

{
   "components": {
      "WLS": {
         "hosts": ["exampleinstance-wls-2"]
      }
   },
   "force": true
} 

Examples

$ psm jcs scale-in -s Example1Instance -c  -c c://home/templates/scale-in-payload.json -of json
{
    "details":{
        "jobId":"34206",
        "message":"JAAS-SCALING-044: Scaling in Job (ID: 34206) server name [Examp_server_2] submitted for service [Example1Instance]"
    },
    "status":"New"
}
Job ID : 34206 

Note that this command returned a job ID. To see the status of your scale-out operation, use this ID with the psm jcs operation-status command:

$ psm jcs operation-status -j 34206 -of json

When you see the message:

   "operationId":364,
   "operationType":"SCALE_IN",
   "resourceId":1073,
   "resourceName":"example1instance-wls-2",
   "resourceType":"VM",
   "serverType":"WLS",
   "serviceId":364,
   "serviceName":"Example1Instance",
   "serviceType":"jaas",
   "startDate":"2016-04-28T18:21:27.539+0000",
   "status":"SUCCEED",
   "summaryMessage":"Examp_server_2"

the service was successfully scaled-in.