How to access CCNG console and retrieve the task status
search cancel

How to access CCNG console and retrieve the task status

book

Article ID: 435601

calendar_today

Updated On:

Products

VMware Tanzu Platform - Cloud Foundry

Issue/Introduction

Users have multiple ways to check the task status including the followings:

You can find more detailed information regarding the above methods in How to track failed tasks.

In this article, we aim to introduce an alternative method to check the task status using queries on CCNG console.

Resolution

Steps to connect to CCNG console:

  1. bosh -e <bosh-env> -d <tas-deployment> ssh cloud_controller/0
  2. sudo -i
  3. cd /var/vcap/jobs/cloud_controller_ng
  4. bin/console

Some example queries:

  • The query to get the total count of PENDING tasks.
    • TaskModel.where(state: TaskModel::PENDING_STATE).where(Sequel.lit('created_at < ?', 1.hour.ago)).count
  • The query to get the total count of FAILED tasks.
    • TaskModel.where(state: TaskModel::FAILED_STATE).where(Sequel.lit('created_at < ?', 1.hour.ago)).count
  • The query to get the total memory being consumed by PENDING tasks.
    • TaskModel.where(state: TaskModel::PENDING_STATE).where(Sequel.lit('created_at < ?', 1.hour.ago)).sum(:memory_in_mb)

Some example query outputs for reference:

cloud_controller/SOME-GUID:/var/vcap/jobs/cloud_controller_ng# bin/console
[1] pry(VCAP::CloudController)> TaskModel.where(state: TaskModel::PENDING_STATE).where(Sequel.lit('created_at < ?', 1.hour.ago)).count
=> 1

[2] pry(VCAP::CloudController)> TaskModel.where(state: TaskModel::FAILED_STATE).where(Sequel.lit('created_at < ?', 1.hour.ago)).count
=> 40

[3] pry(VCAP::CloudController)> TaskModel.where(state: TaskModel::PENDING_STATE).where(Sequel.lit('created_at < ?', 1.hour.ago)).sum(:memory_in_mb)
=> 1024