Openstack,nova主机要修改/etc/hosts
[root@openstack ~]# cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.6.126 openstack
192.168.6.164 nova
修改openstack主机上的answer.ini文件中的98行和102行
[root@openstack ~]# vim answer.ini
CONFIG_COMPUTE_HOSTS=192.168.6.126,192.168.6.164
# List of servers on which to install the network service such as
# Compute networking (nova network) or OpenStack Networking (neutron).
CONFIG_NETWORK_HOSTS=192.168.6.126,192.168.6.164
[root@openstack ~]# packstack --answer-file=answer.ini
Welcome to the Packstack setup utility
The installation log file is available at: /var/tmp/packstack/20180725-074943-N6JSe6/openstack-setup.log
Installing:
Clean Up [ DONE ]
Discovering ip protocol version [ DONE ]
[email protected]'s password:
Setting up ssh keys
[root@nova ~]# ifconfig | head -3
eth0: flags=4163
inet 192.168.6.164 netmask 255.255.255.0 broadcast 192.168.6.255
inet6 fe80::5054:ff:fef7:ded0 prefixlen 64 scopeid 0x20
[root@openstack ~]# vim /etc/httpd/conf.d/15-horizon_vhost.conf
WSGIApplicationGroup %{GLOBAL}
WSGIScriptAlias /dashboard "/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi"
[root@openstack ~]# apachectl graceful
[root@openstack ~]# ls
anaconda-ks.cfg ifcfg-eth0 rh6.img
answer.ini keystonerc_admin RPM-GPG-KEY-CentOS-7
[root@openstack ~]# cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=2250e0cbc9b34b31
export OS_AUTH_URL=http://192.168.6.126:5000/v2.0
export PS1='[\u@\h \W(keystone_admin)]\$ '
export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne
修改admin的登录密码
[root@openstack ~]# vim keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD=redhat
export OS_AUTH_URL=http://192.168.6.126:5000/v2.0
export PS1='[\u@\h \W(keystone_admin)]\$ '
export OS_TENANT_NAME=admin
export OS_REGION_NAME=RegionOne
云主机热迁移
[root@openstack ~]# virsh list
Id 名称 状态
----------------------------------------------------
2 instance-00000015 running
3 instance-0000001b running
[root@openstack ~]#
[root@nova ~]# virsh list
Id 名称 状态
----------------------------------------------------
[root@nova ~]#
在编辑云主机中选择云主机热迁移
[root@nova ~]# virsh list
Id 名称 状态
----------------------------------------------------
1 instance-0000001b running
[root@openstack ~]# virsh list
Id 名称 状态
----------------------------------------------------
2 instance-00000015 running
此时的主机已经由openstack变成了nova,完成了热迁移
排错:
[root@openstack ~]# grep -Pv "^(#|$)" /etc/nova/nova.conf | grep openstack
vncserver_proxyclient_address=openstack
[root@openstack system]# cd /usr/lib/systemd/system
[root@openstack system]# systemctl restart openstack-nova-console