设为首页 收藏本站
查看: 925|回复: 0

[经验分享] OpenStack Folsom安装过程详解

[复制链接]

尚未签到

发表于 2015-10-10 14:13:27 | 显示全部楼层 |阅读模式

OpenStack Folsom安装过程详解
  相信刚接触OpenStack的新手,在安装OpenStack的过程中都会叫苦不迭。开源软件就是有这个特点,比较难安装,使用起来不够友好。况且还是如此庞大的OpenStack。我本人是按照OpenStack官方文档(官网下载下来pdf版本的名字是openstack-install-guide-apt-trunk.pdf)来进行安装,尝试了两遍。第一遍碰到各种问题。纠结了很久,问题更多,最终第二次安装成功。
  下面就是我对成功安装过程进行进行详细的介绍,包括碰两遍安装中碰到的各种问题,希望能给大家带来帮助。安装过程严格按照官方文档Appendix B的步骤,同时还会指出文档中明显的错误。
  安装环境:Ubuntu Server 12.04 LTS。全程使用root用户进行操作。
一、准备工作
  1. 配置ubuntu源仓库
  echo deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/folsom main >> /etc/apt/sources.list.d/folsom.list(Ubuntu 12.04版本默认的OpenStack源是Essex版本,Ubuntu 12.10默认的是Folsom版本)
  

  2. 安装ntp等服务(ntp非常重要,第一次安装失败与没有安装ntp服务有很大的关系,当时的想法是在一台机器上进行安装没必要进行时间同步。)
  apt-get install vlan bridge-utils ntp mysql-server python-mysqldb
  

  3. 配置数据库
  mysql -u root -phengtian -e "create database nova;"
  mysql -u root -phengtian -e "create database glance;"
  mysql -u root -phengtian -e "create database cinder;"
  mysql -u root -phengtian -e "create database keystone;"
  mysql -u root -phengtian -e "create database ovs_quantum;"

  

  4. 配置数据库访问权限
  grant all privileges on nova.* to nova@"localhost" identified by "hengtian";
  grant all privileges on nova.* to nova@"%" identified by "hengtian";
  grant all privileges on glance.* to glance@"localhost" identified by "hengtian";
  grant all privileges on glance.* to glance@"%" identified by "hengtian";
  grant all privileges on cinder.* to cinder@"localhost" identified by "hengtian";
  grant all privileges on cinder.* to cinder@"%" identified by "hengtian";
  grant all privileges on keystone.* to keystone@"localhost" identified by "hengtian";
  grant all privileges on keystone.* to keystone@"%" identified by "hengtian";
  grant all privileges on ovs_quantum.* to ovs_quantum@"localhost" identified by "hengtian";
  grant all privileges on ovs_quantum.* to ovs_quantum@"%" identified by "hengtian";
二、安装和配置keystone
  (比较繁琐的一部分,关系到后边各个部件的安装成败,要绝对的耐心,细心)
  1. 安装keystone相关软件包
  apt-get install keystone python-keystone python-keystoneclient
  

  2. 配置相关文件
  更改/etc/keystone/keystone.conf
  admin_token = admin (admin_token的值可以为任意字符串,但后面使用过程中必须保持一致)
  connection = mysql://keystone:hengtian@172.16.7.33/keystone (更改成与前面的安装相对应)
  

  3. 同步数据库
  keystone-manage db_sync
  

  4. 设置环境变量(后面的操作都依赖于此环境变量)
  可以有很多种设置方法,我是将其加在/root/.bashrc文件中
  export SERVICE_TOKEN=admin (和前面/etc/keystone/keystone.conf中一致)
  export OS_TENANT_NAME=admin (与后面配置的两个tenant中的系统级tenant一致,我的安装中两个tenant一个是admin另一个是service,其中admin是系统级的tenantservice是各个服务所使用的tenant)
  export OS_USERNAME=admin (admin用户,后面有相应的创建过程)
  export OS_PASSWORD=hengtian (注意与后面创建过程的设置保持一致)
  export OS_AUTH_URL=http://172.16.7.33:5000/v2.0/ (根据自己机器的IP进行设置)
  export SERVICE_ENDPOINT=http://172.16.7.33:35357/v2.0/
  配置完注意用source命令执行一下。
  

  5. 创建keystone中各种用户
  keystone user-create --name admin --pass hengtian --email admin@hengtian.com
