Controller Node:
1. sudo apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient
2. sudo vi /etc/nova/nova.conf
[database]
connection = mysql://nova:NOVA_DBPASS@controller/nova
[DEFAULT]
...
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASS
[DEFAULT]
...
my_ip = 10.0.0.11 (controller_node_ip)
vncserver_listen = 10.0.0.11 (controller_node_ip)
vncserver_proxyclient_address = 10.0.0.11 (controller_node_ip)
3. sudo rm /var/lib/nova/nova.sqlite
4. 创建数据库
mysql -u root -p
CREATE DATABASE nova;
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
5. sudo -s /bin/sh -c "nova-manage db sync" nova
6. 创建用户
keystone user-create --name=nova --pass=NOVA_PASS --email=nova@example.com
keystone user-role-add --user=nova --tenant=service --role=admin
7. sudo vi /etc/nova/nova.conf
[DEFAULT]
...
auth_strategy = keystone
[keystone_authtoken]
...
auth_uri = http://controller:5000
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASS
8.
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
9. 重启服务
sudo service nova-api restart
sudo service nova-cert restart
sudo service nova-consoleauth restart
sudo service nova-scheduler restart
sudo service nova-conductor restart
sudo service nova-novncproxy restart
10. nova image-list
Compute Node:
1. sudo apt-get install nova-compute-kvm
2. sudo vi /etc/nova/nova.conf
[DEFAULT]
...
auth_strategy = keystone
...
rpc_backend = rabbit
rabbit_host = controller
rabbit_password = RABBIT_PASS
...
my_ip = 10.0.0.31 (Compute Node IP)
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = 10.0.0.31 (Compute Node IP)
novncproxy_base_url = http://controller:6080/vnc_auto.html
...
glance_host = controller
[database]
# The SQLAlchemy connection string used to connect to the database
connection = mysql://nova:NOVA_DBPASS@controller/nova
[keystone_authtoken]
auth_uri = http://controller:5000
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = NOVA_PASS
3. 检测服务器是否支持虚拟化
egrep -c '(vmx|svm)' /proc/cpuinfo
若结果不为零,则继续进行下一步;若为零,需将/etc/nova/nova-compute.conf里的virt_type置为qemu
4. sudo rm /var/lib/nova/nova.sqlite
5. sudo service nova-compute restart