Pivotal Knowledge Base


How to Cancel All Queued BOSH Tasks Using director_ctl


Pivotal Cloud Foundry all versions


This article shows how to use director_ctl to cancel all queued Bosh tasks.


If there are tasks timing out or failing and too many bosh tasks are queued for the director, it is very difficult to cancel individual tasks using the command bosh cancel task <#>.


Warning- Make sure you are absolutely certain that the queued tasks are not affecting any ongoing deployments. These steps will cancel all queued tasks and may leave some deployments in an inconsistent state.

Follow these steps:

    1. Login to BOSH Director VM using vcap credentials (vcap credentials can be found on the Ops manager Director tile - Credentials tab):

ssh vcap@<Director_IP>

    2. Switch to superuser:

sudo su -

    3. Enter director_ctl console:

/var/vcap/jobs/director/bin/director_ctl console

    4. Count number of queued tasks:

irb(main):001:0> Bosh::Director::Models::Task.where(state: "queued").count

    5. Cancel all the queued Bosh tasks:

irb(main):002:0> Bosh::Director::Models::Task.where(state: "queued").update(state: "cancelling")

Additional Information

Please refer to the BOSH documentation for more details on Bosh tasks.


Powered by Zendesk