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):
2. Switch to superuser:
sudo su -
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")
Please refer to the BOSH documentation for more details on Bosh tasks.