Zhang Qian
2010-May-11 08:40 UTC
[libvirt-users] Can not restore domain from a shared state file
Hi, I have two KVM host: h1 and h2, both of them mount an NFS directory as a shared storage. I can save (virsh save <domain> <file>) a domain in h1 to a state file in the shared storage successfully, but failed to restore it from h2 with the following error message: # virsh restore testRes.dat error: Failed to restore domain from testRes.dat error: operation failed: failed to start VM I can always restore it from h1, but sometimes works for h2 (wait for a while, then "virsh restore" command may succeed in h2). I guess the state file generated by "virsh save" command is not intact from h2 point view, may be cause by the cache of NFS server? Any suggestions will be really appreciated, thanks in advance! Regards, Qian -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20100511/a4eaa289/attachment.htm>
Zhang Qian
2010-May-11 10:52 UTC
[libvirt-users] Can not restore domain from a shared state file
I found that waiting for a while does not work, but if I tried to restore it from h2 more times, it will work. For example, if I save a domain which has 512MB memory, and restore if from h2 repeatedly, at the third time, the restore can succeed, but for a 256MB domain, it will succeed at the second time. 2010/5/11 Zhang Qian <zhq527725 at gmail.com>> Hi, > > I have two KVM host: h1 and h2, both of them mount an NFS directory as a > shared storage. > I can save (virsh save <domain> <file>) a domain in h1 to a state file in > the shared storage successfully, but failed to restore it from h2 with the > following error message: > # virsh restore testRes.dat > error: Failed to restore domain from testRes.dat > error: operation failed: failed to start VM > > I can always restore it from h1, but sometimes works for h2 (wait for a > while, then "virsh restore" command may succeed in h2). I guess the state > file generated by "virsh save" command is not intact from h2 point view, may > be cause by the cache of NFS server? > > Any suggestions will be really appreciated, thanks in advance! > > > Regards, > Qian > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20100511/d5ef848f/attachment.htm>
Laine Stump
2010-May-12 04:55 UTC
[libvirt-users] Can not restore domain from a shared state file
On 05/11/2010 04:40 AM, Zhang Qian wrote:> Hi, > > I have two KVM host: h1 and h2, both of them mount an NFS directory as > a shared storage. > I can save (virsh save <domain> <file>) a domain in h1 to a state file > in the shared storage successfully, but failed to restore it from h2 > with the following error message: > # virsh restore testRes.dat > error: Failed to restore domain from testRes.dat > error: operation failed: failed to start VM > > I can always restore it from h1, but sometimes works for h2 (wait for > a while, then "virsh restore" command may succeed in h2). I guess the > state file generated by "virsh save" command is not intact from h2 > point view, may be cause by the cache of NFS server?There is a race condition in qemu when restarting a domain - it is possible for qemu to start the CPU before the domain image has been read from the file (this is regardless of where the file is stored). This may or may not be your problem (the error condition I saw due to this race was different from what you are seeing). It is easy to test for though - before saving your domain, first suspend it with "virsh suspend <domain>", then save it; after you've restored the domain with "virsh restore <image-file>", resume the domain with "virsh resume <domain>". If the domain successfully resumes, your problem was the race I describe. If not, you have found a different problem. I'm interested to know if this solves your problem.