Hi,
I am using libvirt version 0.10.1 and qemu-kvm version 1.2.0 with RHEL 6.3
When I use libvirt API to make block migrate with a VM, it failed
frequently. I check the migrated VM and found that the filesystem damaged.
But sometimes it works very fine, I don't know why, it seems to be random.
All failed tests have the same condition, image transfer incompletely in
live migration. The image I used is 10GB size, after a failed migration it
has only about 400MB to 3GB in remote host.
Here is the code:
import libvirt
from xml.dom import minidom
name = "vm-01"
host = libvirt.open("qemu:///system")
vm = host.lookupByNmae(name)
vm_xml_file = "/etc/libvirt/qemu/%s.xml" % name
vm_xml = minidom.parse(vm_xml_file).documentElement.toxml()
remote_host = "qemu+ssh://host02/system"
remote = libvirt.open(remote_host)
try:
vm.migrate2(remote, vm_xml, 89, name, None, 0)
except Exception,e:
print str(e)
Before run the code I have already create a image for migration in remote
host 'host02'. Path, size, and privilege all OK.
Here is the related log:
in source host 'host01':
2012-11-24 05:14:40.001+0000: 24888: warning :
qemuDomainObjBeginJobInternal:838 : Cannot start job (query, none) for
domain wrksp-776; current job is (async nested, migration out) owned by
(24890, 24890) 2012-11-24 05:16:16.398+0000: 24888: error :
qemuDomainObjBeginJobInternal:842 : Timed out during operation: cannot
acquire state change lock
2012-11-24 05:16:21.317+0000: 24887: error : virNetSocketReadWire:1184 :
End of file while reading data: Input/output error
in remote host 'host02':
2012-11-24 05:14:00.776+0000: 11065: warning :
qemuDomainObjEnterMonitorInternal:993 : This thread seems to be the async
job owner; entering monitor without asking for a nested job is dangerous
2012-11-24 05:14:01.196+0000: 11065: warning :
qemuDomainObjEnterMonitorInternal:993 : This thread seems to be the async
job owner; entering monitor without asking for a nested job is dangerous
2012-11-24 05:14:01.198+0000: 11065: warning :
qemuDomainObjEnterMonitorInternal:993 : This thread seems to be the async
job owner; entering monitor without asking for a nested job is dangerous
2012-11-24 05:14:01.208+0000: 11065: warning :
qemuDomainObjEnterMonitorInternal:993 : This thread seems to be the async
job owner; entering monitor without asking for a nested job is dangerous
2012-11-24 05:14:01.211+0000: 11065: warning :
qemuDomainObjEnterMonitorInternal:993 : This thread seems to be the async
job owner; entering monitor without asking for a nested job is dangerous
I try to use command "virsh migrate vm-01 --live --copy-storage-all
--persistent --undefinesource qemu+ssh://host02/system --verbose", the
test results have no change, common but not regular.
Even after my once successful test, it will certainly fail when I try to
make a second migrate with the same VM.
How can I solve this problem? Anything is helpful.
Thanks.