Monday, March 26, 2012

virsh - VM won't start

I have seen this quite a bit now. On my Scientific Linux 6.2 box running lots of KVM VM's I go to start up a VM using virsh and it doesn't start. I trawl through the VM's log in /var/log/libvirtd/qemu and the error is often a bit vague, but the most recent one said this;

Unknown ramblock "", cannot accept migration

It's kind of a useless piece of information until my brain clicks and remembers that the VM in question was running last time I shut down the server and SL's libvirt shutdown script tells all running VMs to effectively suspend. The theory is that when you reboot, the VM 'resumes' and is back where you left it. I find this resume is pretty much 50/50 that it actually works. I always end up dropping the suspend info and forcing the VM to do a clean boot. The magic virsh command to get it to drop the suspend info is;

managedsave-remove

So in virsh you do something like;

virsh# managedsave-remove <the-vm>

Then you should be able to start it;

virsh# start <the-vm>

It reminds me I need to work out how to get libvirt to try to shut the VMs down rather than suspending them.