1.保证节点的nova用户id gid相同
[root@compute ~]# id nova
uid=162(nova) gid=162(nova) groups=162(nova),99(nobody),107(qemu)
[root@controller ~]# id nova
uid=162(nova) gid=162(nova) groups=162(nova),99(nobody),107(qemu)
如果不相同着修改uid,gid:
# [root@compute ~]# usermod -u uid nova XXX
# [root@compute ~]# gropumod -g gid nova XXX
2.修改libvirt配置文件
vim /etc/sysconfig/libvirtd
LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
LIBVIRTD_ARGS="--listen"
vim /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
auth_tcp = "none"
grep -vE '^#|^$' /etc/libvirt/libvirtd.conf
两个节点都重启服务:systemctl restart libvirtd.service
两个节点都检查端口:ss -ntl | grep 16509
再来测试下可否无密连接
virsh -c qemu+tcp://compute/system
3.修改nova.conf配置文件,使其允许迁移。
vi /etc/nova/nova.conf
[libvirt]
inject_key = True
live_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_TUNNELLED
block_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_NON_SHARED_INC
live_migration_downtime = 500
live_migration_downtime_steps = 10
live_migration_downtime_delay = 75
systemctl restart openstack-nova-compute libvirtd.service
4.开始迁移
nova show test
nova live-migration 02e0808d-dae1-42e9-ae91-0e0a00f0f524 compute