1、创建数据库 [iyunv@controller ~]# mysql -u root -p -e "CREATE DATABASEnova;" Enter password: [iyunv@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ONnova.* TO 'nova'@'localhost' IDENTIFIED BY 'nova';" Enter password: [iyunv@controller ~]# mysql -u root -p -e "GRANT ALL PRIVILEGES ONnova.* TO 'nova'@'%' IDENTIFIED BY 'nova';" Enter password: 2、安装nova [iyunv@controller ~]# yum install -y openstack-nova-apiopenstack-nova-cert \ openstack-nova-conductor openstack-nova-console \ openstack-nova-novncproxy openstack-nova-scheduler \ python-novaclient 3、配置nova 3.1、同步数据库 [iyunv@controller ~]# vim /etc/nova/nova.conf 2212 connection=mysql://nova:nova@192.168.1.11/nova [iyunv@controller ~]# su -s /bin/sh -c "nova-manage db sync"nova 3.2、配置使用rabbimq [iyunv@controller ~]# vim /etc/nova/nova.conf 61 rpc_backend=rabbit 3949 rabbit_host=192.168.1.11 3953 rabbit_port=5672 3965 rabbit_userid=openstack 3969 rabbit_password=openstack 3.3、配置连接keystone 3.3.1、创建用户 [iyunv@controller ~]# openstack user create --domain default--password=nova nova +-----------+----------------------------------+ | Field | Value | +-----------+----------------------------------+ | domain_id | default | | enabled | True | | id |f53595ae167e40f99d13c7014e89d129 | | name | nova | +-----------+----------------------------------+ [iyunv@controller ~]# openstack role add --project service --user novaadmin 3.3.2、连接keystone [iyunv@controller ~]# vim /etc/nova/nova.conf 425 auth_strategy=keystone 2540 [keystone_authtoken] 2541 auth_uri = http://192.168.1.11:5000 2542 auth_url = http://192.168.1.11:35357 2543 auth_plugin = password 2544 project_domain_id = default 2545 user_domain_id = default 2546 project_name = service 2547 username = nova 2548 password = nova 配置启动网络支持 [iyunv@controller ~]# vim /etc/nova/nova.conf 1053 network_api_class=nova.network.neutronv2.api.API 1171linuxnet_interface_driver=nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver 3.3.3、设置安全组 [iyunv@controller ~]# vim /etc/nova/nova.conf 1331 security_group_api=neutron 1759 firewall_driver=nova.virt.firewall.NoopFirewallDriver 3.3.4、配置连接vnc [iyunv@controller ~]# vim /etc/nova/nova.conf 124 my_ip=192.168.1.11 1827 vncserver_listen=$my_ip 1831 vncserver_proxyclient_address=$my_ip 3.3.5、配置连接glance [iyunv@controller ~]# vim /etc/nova/nova.conf 2333 host=$my_ip 3.3.6、其它配置 [iyunv@controller ~]# vim /etc/nova/nova.conf 268 enabled_apis=osapi_compute,metadata //去掉ec2 3794 lock_path=/var/lib/nova/tmp //锁路径 4、启动nova [iyunv@controller ~]# systemctl enable openstack-nova-api.service \ openstack-nova-cert.service \ openstack-nova-consoleauth.service \ openstack-nova-scheduler.service \ openstack-nova-conductor.service \ openstack-nova-novncproxy.service [iyunv@controller ~]# systemctl start openstack-nova-api.service \ openstack-nova-cert.service \ openstack-nova-consoleauth.service \ openstack-nova-scheduler.service \ openstack-nova-conductor.service \ openstack-nova-novncproxy.servic 5、注册nova服务 [iyunv@controller ~]# openstack service create --name nova --description"OpenStack Compute" compute +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Compute | | enabled | True | | id |04090a0c01b04e4f99dc4d6bac0ff2ab | | name | nova | | type | compute | +-------------+----------------------------------+ [iyunv@controller ~]# openstack endpoint create --region RegionOne computepublic http://192.168.1.11:8774/v2/%\(tenant_id\)s +--------------+-------------------------------------------+ | Field | Value | +--------------+-------------------------------------------+ | enabled | True | | id |5a26b6043c804a71bcd58da2eca649c7 | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id |04090a0c01b04e4f99dc4d6bac0ff2ab | | service_name | nova | | service_type | compute | | url |http://192.168.1.11:8774/v2/%(tenant_id)s | +--------------+-------------------------------------------+ root@controller ~]# openstack endpoint create --region RegionOne computeinternal http://192.168.1.11:8774/v2/%\(tenant_id\)s +--------------+-------------------------------------------+ | Field | Value | +--------------+-------------------------------------------+ | enabled | True | | id | 9e63e12071f44ded8ec0f34c1f8d69ab | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 04090a0c01b04e4f99dc4d6bac0ff2ab | | service_name | nova | | service_type | compute | | url |http://192.168.1.11:8774/v2/%(tenant_id)s | +--------------+-------------------------------------------+ [iyunv@controller ~]# [iyunv@controller ~]# openstack endpoint create --region RegionOne computeadmin http://192.168.1.11:8774/v2/%\(tenant_id\)s +--------------+-------------------------------------------+ | Field | Value | +--------------+-------------------------------------------+ | enabled | True | | id |ff0f0a2109a04e698d7dddac85700a1f | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id |04090a0c01b04e4f99dc4d6bac0ff2ab | | service_name | nova | | service_type | compute | | url |http://192.168.1.11:8774/v2/%(tenant_id)s | +--------------+-------------------------------------------+ 6、查看验证 [iyunv@controller ~]# openstack host list +------------+-------------+----------+ | Host Name | Service | Zone | +------------+-------------+----------+ | controller | consoleauth | internal | | controller | scheduler |internal | | controller | cert |internal | | controller | conductor |internal | +------------+-------------+----------+
|