+----------+-------------------------------------------------------------------------------------------------------------------------+
| Property |    Value    |
+----------+-------------------------------------------------------------------------------------------------------------------------+
|  email   |                         admin@hengtian.com                        |
| enabled  |     True    |
|    id    |                  3c3e7c6b8f87441682c61ca9afdac427                 |
|   name   |    admin    |
| password | $6$rounds=40000$UxHh1wcIAIhSGP89$5ajPK3zVsUt9638Hzxh7hVx/4r4vlFt5PkrVNuaFCshmH2tgcOoYx4sYQ7Pim4/8vLi.7wE6askAOvyfpB4V./ |
| tenantId |             |
+----------+-------------------------------------------------------------------------------------------------------------------------+

keystone user-create --name nova --pass hengtian --email nova@hengtian.com
+----------+-------------------------------------------------------------------------------------------------------------------------+
| Property |    Value    |
+----------+-------------------------------------------------------------------------------------------------------------------------+
|  email   |                         nova@hengtian.com                         |
| enabled  |     True    |
|    id    |                  6fad36432831458c85ac3ad8d0a73acd                 |
|   name   |     nova    |
| password | $6$rounds=40000$SkHcKJQ.JdgAhPXU$iVJkygH0eH5.C94HISxdU80tYec3rzWxrG1Osry3s/a5eCnp8fEcis2ehTG5bExeGyYXPHXYCHFbnf42J1YRA1 |
| tenantId |             |
+----------+-------------------------------------------------------------------------------------------------------------------------+

keystone user-create --name glance --pass hengtian --email glance@hengtian.com
+----------+-------------------------------------------------------------------------------------------------------------------------+
| Property |    Value    |
+----------+-------------------------------------------------------------------------------------------------------------------------+
|  email   |                        glance@hengtian.com                        |
| enabled  |     True    |
|    id    |                  aa58b20fc97b45129a07b16d196b7146                 |
|   name   |    glance   |
| password | $6$rounds=40000$5sJ/dGOEnF4lQVNT$SYhjcgbXc.kiZ5UKymjy.3qbTlprGZbVv9gm45vOHMDgDCrsBBAp8vNsoHPuiSP9fLcjaRTYKav3zlMJKUE1f1 |
| tenantId |             |
+----------+-------------------------------------------------------------------------------------------------------------------------+

keystone user-create --name swift --pass hengtian --email swift@hengtian.com
+----------+-------------------------------------------------------------------------------------------------------------------------+
| Property |    Value    |
+----------+-------------------------------------------------------------------------------------------------------------------------+
|  email   |                         swift@hengtian.com                        |
| enabled  |     True    |
|    id    |                  89770a4a149c434fa13c553e37dc85dc                 |
|   name   |    swift    |
| password | $6$rounds=40000$6hm4ze3wU9VGKqqq$yMjMERd3trQ5v2GPkOP24zp2xEa4ZFAhj.MXwabml1asFbX1g.fMLbsFq5MmBHW88siNvDW4rj93gjKeiT3n3/ |
| tenantId |             |
+----------+-------------------------------------------------------------------------------------------------------------------------+

keystone user-create --name cinder --pass hengtian --email cinder@hengtian.com
+----------+-------------------------------------------------------------------------------------------------------------------------+
| Property |    Value    |
+----------+-------------------------------------------------------------------------------------------------------------------------+
|  email   |                        cinder@hengtian.com                        |
| enabled  |     True    |
|    id    |                  f1320c4834144fc38ef30028e495bca2                 |
|   name   |    cinder   |
| password | $6$rounds=40000$krDNGnLAxmZNGSeH$JD/qtR1wLJcKTwrqv6XULaUxfCseI5/Ib.aH4C9DPLFErLhJbtUwUrrzfVqrCcTpKe7c/RnBKPb6A35GNDpIS0 |
| tenantId |             |
+----------+-------------------------------------------------------------------------------------------------------------------------+

