在我中止实时迁移后,作业类型已更改为“已取消”,这使我无法再次迁移。因此,如果某些 libvirt api(或 QMP)可以帮助我将作业类型从“已取消”更改为“无”。
# virsh domjobabort DOMAIN
# virsh domjobinfo DOMAIN
Job type: Cancelled
Operation: Outgoing migration
# virsh migrate DOMAIN qemu+tcp://{ip}/system tcp://{ip} --live --p2p --auto-converge --unsafe --copy-storage-all --xml test.xml
error: Timed out during operation: cannot acquire state change lock (held by monitor=remoteDispatchDomainMigratePerform3Params)
如果我销毁 DOMAIN 并重新启动它(作业类型变为“无”)。迁移运行良好。我不想重新启动 Doman :)
版本信息:libvirt:6.5.0 qemu:5.0.0 系统:CentOS8,内核4.18
2020-12-25
我再次尝试使用 virsh 命令,但令我惊讶的是,问题没有再次发生。它似乎工作正常(中止后,域可以迁移!)。这真的让我很困惑:virsh 和 go-libvirt 不是使用相同的 api 吗?
[root@ubuntu ~]# virsh migrate GUS447978da-04e8-4e9e-88cf-547309f9bbc5 qemu+tcp://{ip}/system tcp://{ip} --live --p2p --auto-converge --unsafe --copy-storage-all --xml test.xml --verbose
Migration: [ 27 %]error: operation aborted: migration out: canceled by client
### abort the job in other terminal
[root@ubuntu ~]# virsh domjobinfo GUS447978da-04e8-4e9e-88cf-547309f9bbc5
Job type: None
[root@ubuntu ~]# virsh migrate GUS447978da-04e8-4e9e-88cf-547309f9bbc5 qemu+tcp://{ip}/system tcp://{ip} --live --p2p --auto-converge --unsafe --copy-storage-all --xml test.xml --verbose
Migration: [ 4 %]error: operation aborted: migration out: canceled by client
### abort the job in other terminal
[root@ubuntu ~]# virsh domjobinfo GUS447978da-04e8-4e9e-88cf-547309f9bbc5
Job type: None
[root@ubuntu ~]# virsh migrate GUS447978da-04e8-4e9e-88cf-547309f9bbc5 qemu+tcp://{ip}/system tcp://{ip} --live --p2p --auto-converge --unsafe --copy-storage-all --xml test.xml
error: operation aborted: migration out: canceled by client
[root@ubuntu ~]# virsh domjobinfo GUS447978da-04e8-4e9e-88cf-547309f9bbc5
Job type: None
[root@ubuntu ~]# virsh migrate GUS447978da-04e8-4e9e-88cf-547309f9bbc5 qemu+tcp://{ip}/system tcp://{ip} --live --p2p --auto-converge --unsafe --copy-storage-all --xml test.xml
error: operation aborted: migration out: canceled by client
### abort the job in other terminal
[root@ubuntu ~]# virsh domjobinfo GUS447978da-04e8-4e9e-88cf-547309f9bbc5
Job type: None
答案1
重新启动 libvirtd 服务可能有助于清除卡住的作业状态