Controller:


yum install openstack-nova-api openstack-nova-cert openstack-nova-conductor \

openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler python-novaclient


配置nova的数据库连接:


openstack-config --set /etc/nova/nova.conf \

database connection mysql://nova:[email protected]/nova



openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend qpid

openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controller


openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.10

openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 10.0.0.10

openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.0.0.10


初始化nova数据库:


mysql -u root -popenstack

mysql> CREATE DATABASE nova;

mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \

IDENTIFIED BY 'openstack';

mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \

IDENTIFIED BY 'openstack';



创建nova数据库表:


su -s /bin/sh -c "nova-manage db sync" nova


keystone user-create --name=nova --pass=nova [email protected]

keystone user-role-add --user=nova --tenant=service --role=admin


配置nova服务的消息认证:


openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://10.0.0.10:5000

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host 10.0.0.10

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357

openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova

openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service

openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password nova



创建nova服务及端口:


keystone service-create --name=nova --type=compute \

--description="OpenStack Compute"

keystone endpoint-create \

--service-id=$(keystone service-list | awk '/ compute / {print $2}') \

--publicurl=http://controller:8774/v2/%\(tenant_id\)s \

--internalurl=http://controller:8774/v2/%\(tenant_id\)s \

--adminurl=http://controller:8774/v2/%\(tenant_id\)s


启动nova的相关服务,加入到开机启动


service openstack-nova-api restart

service openstack-nova-cert restart

service openstack-nova-consoleauth restart

service openstack-nova-scheduler restart

service openstack-nova-conductor restart

service openstack-nova-novncproxy restart

chkconfig openstack-nova-api on

chkconfig openstack-nova-cert on

chkconfig openstack-nova-consoleauth on

chkconfig openstack-nova-scheduler on

chkconfig openstack-nova-conductor on

chkconfig openstack-nova-novncproxy on

[root@controller ~]# nova-manage service list 

Binary           Host                                 Zone             Status     State Updated_At

nova-cert        controller                           internal         enabled    :-)   2015-07-08 12:39:23

nova-consoleauth controller                           internal         enabled    :-)   2015-07-08 12:39:24

nova-scheduler   controller                           internal         enabled    :-)   2015-07-08 12:39:25

nova-conductor   controller                           internal         enabled    :-)   2015-07-08 12:39:26


[root@controller ~]# nova p_w_picpath-list 

+--------------------------------------+--------------+--------+--------+

| ID                                   | Name         | Status | Server |

+--------------------------------------+--------------+--------+--------+

| 6b1bdf6b-6988-4e95-859e-d87b71049fca | CirrOS 0.3.0 | ACTIVE |        |

+--------------------------------------+--------------+--------+--------+


compute:


yum install openstack-nova-compute


配置nova的认证服务:

openstack-config --set /etc/nova/nova.conf database connection mysql://nova:[email protected]/nova

openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://10.0.0.10:5000

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host 10.0.0.10

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_protocol http

openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_port 35357

openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_user nova

openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_tenant_name service

openstack-config --set /etc/nova/nova.conf keystone_authtoken admin_password nova


配置nova使用的消息服务:


openstack-config --set /etc/nova/nova.conf DEFAULT rpc_backend qpid

openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controller


openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 10.0.0.30

openstack-config --set /etc/nova/nova.conf DEFAULT vnc_enabled True

openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 0.0.0.0

openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 10.0.0.30

openstack-config --set /etc/nova/nova.conf DEFAULT novncproxy_base_url http://10.0.0.10:6080/vnc_auto.html


openstack-config --set /etc/nova/nova.conf DEFAULT glance_host controller


判断你的电脑是否支持硬件加速化


egrep -c '(vmx|svm)' /proc/cpuinfo


返回为0  

openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu


返回为大于0的数:不做。


启动服务,加入到开机启动


service libvirtd restart

service messagebus restart

service openstack-nova-compute restart

chkconfig libvirtd on

chkconfig messagebus on

chkconfig openstack-nova-compute on


验证:

[root@controller ~]# nova-manage service list 

Binary           Host                                 Zone             Status     State Updated_At

nova-cert        controller                           internal         enabled    :-)   2015-07-08 14:32:40

nova-consoleauth controller                           internal         enabled    :-)   2015-07-08 14:32:42

nova-scheduler   controller                           internal         enabled    :-)   2015-07-08 14:32:43

nova-conductor   controller                           internal         enabled    :-)   2015-07-08 14:32:44

没有控制节点的nova-compute服务,解决办法:


重启controller节点的所有关于nova的服务,在重启控制节点的nova服务。


[root@controller ~]# nova-manage service list 

Binary           Host                                 Zone             Status     State Updated_At

nova-cert        controller                           internal         enabled    :-)   2015-07-08 23:57:10

nova-consoleauth controller                           internal         enabled    :-)   2015-07-08 23:57:12

nova-scheduler   controller                           internal         enabled    :-)   2015-07-08 23:57:04

nova-conductor   controller                           internal         enabled    :-)   2015-07-08 23:57:07

nova-compute     compute                              nova           enabled    :-)   2015-07-08 23:57:11