OpenStack:安装Nova

>安装Nova
1. 安装
# apt-get install nova-novncproxy novnc nova-api \
  nova-ajax-console-proxy nova-cert nova-conductor \
  nova-consoleauth nova-doc nova-scheduler \
  python-novaclient
删除sqlite文件
rm -f /var/lib/nova/nova.sqlite
2. 创建db
create database nova;
grant all privileges on nova.* to 'nova'@'%' identified by 'openstack';
grant all privileges on nova.* to 'nova'@'localhost' identified by 'openstack';

3. 创建user, role
# keystone user-create --name=nova --pass=openstack
# keystone user-role-add --user=nova --tenant=service --role=admin

4. 配置:
(1)配置/etc/nova/nova.conf :
[DEFAULT]
auth_strategy=keystone
rpc_backend = nova.rpc.impl_kombu
rabbit_host = controller
rabbit_password = openstack
my_ip=192.168.2.3

[database]
connection = mysql://nova:openstack@controller/nova
[keystone_authtoken]
auth_uri = http://controller:35357
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = openstack 

(2)配置/etc/nova/api-paste.ini:
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_uri = http://controller:35357/v2.0
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = openstack

5. 初始表:
# nova-manage db sync

6. 注册service, endpoint:
# keystone service-create \
--name=nova --type=compute \
--description="Nova Compute service"

# keystone endpoint-create \
--service-id=0c88f9f2a63142a7a01656e22f86b1d5 \
--publicurl=http://controller:8774/v2/%\(tenant_id\)s \
--internalurl=http://controller:8774/v2/%\(tenant_id\)s \
--adminurl=http://controller:8774/v2/%\(tenant_id\)s

6. 重启nova服务.
service nova-api restart
service nova-cert restart
service nova-consoleauth restart
service nova-scheduler restart
service nova-conductor restart
service nova-novncproxy restart

---------------------------------------------------
遗漏compute node部分:
1.安装
apt-get install nova-compute-qemu python-guestfs
#据说是kernel的某个BUG
dpkg-statoverride  --update --add root root 0644 /boot/vmlinuz-$(uname -r)

2. 配置:
(1)配置/etc/nova/nova.conf
[DEFAULT]
...
auth_strategy=keystone
my_ip=192.168.0.11
vnc_enabled=True
vncserver_listen=0.0.0.0
vncserver_proxyclient_address=192.168.0.11
novncproxy_base_url=http://controller:6080/vnc_auto.html
glance_host=controller
注意: 最后需要指定glance_host.

[database]
# The SQLAlchemy connection string used to connect to the database
connection = mysql://nova:NOVA_DBPASS@controller/nova

(2)配置/etc/nova/api-paste.ini
[filter:authtoken]
paste.filter_factory = keystoneclient.middleware.auth_token:filter_factory
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = openstack

最后的nova.conf, 包含nova-->keystone, nova-->glance, nova-->neutron的参数:
----------------------------------------------------
root@openstack:~# cat /etc/nova/nova.conf
[DEFAULT]
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/var/lock/nova
force_dhcp_release=True
iscsi_helper=tgtadm
libvirt_use_virtio_for_bridges=True
connection_type=libvirt
root_helper=sudo nova-rootwrap /etc/nova/rootwrap.conf
verbose=True
ec2_private_dns_show_ip=True
api_paste_config=/etc/nova/api-paste.ini
volumes_path=/var/lib/nova/volumes
enabled_apis=ec2,osapi_compute,metadata

auth_strategy=keystone
rpc_backend = nova.rpc.impl_kombu
rabbit_host = controller
rabbit_password = openstack
my_ip=192.168.2.3

glance_host = glance
image_service = nova.image.glance.GlanceImageService
glance_api_servers = glance:9292

neutron_metadata_proxy_shared_secret = openstack
service_neutron_metadata_proxy = True

network_api_class=nova.network.neutronv2.api.API
neutron_admin_username=neutron
neutron_admin_password=openstack
neutron_admin_auth_url=http://controller:35357/v2.0/
neutron_auth_strategy=keystone
neutron_admin_tenant_name=service
neutron_url=http://controller:9696/

libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtHybridOVSBridgeDriver
#linuxnet_interface_driver = nova.network.linux_net.LinuxOVSInterfaceDriver
# use security groups from neutron, disable nova's built-in firewall driver.
# firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
firewall_driver =  nova.virt.firewall.NoopFirewallDriver
security_group_api = neutron

[database]
connection = mysql://nova:openstack@controller/nova

[keystone_authtoken]
auth_uri = http://controller:35357
auth_host = controller
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = openstack

posted @ 2016-09-07 13:52  HEZOF  阅读(221)  评论(0编辑  收藏  举报