Could not make the Query. Virtualizor Error

Today, when I opened a Virtualizor panel for a VM node, I found an issue like the following:

Could not make the Query.
SELECT tasks.actid, tasks.action, users.uid, users.email FROM `tasks` LEFT JOIN users on tasks.uid = users.uid WHERE action NOT IN ('vpsbackups_plan_email', 'send_background_mail', 'backuply_vpsbackups_plan_email') ORDER BY tasks.actid DESC LIMIT 10
Array
(
    [0] => HY000
    [1] => 144
    [2] => Table './virtualizor/tasks' is marked as crashed and last (automatic?) repair failed

Issue was the tasks table is marked as crashed. To solve this, we need to repair the table tasks.

First, find the password for database ‘virtualizor’ using the following command:

[root@sg40 ~]# grep dbpass /usr/local/virtualizor/universal.php
$globals['dbpass'] = 'gziqr4y989';

Now connect to the mysql using the password:

/usr/local/emps/bin/mysql -u root -p virtualizor

Now repair the table:

use virtualizor;
REPAIR TABLE tasks;

Now the virtualizor shall work.

How To Run a Command in All OpenVZ Containers

You can run single command in a container using the following:

vzctl exec 201 service httpd status

How to find out all the VZ containers:

vzlist -a

The other way? Yes, there is. VZ list is stored inside a file /proc/vz/veinfo, and we can use it with the help of shell to run command in each VZ as following:

for i in `cat /proc/vz/veinfo | awk '{print $1}'|egrep -v '^0$'`; \
do echo "Container $i"; vzctl exec $i <your command goes here>; done

An example, can be the following:

for i in `cat /proc/vz/veinfo | awk '{print $1}'|egrep -v '^0$'`; \
do echo "Container $i"; vzctl exec $i service httpd status; done

This should show all the httpd status of the VZ.