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

 openstack-nova-console openstack-nova-novncproxyopenstack-nova-scheduler \

 python-novaclient

 

 

openstack-config --set /etc/nova/nova.conf \
  database connection mysql://nova:novapw@controller/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 192.168.1.210
 
# openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_listen 192.168.1.210
 
# openstack-config --set /etc/nova/nova.conf DEFAULT vncserver_proxyclient_address 192.168.1.210

 

 

update user setpassword=password(mysqlpq) where user="root";

flushprivileges;

//嘿嘿,密码又错了。

 

$ mysql -u root –p
 
mysql> CREATE DATABASE nova;
 
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY 'novapw';
 
 
mysql> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY 'novapw';
su -s /bin/sh -c "nova-manage db sync" nova

 

 

 

$ keystone user-create --name=nova --pass=novapw--email=nova@example.com
Property |              Value               |
+----------+----------------------------------+
|  email   |         nova@example.com         |
| enabled  |               True               |
|    id    | 787d036231834cc0883519e510c26f56 |
|   name   |               nova               |
| username |               nova
 
 
 
$ keystone user-role-add --user=nova --tenant=service --role=admin

 

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

 

 

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

 

 

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

 

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 novapw
 
keystone service-create --name=nova --type=compute \
  --description="OpenStack Compute"
  Property  |              Value               |
+-------------+----------------------------------+
| description |        OpenStack Compute         |
|   enabled   |               True               |
|      id     | f7faf529f1264108bf47eeb46a466155 |
|     name    |               nova               |
|     type    |             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
 
   Property  |                  Value                  |
+-------------+-----------------------------------------+
|   adminurl  | http://controller:8774/v2/%(tenant_id)s |
|      id     |     b145da08e2f644d9a32633e6e3da8ffa    |
| internalurl | http://controller:8774/v2/%(tenant_id)s |
|  publicurl  | http://controller:8774/v2/%(tenant_id)s |
|    region   |                regionOne                |
|  service_id |     f7faf529f1264108bf47eeb46a466155
 
 
service openstack-nova-api start
 
service openstack-nova-cert start
 
 
service openstack-nova-consoleauth start
service openstack-nova-scheduler start
 
service openstack-nova-conductor start
 
service openstack-nova-novncproxy start
 
 
# 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
 
 
nova p_w_picpath-list
 
| ID                                   | Name                | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| a02518d3-5bfc-4bc4-93e1-f2e9b73e9aa1 | cirros-0.3.0-x86_64 | ACTIVE |        |
 
 
 

 Configure a compute node

1 , Installthe Compute packages:

# yum install openstack-nova-compute
 
2, Edit the /etc/nova/nova.conf configuration file:
 
# openstack-config --set /etc/nova/nova.conf database connection mysql://nova:novapw@controller/nova
 
# openstack-config --set /etc/nova/nova.conf DEFAULT auth_strategy keystone
 
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_uri http://controller:5000
# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_host controller
# 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 novapw
 
 
3, Configure the Compute service to use the Qpid message broker by setting these configuration keys:
 
# openstack-config --set /etc/nova/nova.conf \
  DEFAULT rpc_backend qpid
 
# openstack-config --set /etc/nova/nova.conf DEFAULT qpid_hostname controller
 
4, Configure Compute to provide remote console access to instances.
 
# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.1.212
# 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 192.168.1.212
# openstack-config --set /etc/nova/nova.conf \
  DEFAULT novncproxy_base_url http://controller:6080/vnc_auto.html
 
5, Specify the host that runs the Image Service.
 
# openstack-config --set /etc/nova/nova.conf DEFAULT glance_host controller
 
6, You must determine whether your system's processor and/or hypervisor support hardware acceleration for virtual machines.
# egrep -c '(vmx|svm)' /proc/cpuinfo
0

If this command returns a value of zero, your system does not supporthardware acceleration and you must configure libvirt to use QEMU instead of KVM.

a.    Run the following command:

# openstack-config --set /etc/nova/nova.conf libvirt virt_type qemu
 
7
 
# service libvirtd start
# service messagebus start
# chkconfig libvirtd on
# chkconfig messagebus on
# service openstack-nova-compute start
# chkconfig openstack-nova-compute on