Ubuntu搭建Openstack平台(kilo)(四.nova)

一.nova环境

参考文档:http://www.aboutyun.com/thread-13089-1-1.html

http://docs.openstack.org/mitaka/install-guide-ubuntu/nova-controller-install.html

1.创建nova数据库并授权

  • 创建
mysql -u root -p

CREATE DATABASE nova;
  • 授权(自己设定密码,连接数据库时用,我的nova)
GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘localhost‘ IDENTIFIED BY ‘NOVA_PASS‘;
GRANT ALL PRIVILEGES ON nova.* TO ‘nova‘@‘%‘ IDENTIFIED BY ‘NOVA_PASS‘;
  • 退出
exit

2.生效admin用户名

source admin-openrc.sh

3.创建认证服务

  • 创建nova用户
openstack user create --password-prompt nova
User Password:(我的设置nova)
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | e0353a670a9e496da891347c589539e9 |
| enabled   | True                             |
| id        | 8c46e4760902464b889293a74a0c90a8 |
| name      | nova                             |
+-----------+----------------------------------+
  • 添加admin 角色到nova用户
openstack role add --project service --user nova admin
  • 创建nova 服务实例
 openstack service create --name nova --description "OpenStack Compute" compute
 +-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | 060d59eac51b4594815603d75a00aba2 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+
  • 创建nova的API endpoint
openstack endpoint create --publicurl http://controller:8774/v2/%\(tenant_id\)s  \
--internalurl http://controller:8774/v2/%\(tenant_id\)s  \
--adminurl http://controller:8774/v2/%\(tenant_id\)s \
--region RegionOne compute
+--------------+-----------------------------------------+
| Field        |Value                                    |
+--------------+-----------------------------------------+
| adminurl     |http://controller:8774/v2/%\(tenant_id\)s|
| id           |3c1caa473bfe4390a11e7177894bcc7b         |
| internalurl  |http://controller:8774/v2/%\(tenant_id\)s|
| publicurl    |http://controller:8774/v2/%\(tenant_id\)s|
| region_id    |RegionOne                                |
| service_id   |e702f6f497ed42e6a8ae3ba2e5871c78         |
| service_name |nova                                     |
| service_type |compute                                  |
+--------------+-----------------------------------------+


二.安装Nova

1.控制节点

  • 安装nova包
   apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient -y
  • 修改配置文件
vim /etc/nova/nova.conf

[DEFAULT]
verbose = True
rpc_backend = rabbit
auth_strategy = keystone
#使用控制节点管理网络ip地址配置my_ip
my_ip = 10.0.0.11
#使用控制节点管理网络ip地址配置 VNC proxy(不懂是什么)
vncserver_listen = 10.0.0.11
vncserver_proxyclient_address = 10.0.0.11

[database]
connection = mysql://nova:NOVA_DBPASS(nova的数据库密码)@controller/nova

[oslo_messaging_rabbit]
#配置RabbitMQ 消息队列服务
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS(密码为创建的消息中间件密码,我的为123)

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = NOVA_PASS(我的密码为nova)

[glance]
# 配置镜像服务位置
host = controller

[oslo_concurrency]
lock_path = /var/lib/nova/tmp
  • 同步数据库(同步之后,可以看看数据库中是否存在表,有则成功,没有则表明可能sqlite数据库没删,删除后在同步rm -f /var/lib/nova/nova.sqlite)
su -s /bin/sh -c "nova-manage db sync" nova
  • 重启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


2.计算节点

  • 安装nova包
apt-get install nova-compute sysfsutils -y
  • 修改配置文件
vim /etc/nova/nova.conf

[DEFAULT]
verbose = True
rpc_backend = rabbit
auth_strategy = keystone

#MANAGEMENT_INTERFACE_IP_ADDRESS这里是计算节点管理网络ip地址 10.0.0.31(看自己的设置定)
my_ip = MANAGEMENT_INTERFACE_IP_ADDRESS

#启用和配置remote console 访问(不明觉厉)
vnc_enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = MANAGEMENT_INTERFACE_IP_ADDRESS(即计算节点管理网络ip地址,我是10.0.0.31)
novncproxy_base_url = http://controller:6080/vnc_auto.html(控制台显示,如果不能解析controller,可以写成IP地址)

[oslo_messaging_rabbit]
#配置RabbitMQ 消息队列服务
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = RABBIT_PASS(密码为创建的消息中间件密码,我的为123)

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = NOVA_PASS(我的密码为nova)

[glance]
# 配置镜像服务位置
host = controller

[oslo_concurrency]
lock_path = /var/lib/nova/tmp
  • 查看计算节点是否支持虚拟机硬件加速
egrep -c ‘(vmx|svm)‘ /proc/cpuinfo

如果输出是0,则

vim /etc/nova/nova-compute.conf

[libvirt]
...
virt_type = qemu
  • 重启服务(删除Sqlite数据库,rm -f /var/lib/nova/nova.sqlite)
