Перейти к содержанию

Проблемы и ошибки, связанные с виртуальными машинами

Ошибка запуска ВМ

Ошибка задачи:

unsupported configuration: Emulator '/usb/bin/qemu-system-x86-64' does 
not support virt type 'kvm'

Решение: Скорее всего, процессор не поддерживает виртуализацию. Рекомендуется проверить процессорные инструкции на сервере, настройки BIOS, а в случае установки SpaceVM на ВМ проверить тип процессора и инструкции гипервизора.

Сетевая ошибка миграции ВМ

Ошибка задачи:

An error with retcode 1 occurred while migration: b'error: operation failed: 
migration out job: Unable to write to socket: Connection reset by peer\n

Решение: Скорее всего не хватает пропускной способности сети для миграции. Рекомендуется выбрать внешнюю сеть для миграции с большей пропускной способностью, например 10Гбит.

ВМ уходит в паузу

  • Посмотреть журнал ВМ в CLI сервера vm log {Имя или id ВМ} и попытаться разобраться там.
  • Попробовать использовать инструкцию Анализ крахов ВМ

Видео ошибка миграции ВМ

Ошибка задачи:

Unknown error: An error with retcode 1 occurred while migration: b''b''emu-system-x86_64: 
Failed to load qxl:pci 2021-12-13T05:56:31.887248Z qemu-system-x86_64: error while loading 
state for instance 0x0 of device '0000:00:02.0/qxl'

Решение: Ошибка миграции с видеоадаптером qxl. Рекомендуется сменить видеоадаптер.

Ошибка миграции спящей ВМ

Ошибка задачи:

Unknown error: An error with retcode 1 occurred while migration: b''b'' Migration: [ 55 %] Migration: 
[ 74 %] Migration: [ 85 %] Migration: [ 91 %] Migration: [ 97 %]
error: operation failed: domain is not running

Решение: Отсутствует на данный момент. Миграция ВМ в паузе может приводить к краху. Рекомендуется не мигрировать больше 1 раза подряд ВМ в паузе, то есть каждый раз после миграции необходимо включать её. Автоматически это делать не стали, так как это имхо странное поведение.

ВМ уходит в паузу сама

Решение: Проверьте наличие свободного места на пуле данных, где лежат диски ВМ.

Не работает загрузчик UEFI на OS Windows.

При установке чистой Windows вылетает синий экран из-за ошибки с памятью.

Решение: Проверьте, что тип ОС Windows и выберите чипсет q35.

Поиск и устранение неполадок

  • Установить gdb через CLI команду install gdb.

  • Установить qemu-system-x86-dbgsym через CLI команду install qemu-system-x86-dbgsym.

  • В файле /etc/libvirt/qemu.conf раскомментировать строку max_core = "unlimited" через команду system libvirt_set_unlimited. Она перезаписывается при обновлении.

  • Рестартовать сервис libvirtd

  • Файлы дампов крахов ВМ будут складироваться в /var/log/crash/, автоматически ротироваться и сжиматься.

  • Анализировать дампы крахов ВМ можно через gdb, например gdb /usr/bin/qemu-system-x86_64 /var/log/crash/qemu-system-x86_1640520577.dmp

  • Полученную информацию рекомендуется выслать вендору.

Пример команд CLI

node nodes_cli 'install gdb'
node nodes_cli 'install qemu-system-x86-dbgsym'
node nodes_cli 'system libvirt_set_unlimited'

Вызвать kernel panic в Linux

  • Вариант 1

:(){ :|:& };:

Вешает ВМ насмерть без регистрации kernel panic.

  • Вариант 2

echo 1 > /proc/sys/kernel/sysrq & echo c > /proc/sysrq-trigger

Вешает ВМ насмерть без регистрации kernel panic.

  • Вариант 3

Надо предварительно поставить gdb.

gdb -ex 'call _exit(0)' --pid=1 --batch

Форсированный ребут ВМ дал ошибку, но она перезагрузилась.

  • Вариант 4

dd if=/dev/urandom of=/proc/sysrq-trigger

ВМ перезагружается.

Use /proc/sysrq-trigger in linux

echoing letter commands to /proc/sysrq-trigger.

0 – disable sysrq completely
1 – enable all functions of sysrq
>1 – bitmask to allow specific sysrq functions
2 = 0x2 – enable control of console logging level
4 = 0x4 – enable control of keyboard (SAK, unraw)
8 = 0x8 – enable debugging dumps of processes etc.
16 = 0x10 – enable sync command
32 = 0x20 – enable remount read-only
64 = 0x40 – enable signalling of processes (term, kill, oom-kill)
128 = 0x80 – allow reboot/poweroff
256 = 0x100 – allow nicing of all RT tasks
Use magic SysRq key
Command Function
b   Will immediately reboot the system without syncing or unmounting your disks.
c   Will perform a system crash by a NULL pointer dereference. A crashdump will be taken if configured.
d   Shows all locks that are held.
e   Send a SIGTERM to all processes, except for init.
f   Will call the oom killer to kill a memory hog process, but do not panic if nothing can be killed.
g   Used by kgdb (kernel debugger)
h   Will display help
i   Send a SIGKILL to all processes, except for init.
j   Forcibly “Just thaw it” – filesystems frozen by the FIFREEZE ioctl.
k   Secure Access Key (SAK) Kills all programs on the current virtual console.
l   Shows a stack backtrace for all active CPUs.
m   Will dump current memory info to your console.
n   Used to make RT tasks nice-able
o   Will shut your system off (if configured and supported).
p   Will dump the current registers and flags to your console.
q   Will dump per CPU lists of all armed hrtimers (but NOT regular timer_list timers) and detailed information about all clockevent devices
r   Turns off keyboard raw mode and sets it to XLATE.
s   Will attempt to sync all mounted filesystems.
t   Will dump a list of current tasks and their information to your console.
u   Will attempt to remount all mounted filesystems read-only.
v   Forcefully restores framebuffer console
w   Dumps tasks that are in uninterruptable (blocked) state.
x   Used by xmon interface on ppc/powerpc platforms. Show global PMU Registers on sparc64. Dump all TLB entries on MIPS.
y   Show global CPU Registers [SPARC-64 specific]
z   Dump the ftrace buffer
0-9 Sets the console log level, controlling which kernel messages will be printed to your console. (0, for example would make it so that only emergency messages like PANICs or OOPSes would make it to your console.)