OS : Debian11

Objectif : Rebooter son serveur quand cela semble impossible

1) Ce qu'il m'est arrivé

Alerte, des VM sont indisponibles! C'est ce que m'indique Zabbix. Heureusement, SSH est toujours accessible, je peux me connecter dessus. En investiguant je constate que le load average (commande top) est à plus de 50%, et augmente doucement, inéluctablement.

Check des logs :

Jul 12 06:25:46 slippy kernel: [679799.858794] watchdog: BUG: soft lockup - CPU#14 stuck for 26s! [migration/14:100]
Jul 12 06:31:38 slippy kernel: [680151.882288] watchdog: BUG: soft lockup - CPU#21 stuck for 354s! [kvm:3451051]
Jul 12 07:02:06 slippy kernel: [681979.900430] watchdog: BUG: soft lockup - CPU#21 stuck for 2057s! [kvm:3451051]
Jul 12 08:01:26 slippy kernel: [685539.915749] watchdog: BUG: soft lockup - CPU#14 stuck for 5372s! [migration/14:100]
Jul 12 10:00:26 slippy kernel: [692679.986607] watchdog: BUG: soft lockup - CPU#14 stuck for 12022s! [migration/14:100]

Ok, c'est pas glop

2) Premières actions

Ok, check des FileSystem? rien n'est full, y a de la place.

On va délester des VM pour alléger la charge:

qm shutdown 123

qm shutdown 234

Oh oh, ça n’arrête pas les VM. Chaud...

On va y aller plus brutalement au risque de corrompre des bases de données:

qm stop 123

qm stop 234

Ça passe. Ouf! Mais la charge ne baisse pas... même après avoir tout stoppé.

3) Ok, dans le doute, reboot

reboot

Non mon pote, je suis vraiment très occupé.

shutdown -r -f

Même pas en rêve, je suis vraiment trop occupé.

J'ai attendu, attendu, Zaï Zaï Zaï Zaï.

4) Du coup, on fait comment là?

Et bien on fait ça:

To force the kernel to reboot the system we will be making use of the magic SysRq key.
The magic_SysRq_key provides a means to send low level instructions directly to the kernel via the /proc virtual file system.

To enable the use of  the magic SysRq option type the following at the command prompt:

    echo 1 > /proc/sys/kernel/sysrq

Then to reboot the machine simply enter the following:

    echo b > /proc/sysrq-trigger

C'est radical, efficace, sans avertissement, ça reboot. Fin.