- To change the status of a Running Task, use the fail-tasks command of the cell management tool on one Cell in the cluster after shutting down the Cloud Director service on all Cells.
Details on how to use the fail-tasks command are outlined in the Cloud Director documentation here: Update the Failure Status of a Task .
- The Cloud Director service can be started again on the Cells after running the command.
If the fail-tasks command of the Cell Management Tool, or a restart of the Cloud Director services on all Cells, does not resolve the issue, then you can manually fail the tasks.
- Ensure the Cloud Director service vmware-vcd is stopped on ALL Cells.
- Take a backup of the Cloud Director database, Backup and Restore of VMware Cloud Director Appliance.
- SSH to Primary Cell of the affected site.
- Connect to the Cloud Director database:
sudo -u postgres psql vcloud;
- Check for Tasks and Objects that remain in a Running or Busy state:
SELECT * FROM jobs WHERE status IN (0,1);
SELECT * FROM last_jobs WHERE status IN (0,1);
SELECT * FROM task WHERE job_id IN (SELECT job_id FROM jobs WHERE status IN (0,1));
SELECT * FROM busy_object WHERE task_id IN (SELECT id FROM task WHERE job_id IN (SELECT job_id FROM jobs WHERE status IN (0,1)));
- Delete the busy_object and task table entries to clear the busy state of the affected objects, and set the jobs and last_jobs entries to mark the Task as failed. Use the job_id of the specific Task you wish to fail, which was found above:
DELETE FROM busy_object WHERE task_id = (SELECT id FROM task WHERE job_id = 'xxx');
DELETE FROM task WHERE job_id = 'xxx';
UPDATE jobs SET status = 3 WHERE job_id = 'xxx';
UPDATE last_jobs SET status = 3 WHERE job_id = 'xxx';
- While the vmware-vcd service is stopped on all Cells and a database backup has been taken, then the complete suite of activity and scheduler tables can be cleared:
TRUNCATE TABLE activity;
TRUNCATE TABLE scheduled_activity_jobs;
TRUNCATE TABLE activity_pc_queue;
TRUNCATE TABLE activity_pc_event_queue;
TRUNCATE TABLE fifo_activity_queue;
TRUNCATE TABLE task_activity_queue;
TRUNCATE TABLE vc_activity_queue;
TRUNCATE TABLE activity_stats_queue;
TRUNCATE TABLE activity_vsm_listener_queue;
- Restart the vmware-vcd service on the Cells and confirm the affected Tasks are no longer running but have changed to a failed state.