问题现象
执行nova live-migration --block-migrate uuid
热迁移虚机失败。
问题定位
执行nova migration-list --instance-uuid <uuid>
确定迁移源节点、目标节点。
检查源节点nova-compute
服务日志,发现如下报错:
txt
ERROR nova.virt.libvirt.driver [req-01e02130-dbff-4c60-b35c-2a6922a2b95b req-a5e3dbcf-1358-45af-bda4-d450fabe6bfd 9d2ac2da5c9d45438493daec30280a3d eef10a485d6f4b74ad27600f25dbe452 - default default] [instance: 86d8b8e0-70a1-4444-ad4a-36362ca6b539] Live Migration failure: Requested operation is not valid: domain has active block job: libvirtError: Requested operation is not valid: domain has active block job
检查目标节点nova-compute
服务日志,未发现异常信息。
根据源节点报错提示domain has active block job
可知迁移失败的原因为虚机有活跃的卷任务,执行nova show <uuis>
确定虚机的domain及宿主机,至虚机所在宿主机执行如下命令:
shell
$ sudo virsh domblklist <domain>
Target Source
------------------------------------------------
hda /var/lib/nova/instances/86d8b8e0-70a1-4444-ad4a-36362ca6b539/disk.config
sda ebs_ceph_cache_sys/volume-3e7460c3-bf48-4a83-ab2c-3a054eb12fbb
sdb ebs_ceph_data/volume-42fd198f-9a43-4a25-9dda-3ebaf1119201
$ sudo virsh blockjob <domain> sda --info
No current block job for sda
$ sudo virsh blockjob <domain> sdb --info
Block Copy: [ 99 %]
可见sdb
有卷拷贝任务正在执行,执行nova volume-attachments <uuid>
确定sdb
的volume id
,继续执行cinder show <volume id>
确定该卷有热迁移任务卡死。
问题解决
至虚机宿主机执行如下命令,强制终止卷迁移任务:
shell
sudo virsh blockjob <domain> sdb --abort
再次执行虚机热迁移成功。