keystone user-create --name quantum --pass hengtian --email quantum@hengtian.com
+----------+-------------------------------------------------------------------------------------------------------------------------+
| Property |    Value    |
+----------+-------------------------------------------------------------------------------------------------------------------------+
|  email   |                        quantum@hengtian.com                       |
| enabled  |     True    |
|    id    |                  c5862839038643d4a92b1a8eeaa54ee5                 |
|   name   |   quantum   |
| password | $6$rounds=40000$DsjQ6jwMkYTtNZ9i$m2VZ2hpWoGxDOEs2CBS9MEyfXtmns1tSBDK4CrucRPowg5VG95qI6nnGQLxFfvObd/HQnmmt1J1p8GaZ32sqo0 |
| tenantId |             |
+----------+-------------------------------------------------------------------------------------------------------------------------

  6. 创建keystone中的role(adminMember)
keystone role-create --name admin
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | 0051009152bc4cef83a9b663ed525ccf |
|   name   |              admin               |
+----------+----------------------------------+

keystone role-create --name Member
+----------+----------------------------------+
| Property |              Value               |
+----------+----------------------------------+
|    id    | f02f20d9b75a4865b73a201048409187 |
|   name   |              Member              |
+----------+----------------------------------+

  7. 创建两个tenant(adminservice)
  keystone tenant-create --name=service
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | ff3f53f21924453cbe9611102fd963f2 |
|     name    |             service              |
+-------------+----------------------------------+

  

  keystone tenant-create --name=admin
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |                                  |
|   enabled   |               True               |
|      id     | 241961b5d5494434afd4ab708d1b7f7f |
|     name    |              admin               |
+-------------+----------------------------------+

  

  8. 创建各种service(每个service对应OpenStack中的相应组件的相关服务)
  

  keystone service-create --name nova --type compute --description "OpenStack Compute Service"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |    OpenStack Compute Service     |
|      id     | 6bf00246516b4172a5c882e10f72f1bb |
|     name    |               nova               |
|     type    |             compute              |
+-------------+----------------------------------+
  

  keystone service-create --name volume --type volume --description "OpenStack Volume Service"
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Volume Service     |
|      id     | 930ede7cd18f4e008db72e8c8cbdf860 |
|     name    |              volume              |
|     type    |              volume              |
+-------------+----------------------------------+

  

  keystone service-create --name glance --type image --description "OpenStack Image Service"
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     OpenStack Image Service      |
|      id     | 65bc364c1eb94cc6a30f2a331d070196 |
|     name    |              glance              |
|     type    |              image               |
+-------------+----------------------------------+

  

  keystone service-create --name swift --type object-store --description "OpenStack Storage Service"
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |    OpenStack Storage Service     |
|      id     | f39b6a0b5ab54b8ba0d3dbf56498cdd7 |
|     name    |              swift               |
|     type    |           object-store           |
+-------------+----------------------------------+

  

  keystone service-create --name keystone --type identity --description "OpenStack Identity Service"
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |    OpenStack Identity Service    |
|      id     | 011e43f95bb04dd4b7d682ea9cab5fa9 |
|     name    |             keystone             |
|     type    |             identity             |
+-------------+----------------------------------+

  

  keystone service-create --name ec2 --type ec2 --description "EC2 Service"
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |           EC2 Service            |
|      id     | 05ad50f2c49543358dbd806baa813939 |
|     name    |               ec2                |
|     type    |               ec2                |
+-------------+----------------------------------+

  

  keystone service-create --name cinder --type volume --description "Cinder Service"
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |          Cinder Service          |
|      id     | d19f50b6bd844c58a76457d28c180277 |
|     name    |              cinder              |
|     type    |              volume              |
+-------------+----------------------------------+

  

  keystone service-create --name quantum --type network --description "OpenStack Networking service"
  +-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |   OpenStack Networking service   |
|      id     | 9eea3825274c4fa185b038e69719d33e |
|     name    |             quantum              |
|     type    |             network              |
+-------------+----------------------------------+

  

  

  9. 创建与service相对应的endpoint
  //////////////For Nova-api
