OpenStack云主机热迁移至其他计算节点-(热)

确认两个节点的nova用户id一样:
  • 保证两个节点的nova用户uid,gid相同,可使用id nova命令查看。

修改libvirt配置文件:
  • 注意:两个节点都需要修改
[root@compute-1 ~]# egrep -v  '^$|^#' /etc/sysconfig/libvirtd
LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
LIBVIRTD_ARGS="--listen"

--------------------------------------------------------------------------------

[root@compute-2 ~]# egrep -v  '^$|^#' /etc/sysconfig/libvirtd
LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf
LIBVIRTD_ARGS="--listen"
[root@compute-1 ~]# grep -vE '^#|^$' /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
auth_tcp = "none"

--------------------------------------------------------------------------------

[root@compute-2 ~]# grep -vE '^#|^$' /etc/libvirt/libvirtd.conf
listen_tls = 0
listen_tcp = 1
auth_tcp = "none"
重启libvirtd服务:
[root@compute-1 ~]# systemctl restart libvirtd.service
[root@compute-2 ~]# systemctl restart libvirtd.service
[root@compute-1 ~]# netstat -tunpl|grep 16509
tcp        0      0 0.0.0.0:16509           0.0.0.0:*               LISTEN      21666/libvirtd      
tcp6       0      0 :::16509                :::*                    LISTEN      21666/libvirtd

--------------------------------------------------------------------------------

[root@compute-2 ~]# netstat -tunpl|grep 16509
tcp        0      0 0.0.0.0:16509           0.0.0.0:*               LISTEN      20576/libvirtd      
tcp6       0      0 :::16509                :::*                    LISTEN      20576/libvirtd
测试下可否无密连接KVM:
[root@compute-1 ~]# virsh -c qemu+tcp://compute-2/system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # exit

--------------------------------------------------------------------------------

[root@compute-2 ~]# virsh -c qemu+tcp://compute-1/system
Welcome to virsh, the virtualization interactive terminal.

Type:  'help' for help with commands
       'quit' to quit

virsh # exit
修改nova.conf配置文件:
  • 注意:两个节点都需要修改
[root@compute-1 ~]# vim /etc/nova/nova.conf
[libvirt]
virt_type = qemu
inject_key = True
live_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
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

--------------------------------------------------------------------------------

[root@compute-2 ~]# vim /etc/nova/nova.conf
[libvirt]
virt_type = qemu
inject_key = True
live_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE
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
重启nova服务:
[root@compute-1 ~]# systemctl restart openstack-nova-compute.service
[root@compute-2 ~]# systemctl restart openstack-nova-compute.service
开始实例热迁移:
  • 不知为什么使用命令进行实例热迁移会没有效果,以下使用dashboard面板操作。

「点点赞赏,手留余香」

    还没有人赞赏,快来当第一个赞赏的人吧!
0 条回复 A 作者 M 管理员
    所有的伟大,都源于一个勇敢的开始!
欢迎您,新朋友,感谢参与互动!欢迎您 {{author}},您在本站有{{commentsCount}}条评论
高级运维 中级运维 运维简历 运维简历 DB简历
加入我们
  • 站长QQ:885097398 一键联系
  • 扫一扫加站长QQ
    Linux运维交流群