Error restoring domain: operation failed: failed to read qemu header

本文详细介绍了在虚拟机运行过程中因主机意外断电导致无法正常启动的问题,并提供了有效的解决步骤。通过删除损坏的保存文件并强制重新启动虚拟机,可以解决由断电引起的错误。此外,文章还解释了虚拟机状态保存和恢复的过程,以及如何避免此类问题的再次发生。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Error restoring domain: operation failed: failed to read qemu header

 

主机意外 断电 ,在重启 系统后 ,里面运行的kvm 主机无法启动 ,报错:

Error restoring domain: operation failed: failed to read qemu header

 

 

google 找到如下描述:


Are you restoring via 'virsh restore path/to/file', or are you just
trying to start the guest with 'virsh start' or a similar action in
virt-manager?

If the former, then path/to/file is indeed corrupt; can you show us the
size of that file, as well as 'od -N 128 -tx1z path/to/file'?

If the latter, then you've uncovered a bug in the managedsave code
(which I will be fixing shortly) - we attempt to detect and unlink
corrupt managedsave files automatically, but in looking at the code, I
see I missed a code path - if the file is corrupt because it is too
short, then we fail to do the unlink(), making the problem perpetual.
If this is the case, then please give me the same output as requested in
the previous paragraph, but using /var/lib/libvirt/qemu/save/<dom>.save
as the path/to/file.

Then, after you have given me the details, you can work around the
problem by doing 'virsh start --force' to force a fresh boot (the save
file is already corrupt, so there is unfortunately no way to get the
runtime state of the guest back to what it was when you suspended your
host); hopefully your guest can fsck and recover gracefully from what
was in the virtual disks at the time of the host suspend

在主机关机过程中kvm会保存当前 kvm 虚机状态,下次开启kvm 的时候还原 主机,是一个suspend ,restore的过程 ,虚机的状态文件保存在/var/lib/libvirt/qemu/save/  下  ,因为意外断电,这个文件并没有完全记录 虚机状态 ,导致还原失败 ,解决方法:

rm -rf /var/lib/libvirt/qemu/save/virt-host.save

virsh  start  virt-host


转载来自:http://hi.baidu.com/doughtymild/item/f2cbe4fc7886296a3c1485cd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值