keystone endpoint-create --region myregion --service_id \
6bf00246516b4172a5c882e10f72f1bb --publicurl "http://172.16.9.33:8774/v2/%(tenant_id)s" \
--adminurl "http://172.16.7.33:8774/v2/%(tenant_id)s" --internalurl "http://172.16.7.33:8774/v2/%(tenant_id)s"
+-------------+------------------------------------------+
|   Property  |                  Value                   |
+-------------+------------------------------------------+
|   adminurl  | http://172.16.7.33:8774/v2/%(tenant_id)s |
|      id     |     88d1df3ff692499e865b12f474e7b412     |
| internalurl | http://172.16.7.33:8774/v2/%(tenant_id)s |
|  publicurl  | http://172.16.9.33:8774/v2/%(tenant_id)s |
|    region   |                 myregion                 |
|  service_id |     6bf00246516b4172a5c882e10f72f1bb     |
+-------------+------------------------------------------+

  

  //////////////For Nova-volume
keystone endpoint-create --region myregion --service_id \
930ede7cd18f4e008db72e8c8cbdf860 --publicurl "http://172.16.9.33:8776/v1/%(tenant_id)s" \
--adminurl "http://172.16.7.33:8776/v1/%(tenant_id)s" --internalurl "http://172.16.7.33:8776/v1/%(tenant_id)s"
+-------------+------------------------------------------+
|   Property  |                  Value                   |
+-------------+------------------------------------------+
|   adminurl  | http://172.16.7.33:8776/v1/%(tenant_id)s |
|      id     |     bc4e5342a8094427a56e75214ef18b8d     |
| internalurl | http://172.16.7.33:8776/v1/%(tenant_id)s |
|  publicurl  | http://172.16.9.33:8776/v1/%(tenant_id)s |
|    region   |                 myregion                 |
|  service_id |     930ede7cd18f4e008db72e8c8cbdf860     |
+-------------+------------------------------------------+

  

  //////////////For Glance
keystone endpoint-create --region myregion --service_id \
65bc364c1eb94cc6a30f2a331d070196 --publicurl "http://172.16.7.33:9292/v1" \
--adminurl "http://172.16.7.33:9292/v1" --internalurl "http://172.16.7.33:9292/v1"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |    http://172.16.7.33:9292/v1    |
|      id     | 2c8f290bbe0d48a595320a18ab49dda1 |
| internalurl |    http://172.16.7.33:9292/v1    |
|  publicurl  |    http://172.16.7.33:9292/v1    |
|    region   |             myregion             |
|  service_id | 65bc364c1eb94cc6a30f2a331d070196 |
+-------------+----------------------------------+

  

  //////////////For Swift
keystone endpoint-create --region myregion --service_id \
f39b6a0b5ab54b8ba0d3dbf56498cdd7 --publicurl "http://172.16.9.33:8080/v1/AUTH_%(tenant_id)s" \
--adminurl "http://172.16.7.33:8080/v1" --internalurl "http://172.16.7.33:8080/v1/AUTH_%(tenant_id)s"
+-------------+-----------------------------------------------+
|   Property  |                     Value                     |
+-------------+-----------------------------------------------+
|   adminurl  |           http://172.16.7.33:8080/v1          |
|      id     |        e16707dc1dee462f8f6b33e48c91b731       |
| internalurl | http://172.16.7.33:8080/v1/AUTH_%(tenant_id)s |
|  publicurl  | http://172.16.9.33:8080/v1/AUTH_%(tenant_id)s |
|    region   |                    myregion                   |
|  service_id |        f39b6a0b5ab54b8ba0d3dbf56498cdd7       |
+-------------+-----------------------------------------------+

  

  //////////////For Identity Service
