Updating a deployment: Checking on progress

edit

Updating a deployment: Checking on progress

edit

For smaller deployments, changes in the configuration of resources might take only a minute, but larger deployments might take quite a while, especially if data needs to be migrated to new nodes.

Switching to the ECE UI to check on progress is not feasible if you plan to use the RESTful API for automation, so the API also lets you check on the progress of changes when obtaining information about a deployment. Each resource contains an info field with the current plan (the current configuration), and potentially pending plans still to be applied.

This information can be obtained by querying the full deployment. To get information about just one of the resources in the deployment, specify its kind and ref_id:

curl -k -X GET -H "Authorization: ApiKey $ECE_API_KEY" https://$COORDINATOR_HOST:12443/api/v1/deployments/$DEPLOYMENT_ID/elasticsearch/$REF_ID
{
  "ref_id": "main-elasticsearch",
  "id": "2fe04b06af9042aea1bf5f46d6f46652",
  "region": "ece-region",
  "info": {
    "cluster_id": "2fe04b06af9042aea1bf5f46d6f46652",
    "cluster_name": "My First Elasticsearch and Kibana Deployment",
    "deployment_id": "4c93493c9532485ba500bb74e0bc44a6",
    "healthy": false,
    "status": "reconfiguring",
    "plan_info": {
      "healthy": true,
      "current": {
        "healthy": true,
        "plan": {
          "cluster_topology": [{
              "node_type": {
                "master": true,
                "data": true,
                "ingest": true
              },
              "instance_configuration_id": "data.default",
              "zone_count": 1,
              "size": {
                "value": 2048,
                "resource": "memory"
              }
            }
          ],
          "elasticsearch": {
            "version": "7.5.1"
          },
          "deployment_template": {
            "id": "default"
          }
        }
      },
      "pending": {
        "plan_attempt_id": "df7a0851-136b-46ee-b15a-96f801c35294",
        "healthy": true,
        "attempt_start_time": "2020-02-11T11:33:15.691Z",
        "plan": {
          "cluster_topology": [{
              "node_type": {
                "master": true,
                "data": true,
                "ingest": true
              },
              "instance_configuration_id": "kibana",
              "zone_count": 3,
              "size": {
                "value": 4096,
                "resource": "memory"
              }
            }
          ],
          "elasticsearch": {
            "version": "6.8.6"
          },
          "deployment_template": {
            "id": "default"
          }
        }
      }
    }
    ...
  }
}
REF_ID
The reference ID introduced when creating the resource. In our example, the value of ref_id is main-elasticsearch.

For each resource, an info field contains a plan_info field. Inside this object, the pending field shows the plan that is currently pending to be applied, in this case the plan from our previous example. After the configuration change completes, the pending field is replaced by a current field that shows the new configuration.

For long-running changes that might involve large clusters, this "yes" or "no" answer to the question whether there are still pending configuration changes might not always be sufficiently granular. If you need more detailed information, you can also get the activity log returned back to you:

curl -k -X GET -H "Authorization: ApiKey $ECE_API_KEY" https://$COORDINATOR_HOST:12443/api/v1/deployments/$DEPLOYMENT_ID?show_plan_logs=true
curl -k -X GET -H "Authorization: ApiKey $ECE_API_KEY" https://$COORDINATOR_HOST:12443/api/v1/deployments/$DEPLOYMENT_ID/elasticsearch/$REF_ID?show_plan_logs=true

Beware that the activity log can be quite long, as it lists every step in the deployment configuration process. To simplify the output, you can grep on "message": "Completed step: to get the highlights of how each step in the plan is getting applied. The output will look similar to this very abridged example:

"message": "Starting step: [plan-validator]: [cluster=ElasticsearchCluster(1e5675defe924b14af39136bd476fe36), stat=4294980506,4294980506,1544207967588,1544207967588,0,0,0,0,1403,0,4294980506\n]"
...
"message": "Plan successfully constructed: [PlanSuccessful()]"