OpenStack-Nova组件部署
Posted 还行少年
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了OpenStack-Nova组件部署相关的知识,希望对你有一定的参考价值。
文章目录
Nova 计算服务
1.Nova 简介
- 计算服务是openstack最核心的服务之一 , 负责维护和管理云环境的计算资源,它在openstack项目中代号是nova。
- Nova自身并没有提供任何虚拟化能力,它提供计算服务,使用不同的虚拟化驱动来与底层支持的Hypervisor (虚拟机管理器)进行交互。所有的计算实例(虚拟服务器)由Nova进行生命周期的调度管理(启动、挂起、停止、删除等),全局来看,nova为整个架构提供虚拟化资源、技术,服务层面来看,nova本身并不具备虚拟化能力,而是通过compute组件与虚拟化管理工具交互实现虚拟资源调度。
- Nova需要keystone、glance、 neutron、 cinder和swift等其他服务的支持, 能与这些服务集成,实现如加密磁盘、裸金属计算实例等。会和其他外部组件集成,共同完成请求
2.Nova 系统架构
外部服务包括keystone,neutron,glance,cinder这些nova服务需要与之交互的服务。
内部组件:
DB:用于数据存储的sql数据库,存放各组件的工作过程信息,后端裸金属实际的使用资源信息
API:用于接收HTTP请求、转换命令、通过消息队列或HTTP与其他组件通信
Scheduler:用于决定哪台计算节点承载计算实例,相当于nova的调度器
Network:管理IP转发,网桥或虚拟局域网,是一个网络组件
Compute:管理虚拟机管理器(VMM)与虚拟机之间通信,与hypervisor交互实现虚拟化调用底层硬件资源,计算组件
Conductor:处理需要协调的的请求(构建虚拟机或调整虚拟机大小的请求),或者处理对象转换
3.组件介绍
3.1 API
- 它是客户端访问nova的http接口,它由nova-api服务实现,nova-api服务接收和响应来自最终用户的计算api请求(包括跟虚拟机声明周期相关的操作),作为openstack对外服务的最主要接口,nova提供了一个集中的可以查询所有api的端点,以便自己平台内部和其他云平台的调用。
- 所有对nova的请求都首先由nova-api处理,API提供REST标准调用服务,便于与第三方系统集成(其他云平台)。它是外部访问并使用nova提供的各种服务的唯一途径,也是客户端和nova之间的中间件。
- 最终用户不会直接改送RESTful API 请求,而是通过openstack命令行,horison控制面板和其他需要跟nova交换 的组件来使用这些API。
- Nova-api对接收到的HTTP API请求做以下处理:
1、检查客户端传入的参数是否合法有效(而不止是进行认证)
2、调用nova其他服务来处理客户端HTTP请求
3、格式化nova其他子服务返回的结果,并返回给客户端
3.2 Scheduler
调度器的类型:
- 随机调度器:从所有正常运行nova-compute服务的节点中随机选择
- 缓存调度器:是随机调度器的一种特殊类型,在随机调度器的基础上,将主机资源信息缓存在本地内存中,然后通过后台的定时任务,定时从数据库中获取最新的主机资源信息,周期性同步而不是实时获取主机资源信息。
- 过滤器调度器:根据指定的过滤条件以及权重选择最佳的计算节点,又称为筛选器。
过滤器调度器调度过程:
- 通过指定的过滤器选择满足条件的计算节点,比如内存使用率,可以使用多个过滤器依次进行过滤。(预选)
- 对过滤之后的主机列表进行权重计算并排序,选择最优的计算节点来创建虚拟机实例。(优选)
过滤器类型:
- RetryFilter(再审过滤器)
主要作用是过滤掉之前已经调度过的节点(类比污点)。如A、B、C都通过了过滤,A权重最大被选中执行操作,由于某种原因,操作在A上失败了。Nova-filter 将重新执行过滤操作,再审过滤器直接过滤掉A,以免再次失败。 - AvailabilityZoneFilter(可用区域过滤器)
主要作用是提供容灾性,并提供隔离服务,可以将计算节点划分到不同的可用区域中。Openstack默认有一个命名为nova的可用区域,所有计算节点一开始都在其中。用户可以根据需要创建自己的一个可用区域。创建实例时,需要指定将实例部署在那个可用区域中。通过可用区过滤器,将不属于指定可用区的计算节点过滤掉。 - RamFilter(内存过滤器)
根据可用内存来调度虚拟机创建,将不能满足实例类型内存需求的计算节点过滤掉,但为了提高系统资源利用率, Openstack在计算节点的可用内存允许超过实际内存大小,可临时突破上限,超过的程度是通过nova.conf配置文件中ram_ allocation_ ratio参数来控制的, 默认值是1.5。(但这只是临时的)
Vi /etc/nova/nova . conf
Ram_ allocation_ ratio=1 .5 - DiskFilter(硬盘过滤器)
根据磁盘空间来调度虚拟机创建,将不能满足类型磁盘需求的计算节点过滤掉。磁盘同样允许超量,超量值可修改nova.conf中disk_ allocation_ ratio参数控制,默认值是1.0,(也是临时的)
Vi /etc/nova/nova.conf
disk_ allocation_ ratio=1.0 - CoreFilter(核心过滤器)
根据可用CPU核心来调度虚拟机创建,将不能满足实例类型vCPU需求的计算节点过滤掉。vCPU也允许超量,超量值是通过修改nova.conf中cpu_ allocation_ratio参数控制,默认值是16。
Vi /etc/nova/nova. conf
cpu_allocation_ ratio=16.0 - ComputeFilter(计算过滤器)
保证只有nova-compute服务正常工作的计算节点才能被nova-scheduler调度,它是必选的过滤器。 - ComputeCapabilitiesFilter(计算能力过滤器)
根据计算节点的特性来过了,如不同的架构。 - ImagePropertiesFilter(镜像属性过滤器)
根据所选镜像的属性来筛选匹配的计算节点,通过元数据来指定其属性。如希望镜像只运行在KVM的Hypervisor上,可以通过Hypervisor Type属性来指定。 - 服务器组反亲和性过滤器
要求尽量将实例分散部署到不同的节点上,设置一个服务器组,组内的实例会通过此过滤器部署到不同的计算节点。适用于需要分开部署的实例。 - 服务器组亲和性过滤器
此服务器组内的实例,会通过此过滤器,被部署在同一计算节点上,适用于需要位于相同节点的实例服务。
权重:
- 在对计算节点进行过滤时,多个过滤器依次进行过滤,而不是并行,相当于一个个预选,避免重复对同一个节点进行所有过滤项检验。过滤之后的节点再通过计算权重进行排序。
- 所有权重位于nova/scheduler/weights 目录下,目前默认是RAMweighter,根据计算节点空闲的内存计算权重,内存空闲越多权重越大,计算节点按照内存空闲进行排序。
3.3 compute计算组件
Nova-compute在计算节点上运行,负责管理节点上的实例。通常一个主机运行一 个Nova-compute服务, 一个实例部署在哪个可用的主机上取决于调度算法。OpenStack对实例的操作最后都是提交给Nova-compute来完成。
Nova-compute可分为两类,一类是定向openstack报告计算节点的状态,另一类是实现实例生命周期的管理。
3.4 conductor协调组件
- 以前对资源的管理全部由计算节点承担,在统计资源使用情况时,只是简单的将所有计算节点的资源情况累加起来,但是系统中还存在外部资源,这些资源由外部系统提供。如ceph、nfs等提供的存储资源等。
面对多种多样的资源提供者,管理员需要统一的、简单的管理接口来统计系统中资源使用情况,这个接口就是Placement API。 - PlacementAPI由nova-placement-api服务来实现, 旨在追踪记录资源提供者的目录和资源使用情况。被消费的资源类型是按类进行跟踪的。 如计算节点类、共享存储池类、IP地址类等。
OpenStack-Glance组件部署
1.创建数据库实例和数据库用户
[root@ct ~]# mysql -uroot -p123456
MariaDB [(none)]> CREATE DATABASE placement; //创建数据库
Query OK, 1 row affected (0.022 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'localhost' IDENTIFIED BY 'PLACEMENT_DBPASS'; //提权
Query OK, 0 rows affected (0.360 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON placement.* TO 'placement'@'%' IDENTIFIED BY 'PLACEMENT_DBPASS';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges; //刷新权限表
Query OK, 0 rows affected (0.029 sec)
MariaDB [(none)]> show grants for placement; //查看权限
+----------------------------------------------------------------------------------------------------------+
| Grants for placement@% |
+----------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'placement'@'%' IDENTIFIED BY PASSWORD '*15FD36E65AB25104A6C00E6FBCF43E4CD8FFAAFC' |
| GRANT ALL PRIVILEGES ON `placement`.* TO 'placement'@'%' |
+----------------------------------------------------------------------------------------------------------+
2 rows in set (0.000 sec)
MariaDB [(none)]>
2.创建Placement服务用户和API的endpoint
2.1 创建placement用户,给与placement用户对service项目拥有admin权限
[root@ct ~]# openstack user create --domain default --password PLACEMENT_PASS placement
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 8d4d934d91f9416b90cfc9e6d4a4d341 |
| name | placement |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
[root@ct ~]# openstack role add --project service --user placement admin
[root@ct ~]#
2.2 创建一个placement服务,服务类型为placement
[root@ct ~]# openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Placement API |
| enabled | True |
| id | 9bb91f636d8040d885e63533b6c914bf |
| name | placement |
| type | placement |
+-------------+----------------------------------+
[root@ct ~]#
2.3 注册API端口到placement的service中;注册的信息会写入到mysql中
[root@ct ~]# openstack endpoint create --region RegionOne placement public http://ct:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 39fad625ca37439bab5f6a1c4aa6da8c |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 9bb91f636d8040d885e63533b6c914bf |
| service_name | placement |
| service_type | placement |
| url | http://ct:8778 |
+--------------+----------------------------------+
[root@ct ~]# openstack endpoint create --region RegionOne placement internal http://ct:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | be9ad1bee0464b6095ee2ee526fab14f |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 9bb91f636d8040d885e63533b6c914bf |
| service_name | placement |
| service_type | placement |
| url | http://ct:8778 |
+--------------+----------------------------------+
[root@ct ~]# openstack endpoint create --region RegionOne placement admin http://ct:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 3feab16818154d6b973482f68e6feccd |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 9bb91f636d8040d885e63533b6c914bf |
| service_name | placement |
| service_type | placement |
| url | http://ct:8778 |
+--------------+----------------------------------+
[root@ct ~]#
2.4 安装placement服务
[root@ct ~]# yum -y install openstack-placement-api
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* centos-ceph-nautilus: mirrors.cn99.com
* centos-nfs-ganesha28: mirrors.cn99.com
* centos-openstack-train: mirrors.cn99.com
* centos-qemu-ev: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: mirrors.cn99.com
软件包 openstack-placement-api-2.0.1-1.el7.noarch 已安装并且是最新版本
无须任何处理
[root@ct ~]#
2.5 修改placement配置文件
[root@ct ~]# cp /etc/placement/placement.conf{,.bak} //备份
[root@ct ~]# grep -Ev '^$|#' /etc/placement/placement.conf.bak > /etc/placement/placement.conf //过滤
[root@ct ~]# openstack-config --set /etc/placement/placement.conf placement_database connection mysql+pymysql://placement:PLACEMENT_DBPASS@ct/placement
/placement.conf keystone_authtoken auth_url http://ct:5000/v3
openstack-config --set /etc/placement/placement.conf keystone_authtoken memcached_servers ct:11211
openstack-config --set /etc/placement/placement.conf keystone_authtoken auth_type password
openstack-config --set /etc/placement/placement.conf keystone_authtoken project_domain_name Default
openstack-config --set /etc/placement/placement.conf keystone_authtoken user_domain_name Default
openstack-config --set /etc/placement/placement.conf keystone_authtoken project_name service
openstack-config --set /etc/placement/placement.conf keystone_authtoken username placement
openstack-config --set /etc/placement/placement.conf keystone_authtoken password PLACEMENT_PASS[root@ct ~]# openstack-config --set /etc/placement/placement.conf api auth_strategy keystone
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken auth_url http://ct:5000/v3
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken memcached_servers ct:11211
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken auth_type password
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken project_domain_name Default
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken user_domain_name Default
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken project_name service
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken username placement
[root@ct ~]# openstack-config --set /etc/placement/placement.conf keystone_authtoken password PLACEMENT_PASS
[root@ct ~]# cat /etc/placement/placement.conf
[DEFAULT]
[api]
auth_strategy = keystone
[cors]
[keystone_authtoken]
auth_url = http://ct:5000/v3
memcached_servers = ct:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = placement
password = PLACEMENT_PASS
[oslo_policy]
[placement]
[placement_database]
connection = mysql+pymysql://placement:PLACEMENT_DBPASS@ct/placement
[profiler]
[root@ct ~]#
2.6 初始化数据库
[root@ct ~]# su -s /bin/sh -c "placement-manage db sync" placement
/usr/lib/python2.7/site-packages/pymysql/cursors.py:170: Warning: (1280, u"Name 'alembic_version_pkc' ignored for PRIMARY key.")
result = self._query(query)
[root@ct ~]# mysql -uroot -p123456
Welcome to the MariaDB monitor. Commands end with ; or \\g.
Your MariaDB connection id is 41
Server version: 10.3.20-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
MariaDB [(none)]> use placement;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [placement]> show tables;
+------------------------------+
| Tables_in_placement |
+------------------------------+
| alembic_version |
| allocations |
| consumers |
| inventories |
| placement_aggregates |
| projects |
| resource_classes |
| resource_provider_aggregates |
| resource_provider_traits |
| resource_providers |
| traits |
| users |
+------------------------------+
12 rows in set (0.000 sec)
2.7 修改Apache配置文件
[root@ct ~]# cd /etc/httpd/conf.d/
[root@ct conf.d]# cat 00-placement-api.conf
Listen 8778
<VirtualHost *:8778>
WSGIProcessGroup placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess placement-api processes=3 threads=1 user=placement group=placement
WSGIScriptAlias / /usr/bin/placement-api
<IfVersion >= 2.4>
ErrorLogFormat "%M"
</IfVersion>
ErrorLog /var/log/placement/placement-api.log
#SSLEngine On
#SSLCertificateFile ...
#SSLCertificateKeyFile ...
</VirtualHost>
Alias /placement-api /usr/bin/placement-api
<Location /placement-api>
SetHandler wsgi-script
Options +ExecCGI
WSGIProcessGroup placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
</Location>
[root@ct conf.d]# vim 00-placement-api.conf
[root@ct conf.d]# cat 00-placement-api.conf
Listen 8778
<VirtualHost *:8778>
WSGIProcessGroup placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
WSGIDaemonProcess placement-api processes=3 threads=1 user=placement group=placement
WSGIScriptAlias / /usr/bin/placement-api
<IfVersion >= 2.4>
ErrorLogFormat "%M"
</IfVersion>
ErrorLog /var/log/placement/placement-api.log
#SSLEngine On
#SSLCertificateFile ...
#SSLCertificateKeyFile ...
</VirtualHost>
Alias /placement-api /usr/bin/placement-api
<Location /placement-api>
SetHandler wsgi-script
Options +ExecCGI
WSGIProcessGroup placement-api
WSGIApplicationGroup %{GLOBAL}
WSGIPassAuthorization On
</Location>
<Directory /usr/bin> //此处是bug,必须添加下面的配置来启用对placement api的访问,否则在访问apache的
<IfVersion >= 2.4> //api时会报403;添加在文件的最后即可
Require all granted
</IfVersion>
<IfVersion < 2.4> //apache版本;允许apache访问/usr/bin目录;否则/usr/bin/placement-api将不允许被访问
Order allow,deny
Allow from all //允许apache访问
</IfVersion>
</Directory>
[root@ct conf.d]# systemctl restart httpd
2.8 测试
[root@ct conf.d]# netstat -natp | grep 8778 //监听端口
tcp6 0 0 :::8778 :::* LISTEN 105254/httpd
[root@ct conf.d]# curl ct:8778
{"versions": [{"status": "CURRENT", "min_version": "1.0", "max_version": "1.36", "id": "v1.0", "links": [{"href": "", "rel": "self"}]}]}
[root@ct conf.d]# placement-status upgrade check // 检查placement状态
+----------------------------------+
| Upgrade Check Results |
+----------------------------------+
| Check: Missing Root Provider IDs |
| Result: Success |
| Details: None |
+----------------------------------+
| Check: Incomplete Consumers |
| Result: Success |
| Details: None |
+----------------------------------+
[root@ct conf.d]#
OpenStack-nova组件部署
1.创建nova数据库,并执行授权操作(控制节点)
[root@ct ~]# mysql -uroot -p123456
Welcome to the MariaDB monitor. Commands end with ; or \\g.
Your MariaDB connection id is 44
Server version: 10.3.20-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE nova_api; //创建库
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> CREATE DATABASE nova;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> CREATE DATABASE nova_cell0;
Query OK, 1 row affected (0.000 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS'; //提权
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
Query OK, 0 rows affected (0.001 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)
MariaDB [(none)]> show grants for nova;
+-----------------------------------------------------------------------------------------------------+
| Grants for nova@% |
+-----------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'nova'@'%' IDENTIFIED BY PASSWORD '*B79B482785488AB91D97EAFCAD7BA8839EF65AD3' |
| GRANT ALL PRIVILEGES ON `nova`.* TO 'nova'@'%' |
| GRANT ALL PRIVILEGES ON `nova_api`.* TO 'nova'@'%' |
| GRANT ALL PRIVILEGES ON `nova_cell0`.* TO 'nova'@'%' |
+-----------------------------------------------------------------------------------------------------+
4 rows in set (0.000 sec)
2.管理Nova用户及服务(控制节点)
2.1 创建nova用户
[root@ct ~]# openstack user create --domain default --password NOVA_PASS nova
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | f7151a066eae4de885549a46e9bde601 |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
[root@ct ~]# openstack role add --project service --user nova admin //把nova用户添加到service项目,拥有admin权限
2.2 创建nova服务,关联endpoint
[root@ct ~]# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 6db31b4f5a3e48e8a9a491bb22e24165 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
[root@ct ~]# openstack endpoint create --region RegionOne compute public http://ct:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 84d98eb76e1648f2a28182b32f596e9c |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 6db31b4f5a3e48e8a9a491bb22e24165 |
| service_name | nova |
| service_type | compute |
| url | http://ct:8774/v2.1 |
+--------------+----------------------------------+
[root@ct ~]# openstack endpoint create --region RegionOne compute internal http://ct:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | e97d23c4c4e44487b1bf4f2716ebb2a9 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 6db31b4f5a3e48e8a9a491bb22e24165 |
| service_name | nova |
| service_type | compute |
| url | http://ct:8774/v2.1 |
+--------------+----------------------------------+
[root@ct ~]# openstack endpoint create --region RegionOne compute admin http://ct:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 53edd0d62b8842fdb0d91d700b8c106c |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 6db31b4f5a3e48e8a9a491bb22e24165 |
| service_name | nova |
| service_type | compute |
| url | http://ct:8774/v2.1 |
+--------------+----------------------------------+
[root@ct ~]#
2.3 安装nova组件
[root@ct ~]# yum -y install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* centos-ceph-nautilus: mirrors.aliyun.com
* centos-nfs-ganesha28: mirrors.aliyun.com
* centos-openstack-train: mirrors.aliyun.com
* centos-qemu-ev: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
软件包 1:openstack-nova-api-20.6.0-1.el7.noarch 已安装并且是最新版本
软件包 1:openstack-nova-conductor-20.6.0-1.el7.noarch 已安装并且是最新版本
软件包 1:openstack-nova-novncproxy-20.6.0-1.el7.noarch 已安装并且是最新版本
软件包 1:openstack-nova-scheduler-20.6.0-1.el7.noarch 已安装并且是最新版本
无须任何处理
2.4 修改nova配置文件(nova.conf)
[root@ct ~]# cp -a /etc/nova/nova.conf{,.bak} //备份
[root@ct ~]# grep -Ev '^$|#' /etc/nova/nova.conf.bak > /etc/nova/nova.conf //过滤
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT enabled_apis osapi_compute,metadata
etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct
openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:NOVA_DBPASS@ct/nova_api
openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:NOVA_DBPASS@ct/nova
openstack-config --set /etc/nova/nova.conf placement_database connection mysql+pymysql://placement:PLACEMENT_DBPASS@ct/placement
openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://ct:5000/v3
openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ct:11211
openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
openstack-config --set /etc/nova/nova.conf keystone_authtoken password NOVA_PASS
openstack-config --set /etc/nova/nova.conf vnc enabled true
openstack-config --set /etc/nova/nova.conf vnc server_listen ' $my_ip'
openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address ' $my_ip'
openstack-config --set /etc/nova/nova.conf glance api_servers http://ct:9292
openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
openstack-config --set /etc/nova/nova.conf placement region_name RegionOne
openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
openstack-config --set /etc/nova/nova.conf placement project_name service
openstack-config --set /etc/nova/nova.conf placement auth_type password
openstack-config --set /etc/nova/nova.conf placement user_domain_name De[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT my_ip 192.168.10.100
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT use_neutron true
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT firewall_driver nova.virt.firewall.NoopFirewallDriver
[root@ct ~]# openstack-config --set /etc/nova/nova.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@ct
[root@ct ~]# openstack-config --set /etc/nova/nova.conf api_database connection mysql+pymysql://nova:NOVA_DBPASS@ct/nova_api
[root@ct ~]# openstack-config --set /etc/nova/nova.conf database connection mysql+pymysql://nova:NOVA_DBPASS@ct/nova
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement_database connection mysql+pymysql://placement:PLACEMENT_DBPASS@ct/placement
[root@ct ~]# openstack-config --set /etc/nova/nova.conf api auth_strategy keystone
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_url http://ct:5000/v3
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken memcached_servers ct:11211
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken auth_type password
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken user_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken project_name service
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken username nova
[root@ct ~]# openstack-config --set /etc/nova/nova.conf keystone_authtoken password NOVA_PASS
[root@ct ~]# openstack-config --set /etc/nova/nova.conf vnc enabled true
[root@ct ~]# openstack-config --set /etc/nova/nova.conf vnc server_listen ' $my_ip'
[root@ct ~]# openstack-config --set /etc/nova/nova.conf vnc server_proxyclient_address ' $my_ip'
[root@ct ~]# openstack-config --set /etc/nova/nova.conf glance api_servers http://ct:9292
[root@ct ~]# openstack-config --set /etc/nova/nova.conf oslo_concurrency lock_path /var/lib/nova/tmp
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement region_name RegionOne
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement project_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement project_name service
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement auth_type password
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement user_domain_name Default
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement auth_url http://ct:5000/v3
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement username placement
[root@ct ~]# openstack-config --set /etc/nova/nova.conf placement password PLACEMENT_PASS
[root@ct ~]# cat /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
my_ip = 192.168.10.100
use_neutron = true
firewall_driver = nova.virt.firewall.NoopFirewallDriver
transport_url = rabbit://openstack:RABBIT_PASS@ct
[api]
auth_strategy = keystone
[api_database]
connection = mysql+pymysql://nova:NOVA_DBPASS@ct/nova_api
[barbican]
[cache]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[database]
connection = mysql+pymysql://nova:NOVA_DBPASS@ct/nova
[devices]
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://ct:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
auth_url = http://ct:5000/v3
memcached_servers = ct:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = nova
password = NOVA_PASS
[libvirt]
[metrics]
[mks]
[neutron]
[notifications]
[osapi_v21]
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://ct:5000/v3
username = placement
password = PLACEMENT_PASS
[powervm]
[privsep]
[profiler]
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[upgrade_levels]
[vault]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = true
server_listen = $my_ip
server_proxyclient_address = $my_ip
[workarounds]
[wsgi]
[xenserver]
[xvp]
[zvm]
[placement_database]
connection = mysql+pymysql://placement:PLACEMENT_DBPASS@ct/placement
[root@ct ~]#
2.5 初始化数据库
[root@ct ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@ct ~]# mysql -uroot -p123456
Welcome to the MariaDB monitor. Commands end with ; or \\g.
Your MariaDB connection id is 51
Server version: 10.3.20-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.
MariaDB [nova]> use nova_api
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [nova_api]> show tables;
+------------------------------+
| Tables_in_nova_api |
+------------------------------+
| aggregate_hosts |
| aggregate_metadata |
| aggregates |
| allocations |
| build_requests |
| cell_mappings |
| consumers |
| flavor_extra_specs |
| flavor_projects |
| flavors |
| host_mappings |
| instance_group_member |
| instance_group_policy |
| instance_groups |
| instance_mappings |
| inventories |
| key_pairs |
| migrate_version |
| placement_aggregates |
| project_user_quotas |
| projects |
| quota_classes |
| quota_usages |
| quotas |
| request_specs |
| reservations |
| resource_classes 以上是关于OpenStack-Nova组件部署的主要内容,如果未能解决你的问题,请参考以下文章
OpenStack--T版部署(内容较多,需要细品(❁´◡`❁))!