keystone endpoint-create --region myregion --service_id \
011e43f95bb04dd4b7d682ea9cab5fa9 --publicurl "http://172.16.9.330:5000/v2.0" \
--adminurl "http://172.16.7.33:35357/v2.0" --internalurl "http://172.16.7.33:5000/v2.0"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |  http://172.16.7.33:35357/v2.0   |
|      id     | 99770df1df6842d69e276ae2b685377f |
| internalurl |   http://172.16.7.33:5000/v2.0   |
|  publicurl  |  http://172.16.9.330:5000/v2.0   |
|    region   |             myregion             |
|  service_id | 011e43f95bb04dd4b7d682ea9cab5fa9 |
+-------------+----------------------------------+

  

  //////////////For EC2_compatibility
keystone endpoint-create --region myregion --service_id \
05ad50f2c49543358dbd806baa813939 --publicurl "http://172.16.9.33:8773/services/Cloud" \
--adminurl "http://172.16.7.33:8773/services/Admin" --internalurl "http://172.16.7.33:8773/services/Cloud"
+-------------+----------------------------------------+
|   Property  |                 Value                  |
+-------------+----------------------------------------+
|   adminurl  | http://172.16.7.33:8773/services/Admin |
|      id     |    06b55bf439e94504991cd9064725cd8b    |
| internalurl | http://172.16.7.33:8773/services/Cloud |
|  publicurl  | http://172.16.9.33:8773/services/Cloud |
|    region   |                myregion                |
|  service_id |    05ad50f2c49543358dbd806baa813939    |
+-------------+----------------------------------------+

  

  //////////////For Cinder
keystone endpoint-create --region myregion --service_id \
d19f50b6bd844c58a76457d28c180277 --publicurl "http://172.16.9.33:8776/v1/%(tenant_id)s" \
--adminurl "http://172.16.7.33:8776/v1/%(tenant_id)s" --internalurl "http://172.16.7.33:8776/v1/%(tenant_id)s"
+-------------+------------------------------------------+
|   Property  |                  Value                   |
+-------------+------------------------------------------+
|   adminurl  | http://172.16.7.33:8776/v1/%(tenant_id)s |
|      id     |     ebd662228be8457683960b8cda361594     |
| internalurl | http://172.16.7.33:8776/v1/%(tenant_id)s |
|  publicurl  | http://172.16.9.33:8776/v1/%(tenant_id)s |
|    region   |                 myregion                 |
|  service_id |     d19f50b6bd844c58a76457d28c180277     |
+-------------+------------------------------------------+

  

  //////////////For Quantum
keystone endpoint-create --region myregion --service-id \
9eea3825274c4fa185b038e69719d33e --publicurl "http://172.16.9.33:9696/v2" \
--adminurl "http://172.16.7.33:9696/v2" --internalurl "http://172.16.7.33:9696/v2"
+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
|   adminurl  |    http://172.16.7.33:9696/v2    |
|      id     | 682dfbef6b494d32ad941d755d79c86a |
| internalurl |    http://172.16.7.33:9696/v2    |
|  publicurl  |    http://172.16.9.33:9696/v2    |
|    region   |             myregion             |
|  service_id | 9eea3825274c4fa185b038e69719d33e |
+-------------+----------------------------------+

  

  10. 为各个用户加入对应的role(注意user_id, role_id以及tenant_id与前面的保持一致)
  //////////////User admin <> role admin <> tenant admin
keystone user-role-add --user_id 3c3e7c6b8f87441682c61ca9afdac427 --role_id \
0051009152bc4cef83a9b663ed525ccf --tenant_id 241961b5d5494434afd4ab708d1b7f7f

//////////////User nova <> role admin <> tenant service
keystone user-role-add --user_id 6fad36432831458c85ac3ad8d0a73acd --role_id \
0051009152bc4cef83a9b663ed525ccf --tenant_id ff3f53f21924453cbe9611102fd963f2

//////////////User glance <> role admin <> tenant service
keystone user-role-add --user_id aa58b20fc97b45129a07b16d196b7146 --role_id \
0051009152bc4cef83a9b663ed525ccf --tenant_id ff3f53f21924453cbe9611102fd963f2

//////////////User swift <> role admin <> tenant service
keystone user-role-add --user_id 89770a4a149c434fa13c553e37dc85dc --role_id \
0051009152bc4cef83a9b663ed525ccf --tenant_id ff3f53f21924453cbe9611102fd963f2