service nova-compute restart


三.验证安装(控制节点)

  • 加载环境变量
source admin-openrc.sh
  • 查看每个服务组件是否起来
nova service-list
+--+----------------+----------+--------+-------+-----+----------------------------+
|Id| Binary         | Host     |Zone    |Status |State| Updated At                 |
+--+----------------+----------+--------+-------+-----+----------------------------+
| 1|nova-consoleauth|controller|internal|enabled|up   | 2016-02-09T23:11:15.000000 |
| 2|nova-scheduler  |controller|internal|enabled|up   | 2016-02-09T23:11:15.000000 |
| 3|nova-conductor  |controller|internal|enabled|up   | 2016-02-09T23:11:16.000000 |
| 4|nova-compute    |compute1  |nova    |enabled|up   | 2016-02-09T23:11:20.000000 |
+--+----------------+----------+--------+-------+-----+----------------------------+
  • 列出 镜像
nova image-list

注意:以前搭建的,可以运行,如果上面写的有一些问题,谢谢指出来。

先写到这里,现在错误应该没有了,后面再加其他东西。

时间: 2024-10-06 10:39:55

Ubuntu搭建Openstack平台(kilo)(四.nova)的相关文章

Ubuntu搭建Openstack平台(kilo)(七.Dashboard)

安装Dashboard 参考文档:http://docs.openstack.org/mitaka/install-guide-ubuntu/horizon-install.html - 安装dashboard apt-get install openstack-dashboard 修改配置 vim /etc/openstack-dashboard/local_settings.py OPENSTACK_HOST = "controller" #允许所有的主机访问dashboard A

Ubuntu搭建Openstack平台(kilo)(二.keystone)

一.keystone安装 参考文档:http://www.aboutyun.com/thread-13080-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/keystone-install.html 1.创建keystone数据库并授权 mysql -u root -p 创建keystone数据库: CREATE DATABASE keystone; 授权(并设置keystone密码,此密码在后面同步数据库时会用到,

Ubuntu搭建Openstack平台(kilo)(六.实例化网络,创建实例)

实例化网络 参考文档:http://www.aboutyun.com/thread-13187-1-1.html http://www.aboutyun.com/thread-14639-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/launch-instance.html#create-virtual-networks 一.创建外部网络 加载环境 source admin-openrc.sh 创建网络 neutro

Ubuntu搭建Openstack平台(kilo)(一.整体环境)

一.环境 OS:Ubuntu 14.04 网卡要求:每台主机最少两块网卡,网络节点最少三块 eth0作为管理网卡,eth1作为数据网卡,eth2作为外部网卡 网络类型如图: 管理网络(Management Network): 10.0.0.0/24 数据网络(Data Network): 10.0.0.1.0/24 外部网络(External Network) 203.0.113.0/24 API Network 125.220.254.** 二.网络配置(设置后使用/etc/init.d/ne

Ubuntu搭建Openstack平台(kilo)(三.glance)

一.Glance环境 参考文档:http://www.aboutyun.com/thread-13080-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/glance-install.html 1.创建glance的数据库并授权 创建 mysql -u root -p CREATE DATABASE glance; 授权(自己设定密码,连接数据库时用,我的glance) GRANT ALL PRIVILEGES ON

Ubuntu搭建Openstack平台(kilo)(五.neutron(二)网络节点与计算节点)

参考文档:http://www.aboutyun.com/thread-13116-1-1.html http://www.aboutyun.com/thread-13117-1-1.html 网络节点 一.配置参数 环境配置 vim /etc/sysctl.conf net.ipv4.ip_forward=1 net.ipv4.conf.all.rp_filter=0 net.ipv4.conf.default.rp_filter=0 使配置生效 sysctl -p 二.安装neutron组件

Ubuntu搭建Openstack平台(kilo)(五.neutron(一)控制节点)

一.neutron环境 参考文档:http://www.aboutyun.com/thread-13108-1-1.html http://docs.openstack.org/mitaka/install-guide-ubuntu/neutron-controller-install.html 1.创建neutron数据库并授权 创建 mysql -u root -p CREATE DATABASE neutron; 授权 GRANT ALL PRIVILEGES ON neutron.* T

Ubuntu搭建trac平台步骤

Ubuntu搭建trac平台步骤: # apt-get install apache2 # apt-get install libapache2-mod-python # apt-get install libapache2-mod-authnz-external # a2enmod authnz_ldap # apt-get install mysql-server-5.5  (设置root密码,如:123456) # apt-get install python-mysqldb # apt-

Ubuntu 搭建LAMP平台

$ sudo apt-get install apache2 $ sudo apt-get install mysql-server-5.5   (root密码随意,如:123456) $ sudo apt-get install php5 $ sudo apt-get install libapache2-mod-php5  (解决apache识别php页面) $ sudo apt-get install php5-mysql    (解决php连接mysql) $ sudo ls /etc/