//////////////User admin <> role Member <> tenant admin
keystone user-role-add --user_id 3c3e7c6b8f87441682c61ca9afdac427 --role_id \
f02f20d9b75a4865b73a201048409187 --tenant_id 241961b5d5494434afd4ab708d1b7f7f

//////////////User cinder <> role admin <> tenant service
keystone user-role-add --user_id f1320c4834144fc38ef30028e495bca2 --role_id \
0051009152bc4cef83a9b663ed525ccf --tenant_id ff3f53f21924453cbe9611102fd963f2

//////////////User quantum <> role admin <> tenant service
keystone user-role-add --user_id c5862839038643d4a92b1a8eeaa54ee5 --role_id \
0051009152bc4cef83a9b663ed525ccf --tenant_id ff3f53f21924453cbe9611102fd963f2

//////////////User swift <> role Member <> tenant service
keystone user-role-add --user_id 89770a4a149c434fa13c553e37dc85dc --role_id \
f02f20d9b75a4865b73a201048409187 --tenant_id ff3f53f21924453cbe9611102fd963f2

  
三、安装和配置glance
  
  1. 安装glance相关组件
  apt-get install glance glance-api python-glanceclient glance-common \
glance-registry python-glance

  

  2. 编辑/etc/glance/glance-api-paste.ini文件,主要是(filter authoken)这一块,在后面的其他组件(nova, cinder等)也会有相应的xxx-paste.ini文件在编辑的时候也只需要编辑filter authoken这块内容
  [filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
auth_host = 172.16.7.33
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = hengtian

  

  3. 编辑/etc/glance/glance-registry-paste.ini文件
  [filter:authtoken]
paste.filter_factory = keystone.middleware.auth_token:filter_factory
auth_host = 172.16.7.33
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = hengtian

  

  4. 编辑/etc/glance/glance-api.conf文件
  sql_connection = mysql://glance:hengtian@172.16.7.33/glance
  [paste_deploy]
flavor = keystone(此项如果之前没有,在文件末尾加入)

  

  5. 编辑/etc/glance/glance-registry.conf文件
  sql_connection = mysql://glance:hengtian@172.16.7.33/glance
  

  6. 同步数据库,重启服务
  service glance-api stop
service glance-registry stop (在同步之前先关闭相应服务)
glance-manage db_sync
service glance-api restart
service glance-registry restart

  

  7. 检查安装
  glance index
  如果此命令执行的结果是类&#20284;于mysql数据库的表,有相应的列名而结果为空那么就是安装成功了。
  ID                                   Name                           Disk Format          Container Format     Size
------------------------------------ ------------------------------ -------------------- -------------------- --------------

  

  glance安装小结:
  glance安装相对于后面的nova和swift配置相对而言比较简单,我在第一次安装过程中没有遇到错误,但第二次安装一直报&quot;401 Unauthorized&quot;错误,主要是用户认证的问题。这个问题的原因是xxx-paste.ini文件配置有问题。
  首先,在xxx.conf中要包含config_file = /etc/glance/xxx-paste.ini,且在xxx.conf中不进行权限认证相关的配置,如果原来存在要删除掉。

  然后,在xxx-paste.ini检查:
  admin_tenant_name = service
admin_user = glance
admin_password = hengtian

  在官方文档中Appendix B中配置就有错误,其admin_user = admin,我之前尝试这样行不通。
  
  
四、安装和配置nova
  
  1. 安装相关组件包
  apt-get install nova-api nova-cert nova-compute nova-compute-qemu nova-doc \
nova-network nova-objectstore nova-scheduler nova-volume rabbitmq-server \
novnc nova-consoleauth

  

  2. 修改相应文件的权限

  chown -R nova.nova /etc/nova
chmod 644 /etc/nova/nova.conf

  

  3. 配置/etc/nova/nova.conf文件
  该文件的配置很重要,配置不好后面6个nova先关的服务都有可能无法正常启动。而且这个文件安装完成后生成的版本内容很少,所以一般都要自己替换掉,而不是在原有基础上改动。这里贴一个我使用的能正常工作的版本。
  [DEFAULT]
logdir=/var/log/nova
state_path=/var/lib/nova
lock_path=/run/lock/nova
verbose=True
api_paste_config=/etc/nova/api-paste.ini
scheduler_driver=nova.scheduler.simple.SimpleScheduler
s3_host=172.16.7.33
ec2_host=172.16.7.33
ec2_dmz_host=172.16.7.33
rabbit_host=172.16.7.33
cc_host=172.16.7.33
nova_url=http://172.16.7.33:8774/v1.1/
sql_connection=mysql://nova:hengtian@172.16.7.33/nova
ec2_url=http://172.16.7.33:8773/services/Cloud
# Auth
use_deprecated_auth=false
auth_strategy=keystone
keystone_ec2_url=http://172.16.7.33:5000/v2.0/ec2tokens
# Imaging service
glance_api_servers=172.16.7.33:9292
image_service=nova.image.glance.GlanceImageService
# Virt driver
connection_type=libvirt
libvirt_type=qemu
libvirt_use_virtio_for_bridges=true
start_guests_on_host_boot=false
resume_guests_state_on_host_boot=false
# Vnc configuration
novnc_enabled=true
novncproxy_base_url=http://172.16.7.33:6080/vnc_auto.html
novncproxy_port=6080
vncserver_proxyclient_address=127.0.0.1
vncserver_listen=0.0.0.0
# Network settings
dhcpbridge_flagfile=/etc/nova/nova.conf
dhcpbridge=/usr/bin/nova-dhcpbridge
network_manager=nova.network.manager.VlanManager
public_interface=eth0
vlan_interface=eth1
fixed_range=192.168.4.32/27
routing_source_ip=172.16.9.33
network_size=32
force_dhcp_release=True
rootwrap_config=/etc/nova/rootwrap.conf
# Cinder #
volume_api_class=nova.volume.cinder.API
enabled_apis=ec2,osapi_compute,metadata
osapi_volume_listen_port=5900

  4. 修改/etc/nova//etc/nova/api-paste.ini
  [filter:authtoken]

  auth_host = 172.16.7.33
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = nova
admin_password = hengtian
signing_dirname = /tmp/keystone-signing-nova

  5. 同步数据库配置
  nova-manage db sync
  6. 建立一个网络
  nova-manage network create private --fixed_range_v4=192.168.4.32/27 \
--num_networks=1 --bridge=br100 --bridge_interface=eth0 --network_size=32 --vlan 100

  (官网文档没有加--vlan 选项,我装的两次没加这个选项都出错,加上这个选项正常工作)
  7. 重启相关服务
  cd /etc/init.d/; for i in $( ls nova-* ); do sudo service $i restart; done
service open-iscsi restart
service novnc restart

  8. 验证服务启动是否成功
  nova-manage service list
  如果出现nova-consoleauth, nova-scheduler, nova-compute, nova-network, nova-cert, nova-volume六大服务,并且每个服务的状态都是笑脸(:))则nova相关服务安装成功。如果有非笑脸(XXX)状态则先尝试对应的未启动的xxx服务,运行start nova-xxx命令。如果还是不行则认真检查/var/log/nova/目录下的日志,查看ntp是否安装正常。本人碰到过在ntp没有正常安装的情况下相关的服务不能正常启动,重新安装配置ntp之后一切正常。
  五、小结
  至此,nova服务已经安装完成,后面可以上传镜像然后运行虚拟机,这里就不作详细叙述了,后面还会有cinder的安装和配置,我的安装使用环境用到了nova-volume,系统能正常使用,所以对cinder的安装配置也不做详叙。其配置文件结构大致与glance和nova配置相同,相信nova和glance配置正确了cinder的成功配置也不难。
  
  

  

  

  

  


  

  


  

  

  

  


  


  



  
  
  
  
  
  
  

  

         版权声明:本文为博主原创文章,未经博主允许不得转载。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-125166-1-1.html 上篇帖子: OpenStack Load Balancer LBaaS 下篇帖子: OpenStack多节点部署(三)——网络配置
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表