私有云 Openstack Ocata版安装(三)nova组件的安装和配置

  • A+
所属分类:OpenStack  虚拟化/私有云
摘要

部署Openstack的服务器官方推荐两台以上,主要是创建的实例(Instances)实际上占用的是计算节点的资源,因此你的计算节点所拥有的VCPU、Memory,将决定你所创建的实例的最大Vcpu数和内存,或许是基于此种原因考虑,官方建议控制节点和计算节点分离,我此次部署是基于Vmware虚拟机,主要是用于测试环境,因此规划为单控制节点和两个计算节点,本系列会涉及到的部署组件为keystone,glance,nova,neutron,cinder,dashboard。我这次是在三台CentOS 7的服务器进行部署。

私有云 Openstack Ocata版安装(一)Controller部署:https://www.dwhd.org/20180213_234933.html

私有云 Openstack Ocata版安装(二)glance组件的安装和配置:https://www.dwhd.org/20180213_234933.html

一:集群信息简介

节点名 网卡IP 网络和网关 运行业务 配置 系统
Openstack Controller 192.168.200.101
172.18.100.1
172.28.100.1
192.168.200/24   192.168.200.2
172.18.0.0/16      172.18.0.1
172.28.0.0/16      172.28.0.1
MySQL、RabbitMQ、Memcached、Keystone、Glance、Nova、Neutron 4c8g100G CentOS 7.4.1708
Openstack Computer 192.168.200.102
172.18.100.2
172.28.100.2
192.168.200/24   192.168.200.2
172.18.0.0/16      172.18.0.1
172.28.0.0/16      172.28.0.1
Nova-Compute、Neutron 4c8g100G CentOS 7.4.1708
Openstack Network 192.168.200.103
172.18.100.3
172.28.100.3
192.168.200/24   192.168.200.2
172.18.0.0/16      172.18.0.1
172.28.0.0/16      172.28.0.1
4c4g40G CentOS 7.4.1708

二:安装和配置nova组件

使用 OpenStack 计算服务托管和管理云计算系统。OpenStack 计算服务是基础架构即服务(IaaS)系统的重要组成部分。

1安装并配置控制节点

2.1.1先决条件

1. 创建数据库,完成下列步骤:

A. 使用数据库命令行客户端,以 root 身份登录数据库服务器。

B. 创建 nova_api,nova 和 nova_cell0 数据库:

[root@LB-VM-Node-192_168_200_101 ~]# mysql -uroot -pYmY0N2RiOTk4NTc1ZDM1ZWUz
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 78
Server version: 10.0.33-MariaDB-wsrep MariaDB Server, wsrep_25.21.rc3fc46e

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS nova DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.02 sec)

MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS nova_api DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE DATABASE IF NOT EXISTS nova_cell0 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Query OK, 1 row affected (0.01 sec)

MariaDB [(none)]> show databases;
+--------------------+
| Database           |
+--------------------+
| glance             |
| information_schema |
| keystone           |
| mysql              |
| nova               |
| nova_api           |
| nova_cell0         |
| performance_schema |
+--------------------+
8 rows in set (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'controller' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected (0.02 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'controller' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected, 1 warning (0.01 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'controller' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected, 1 warning (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'NDA3YjdiMDgzNWFk';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> \q
Bye
[root@LB-VM-Node-192_168_200_101 ~]#

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

2. 执行 admin 凭据脚本,以便以 admin 身份执行后续命令:

[root@LB-VM-Node-192_168_200_101 ~]# . admin-openrc

3. 创建服务凭据,并完成下列步骤:

A. 创建 nova 用户

[root@LB-VM-Node-192_168_200_101 ~]# openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 2238983b5d6a41a7bc833814e8ea8973 |
| name                | nova                             |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

B. 添加 admin 角色到 nova 用户和 service 项目

[root@LB-VM-Node-192_168_200_101 ~]# openstack role add --project service --user nova admin 

C. 创建 nova 服务实体:

[root@LB-VM-Node-192_168_200_101 ~]# openstack service create --name nova --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute                |
| enabled     | True                             |
| id          | 85111d590359463b85f46c0eff4ae28c |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

4. 创建计算服务的 API 端点:

[root@LB-VM-Node-192_168_200_101 ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 194563ee10b54821b15c6f7dd63715d8 |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 85111d590359463b85f46c0eff4ae28c |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | a2de22fbacb040fc8ae074980f65ef4d |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 85111d590359463b85f46c0eff4ae28c |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 2bb76ade1c6c467b866c238d523be546 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 85111d590359463b85f46c0eff4ae28c |
| service_name | nova                             |
| service_type | compute                          |
| url          | http://controller:8774/v2.1      |
+--------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

5. 创建 Placement 服务用户

[root@LB-VM-Node-192_168_200_101 ~]# openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 565176aec0d94badbb54ce23b39e9717 |
| name                | placement                        |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

6. 将 placement 用户以 admin 角色加入到 service 项目

[root@LB-VM-Node-192_168_200_101 ~]# openstack role add --project service --user placement admin

7. 在身份服务的服务目录中,添加 placement 服务。

[root@LB-VM-Node-192_168_200_101 ~]# openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Placement API                    |
| enabled     | True                             |
| id          | 64c5bd111dca423fb3526e6fd3bf5f25 |
| name        | placement                        |
| type        | placement                        |
+-------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

8. 创建 Placement API 服务端点

[root@LB-VM-Node-192_168_200_101 ~]# openstack endpoint create --region RegionOne placement public http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | a8a2ed279c6b4c2781e70684776c1dec |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 64c5bd111dca423fb3526e6fd3bf5f25 |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# openstack endpoint create --region RegionOne placement internal http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | b9946da6aaff4c0c8cafd1607fb34c33 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 64c5bd111dca423fb3526e6fd3bf5f25 |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# openstack endpoint create --region RegionOne placement admin http://controller:8778
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | e80993f1c6f54a688025a11dbcb24b6a |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 64c5bd111dca423fb3526e6fd3bf5f25 |
| service_name | placement                        |
| service_type | placement                        |
| url          | http://controller:8778           |
+--------------+----------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

4.1.2安装配置组件

1. 安装软件包

[root@LB-VM-Node-192_168_200_101 ~]# yum install -y openstack-nova-api openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy openstack-nova-scheduler \
openstack-nova-placement-api openstack-nova-compute

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

2. 编辑/etc/nova/nova.conf 文件并完成下列操作:

A. 在[DEFAULT]小节,只启用 compute 和 metadata 的 API。

[DEFAULT]
#....
enabled_apis = osapi_compute,metadata

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

B. 在[api_database]和[database]小节,配置数据库访问:

[api_database]
#....
connection = mysql+pymysql://nova:NDA3YjdiMDgzNWFk@controller/nova_api
[database]
#....
connection = mysql+pymysql://nova:NDA3YjdiMDgzNWFk@controller/nova

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

C. 在[DEFAULT]小节配置 RabbitMQ 消息队列访问:

[DEFAULT]
#....
transport_url = rabbit://openstack:MDNiMDhh@controller

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

D. 在[api]和[keystone_authtoken]小节配置身份服务访问信息:

[api]
#....
auth_strategy = keystone

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

[keystone_authtoken]
#....
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = lookback

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

E. 在[DEFAULT]小节,配置 my_ip 配置项为管理节点的管理接口 IP地址。

[DEFAULT]
#....
my_ip = 192.168.200.101

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

F. 在[DEFAULT]小节,启用支持 neutron 网络服务:

[DEFAULT]
#....
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

G. 在[vnc]小节,配置 vnc 代理,使用管理节点的管理接口 IP 地址:

[vnc]
#....
enabled = true
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

H. 在[glance]小节,配置镜像服务 API 的位置:

[glance]
#....
api_servers = http://controller:9292

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

I. 在[oslo_concurrency]小节,配置锁路径:

[oslo_concurrency]
#....
lock_path = /var/lib/nova/tmp

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

J. 在[placement]小节,配置 placement API 信息:

[placement]
#....
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = lookback

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

[root@LB-VM-Node-192_168_200_101 ~]# grep -Ev '^(#|$)' /etc/nova/nova.conf
[DEFAULT]
enabled_apis = osapi_compute,metadata
transport_url = rabbit://openstack:MDNiMDhh@controller
my_ip = 192.168.200.101
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[api]
auth_strategy = keystone
[api_database]
connection = mysql+pymysql://nova:NDA3YjdiMDgzNWFk@controller/nova_api
[barbican]
[cache]
[cells]
[cinder]
[compute]
[conductor]
[console]
[consoleauth]
[cors]
[crypto]
[database]
connection = mysql+pymysql://nova:NDA3YjdiMDgzNWFk@controller/nova
[ephemeral_storage_encryption]
[filter_scheduler]
[glance]
api_servers = http://controller:9292
[guestfs]
[healthcheck]
[hyperv]
[ironic]
[key_manager]
[keystone]
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = lookback
[libvirt]
[matchmaker_redis]
[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_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[pci]
[placement]
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = lookback
[quota]
[rdp]
[remote_debug]
[scheduler]
[serial_console]
[service_user]
[spice]
[trusted_computing]
[upgrade_levels]
[vendordata_dynamic_auth]
[vmware]
[vnc]
enabled = true
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
[workarounds]
[wsgi]
[xenserver]
[xvp]
[root@LB-VM-Node-192_168_200_101 ~]# 

K. 由于软件包 bug,必须将下列配置添加到文件/etc/httpd/conf.d/00-nova-placement-api.conf 中,以启用对 Placement API的访问。

<Directory /usr/bin>
   <IfVersion >= 2.4>
      Require all granted
   </IfVersion>
   <IfVersion < 2.4>
      Order allow,deny
      Allow from all
   </IfVersion>
</Directory>

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

L. 重启 httpd 服务:

[root@LB-VM-Node-192_168_200_101 ~]# systemctl restart httpd

大家可以通过status命令来查看服务的状态,如图所示:

[root@LB-VM-Node-192_168_200_101 ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since 三 2018-02-14 17:45:48 CST; 35s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 38713 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
 Main PID: 38728 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─38728 /usr/sbin/httpd -DFOREGROUND
           ├─38729 /usr/sbin/httpd -DFOREGROUND
           ├─38730 /usr/sbin/httpd -DFOREGROUND
           ├─38731 /usr/sbin/httpd -DFOREGROUND
           ├─38732 (wsgi:keystone- -DFOREGROUND
           ├─38733 (wsgi:keystone- -DFOREGROUND
           ├─38734 (wsgi:keystone- -DFOREGROUND
           ├─38735 (wsgi:keystone- -DFOREGROUND
           ├─38736 (wsgi:keystone- -DFOREGROUND
           ├─38737 (wsgi:keystone- -DFOREGROUND
           ├─38738 (wsgi:keystone- -DFOREGROUND
           ├─38739 (wsgi:keystone- -DFOREGROUND
           ├─38740 (wsgi:keystone- -DFOREGROUND
           ├─38741 (wsgi:keystone- -DFOREGROUND
           ├─38742 /usr/sbin/httpd -DFOREGROUND
           ├─38743 /usr/sbin/httpd -DFOREGROUND
           ├─38744 /usr/sbin/httpd -DFOREGROUND
           ├─38745 /usr/sbin/httpd -DFOREGROUND
           └─38746 /usr/sbin/httpd -DFOREGROUND

2月 14 17:45:48 LB-VM-Node-192_168_200_101.dwhd.org systemd[1]: Starting The Apache HTTP Server...
2月 14 17:45:48 LB-VM-Node-192_168_200_101.dwhd.org systemd[1]: Started The Apache HTTP Server.
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

3. 初始化 nova_api 数据库:

[root@LB-VM-Node-192_168_200_101 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova

4. 注册 cell0 数据库

[root@LB-VM-Node-192_168_200_101 ~]# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova

5. 创建 cell1 cell

[root@LB-VM-Node-192_168_200_101 ~]# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
d96c3ad3-4349-4746-8318-1c81e0d910b2
[root@LB-VM-Node-192_168_200_101 ~]#

6. 初始化 nova 数据库

[root@LB-VM-Node-192_168_200_101 ~]# su -s /bin/sh -c "nova-manage db sync" nova
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (1831, u'Duplicate index `block_device_mapping_instance_uuid_virtual_name_device_name_idx`. This is deprecated and will be disallowed in a future release.')
  result = self._query(query)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (1831, u'Duplicate index `uniq_instances0uuid`. This is deprecated and will be disallowed in a future release.')
  result = self._query(query)
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

7. 验证 nova cell0 和 cell1 已经注册

[root@LB-VM-Node-192_168_200_101 ~]# nova-manage cell_v2 list_cells
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
|  名称 |                 UUID                 |           Transport URL            |                    数据库连接                   |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
| cell0 | 00000000-0000-0000-0000-000000000000 |               none:/               | mysql+pymysql://nova:****@controller/nova_cell0 |
| cell1 | d96c3ad3-4349-4746-8318-1c81e0d910b2 | rabbit://openstack:****@controller |    mysql+pymysql://nova:****@controller/nova    |
+-------+--------------------------------------+------------------------------------+-------------------------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

检查数据库里面是否有数据:

[root@LB-VM-Node-192_168_200_101 ~]# mysql -uroot -pYmY0N2RiOTk4NTc1ZDM1ZWUz nova -e "show tables;"
+--------------------------------------------+
| Tables_in_nova                             |
+--------------------------------------------+
| agent_builds                               |
| aggregate_hosts                            |
| aggregate_metadata                         |
| aggregates                                 |
| allocations                                |
| block_device_mapping                       |
| bw_usage_cache                             |
| cells                                      |
| certificates                               |
| compute_nodes                              |
| console_auth_tokens                        |
| console_pools                              |
| consoles                                   |
| dns_domains                                |
| fixed_ips                                  |
| floating_ips                               |
| instance_actions                           |
| instance_actions_events                    |
| instance_extra                             |
| instance_faults                            |
| instance_group_member                      |
| instance_group_policy                      |
| instance_groups                            |
| instance_id_mappings                       |
| instance_info_caches                       |
| instance_metadata                          |
| instance_system_metadata                   |
| instance_type_extra_specs                  |
| instance_type_projects                     |
| instance_types                             |
| instances                                  |
| inventories                                |
| key_pairs                                  |
| migrate_version                            |
| migrations                                 |
| networks                                   |
| pci_devices                                |
| project_user_quotas                        |
| provider_fw_rules                          |
| quota_classes                              |
| quota_usages                               |
| quotas                                     |
| reservations                               |
| resource_provider_aggregates               |
| resource_providers                         |
| s3_images                                  |
| security_group_default_rules               |
| security_group_instance_association        |
| security_group_rules                       |
| security_groups                            |
| services                                   |
| shadow_agent_builds                        |
| shadow_aggregate_hosts                     |
| shadow_aggregate_metadata                  |
| shadow_aggregates                          |
| shadow_block_device_mapping                |
| shadow_bw_usage_cache                      |
| shadow_cells                               |
| shadow_certificates                        |
| shadow_compute_nodes                       |
| shadow_console_pools                       |
| shadow_consoles                            |
| shadow_dns_domains                         |
| shadow_fixed_ips                           |
| shadow_floating_ips                        |
| shadow_instance_actions                    |
| shadow_instance_actions_events             |
| shadow_instance_extra                      |
| shadow_instance_faults                     |
| shadow_instance_group_member               |
| shadow_instance_group_policy               |
| shadow_instance_groups                     |
| shadow_instance_id_mappings                |
| shadow_instance_info_caches                |
| shadow_instance_metadata                   |
| shadow_instance_system_metadata            |
| shadow_instance_type_extra_specs           |
| shadow_instance_type_projects              |
| shadow_instance_types                      |
| shadow_instances                           |
| shadow_key_pairs                           |
| shadow_migrate_version                     |
| shadow_migrations                          |
| shadow_networks                            |
| shadow_pci_devices                         |
| shadow_project_user_quotas                 |
| shadow_provider_fw_rules                   |
| shadow_quota_classes                       |
| shadow_quota_usages                        |
| shadow_quotas                              |
| shadow_reservations                        |
| shadow_s3_images                           |
| shadow_security_group_default_rules        |
| shadow_security_group_instance_association |
| shadow_security_group_rules                |
| shadow_security_groups                     |
| shadow_services                            |
| shadow_snapshot_id_mappings                |
| shadow_snapshots                           |
| shadow_task_log                            |
| shadow_virtual_interfaces                  |
| shadow_volume_id_mappings                  |
| shadow_volume_usage_cache                  |
| snapshot_id_mappings                       |
| snapshots                                  |
| tags                                       |
| task_log                                   |
| virtual_interfaces                         |
| volume_id_mappings                         |
| volume_usage_cache                         |
+--------------------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# mysql -uroot -pYmY0N2RiOTk4NTc1ZDM1ZWUz nova_api -e "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             |
| resource_provider_aggregates |
| resource_provider_traits     |
| resource_providers           |
| traits                       |
| users                        |
+------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# mysql -uroot -pYmY0N2RiOTk4NTc1ZDM1ZWUz nova_cell0 -e "show tables;"
+--------------------------------------------+
| Tables_in_nova_cell0                       |
+--------------------------------------------+
| agent_builds                               |
| aggregate_hosts                            |
| aggregate_metadata                         |
| aggregates                                 |
| allocations                                |
| block_device_mapping                       |
| bw_usage_cache                             |
| cells                                      |
| certificates                               |
| compute_nodes                              |
| console_auth_tokens                        |
| console_pools                              |
| consoles                                   |
| dns_domains                                |
| fixed_ips                                  |
| floating_ips                               |
| instance_actions                           |
| instance_actions_events                    |
| instance_extra                             |
| instance_faults                            |
| instance_group_member                      |
| instance_group_policy                      |
| instance_groups                            |
| instance_id_mappings                       |
| instance_info_caches                       |
| instance_metadata                          |
| instance_system_metadata                   |
| instance_type_extra_specs                  |
| instance_type_projects                     |
| instance_types                             |
| instances                                  |
| inventories                                |
| key_pairs                                  |
| migrate_version                            |
| migrations                                 |
| networks                                   |
| pci_devices                                |
| project_user_quotas                        |
| provider_fw_rules                          |
| quota_classes                              |
| quota_usages                               |
| quotas                                     |
| reservations                               |
| resource_provider_aggregates               |
| resource_providers                         |
| s3_images                                  |
| security_group_default_rules               |
| security_group_instance_association        |
| security_group_rules                       |
| security_groups                            |
| services                                   |
| shadow_agent_builds                        |
| shadow_aggregate_hosts                     |
| shadow_aggregate_metadata                  |
| shadow_aggregates                          |
| shadow_block_device_mapping                |
| shadow_bw_usage_cache                      |
| shadow_cells                               |
| shadow_certificates                        |
| shadow_compute_nodes                       |
| shadow_console_pools                       |
| shadow_consoles                            |
| shadow_dns_domains                         |
| shadow_fixed_ips                           |
| shadow_floating_ips                        |
| shadow_instance_actions                    |
| shadow_instance_actions_events             |
| shadow_instance_extra                      |
| shadow_instance_faults                     |
| shadow_instance_group_member               |
| shadow_instance_group_policy               |
| shadow_instance_groups                     |
| shadow_instance_id_mappings                |
| shadow_instance_info_caches                |
| shadow_instance_metadata                   |
| shadow_instance_system_metadata            |
| shadow_instance_type_extra_specs           |
| shadow_instance_type_projects              |
| shadow_instance_types                      |
| shadow_instances                           |
| shadow_key_pairs                           |
| shadow_migrate_version                     |
| shadow_migrations                          |
| shadow_networks                            |
| shadow_pci_devices                         |
| shadow_project_user_quotas                 |
| shadow_provider_fw_rules                   |
| shadow_quota_classes                       |
| shadow_quota_usages                        |
| shadow_quotas                              |
| shadow_reservations                        |
| shadow_s3_images                           |
| shadow_security_group_default_rules        |
| shadow_security_group_instance_association |
| shadow_security_group_rules                |
| shadow_security_groups                     |
| shadow_services                            |
| shadow_snapshot_id_mappings                |
| shadow_snapshots                           |
| shadow_task_log                            |
| shadow_virtual_interfaces                  |
| shadow_volume_id_mappings                  |
| shadow_volume_usage_cache                  |
| snapshot_id_mappings                       |
| snapshots                                  |
| tags                                       |
| task_log                                   |
| virtual_interfaces                         |
| volume_id_mappings                         |
| volume_usage_cache                         |
+--------------------------------------------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

4.1.3完成安装

1. 探测你的计算节点是否支持硬件虚拟机化:

[root@LB-VM-Node-192_168_200_101 ~]# egrep -c '(vmx|svm)' /proc/cpuinfo
0
[root@LB-VM-Node-192_168_200_101 ~]#

如果结果大于或等于 1,则表示你的计算节点支持硬件虚拟化。如果等于 0,则表示不支持,那么你必须配置 libvirt,用 QEMU 代替KVM。

编辑/etc/nova/nova.conf 文件中的[libvirt]小节:

[libvirt]
# ...
virt_type = qemu

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

2. 启动计算服务并设置开机自动运行:

[root@LB-VM-Node-192_168_200_101 ~]# systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-api.service to /usr/lib/systemd/system/openstack-nova-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-consoleauth.service to /usr/lib/systemd/system/openstack-nova-consoleauth.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-scheduler.service to /usr/lib/systemd/system/openstack-nova-scheduler.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-conductor.service to /usr/lib/systemd/system/openstack-nova-conductor.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-nova-novncproxy.service to /usr/lib/systemd/system/openstack-nova-novncproxy.service.
[root@LB-VM-Node-192_168_200_101 ~]#
[root@LB-VM-Node-192_168_200_101 ~]# systemctl start openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

[root@LB-VM-Node-192_168_200_101 ~]# systemctl status openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
● openstack-nova-api.service - OpenStack Nova API Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-api.service; enabled; vendor preset: disabled)
   Active: active (running) since 三 2018-02-14 21:36:26 CST; 51s ago
 Main PID: 58256 (nova-api)
   CGroup: /system.slice/openstack-nova-api.service
           ├─58256 /usr/bin/python2 /usr/bin/nova-api
           ├─58314 /usr/bin/python2 /usr/bin/nova-api
           ├─58315 /usr/bin/python2 /usr/bin/nova-api
           ├─58316 /usr/bin/python2 /usr/bin/nova-api
           ├─58317 /usr/bin/python2 /usr/bin/nova-api
           ├─58318 /usr/bin/python2 /usr/bin/nova-api
           ├─58319 /usr/bin/python2 /usr/bin/nova-api
           ├─58321 /usr/bin/python2 /usr/bin/nova-api
           └─58323 /usr/bin/python2 /usr/bin/nova-api

2月 14 21:36:18 controller systemd[1]: Starting OpenStack Nova API Server...
2月 14 21:36:26 controller systemd[1]: Started OpenStack Nova API Server.

● openstack-nova-consoleauth.service - OpenStack Nova VNC console auth Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-consoleauth.service; enabled; vendor preset: disabled)
   Active: active (running) since 三 2018-02-14 21:36:22 CST; 55s ago
 Main PID: 58257 (nova-consoleaut)
   CGroup: /system.slice/openstack-nova-consoleauth.service
           └─58257 /usr/bin/python2 /usr/bin/nova-consoleauth

2月 14 21:36:18 controller systemd[1]: Starting OpenStack Nova VNC console auth Server...
2月 14 21:36:22 controller systemd[1]: Started OpenStack Nova VNC console auth Server.

● openstack-nova-scheduler.service - OpenStack Nova Scheduler Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-scheduler.service; enabled; vendor preset: disabled)
   Active: active (running) since 三 2018-02-14 21:36:22 CST; 55s ago
 Main PID: 58258 (nova-scheduler)
   CGroup: /system.slice/openstack-nova-scheduler.service
           └─58258 /usr/bin/python2 /usr/bin/nova-scheduler

2月 14 21:36:18 controller systemd[1]: Starting OpenStack Nova Scheduler Server...
2月 14 21:36:22 controller systemd[1]: Started OpenStack Nova Scheduler Server.

● openstack-nova-conductor.service - OpenStack Nova Conductor Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-conductor.service; enabled; vendor preset: disabled)
   Active: active (running) since 三 2018-02-14 21:36:22 CST; 56s ago
 Main PID: 58259 (nova-conductor)
   CGroup: /system.slice/openstack-nova-conductor.service
           ├─58259 /usr/bin/python2 /usr/bin/nova-conductor
           ├─58308 /usr/bin/python2 /usr/bin/nova-conductor
           ├─58309 /usr/bin/python2 /usr/bin/nova-conductor
           ├─58310 /usr/bin/python2 /usr/bin/nova-conductor
           └─58311 /usr/bin/python2 /usr/bin/nova-conductor

2月 14 21:36:18 controller systemd[1]: Starting OpenStack Nova Conductor Server...
2月 14 21:36:22 controller systemd[1]: Started OpenStack Nova Conductor Server.

● openstack-nova-novncproxy.service - OpenStack Nova NoVNC Proxy Server
   Loaded: loaded (/usr/lib/systemd/system/openstack-nova-novncproxy.service; enabled; vendor preset: disabled)
   Active: active (running) since 三 2018-02-14 21:36:18 CST; 59s ago
 Main PID: 58260 (nova-novncproxy)
   CGroup: /system.slice/openstack-nova-novncproxy.service
           └─58260 /usr/bin/python2 /usr/bin/nova-novncproxy --web /usr/share/novnc/

2月 14 21:36:18 controller systemd[1]: Started OpenStack Nova NoVNC Proxy Server.
2月 14 21:36:18 controller systemd[1]: Starting OpenStack Nova NoVNC Proxy Server...
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

[root@LB-VM-Node-192_168_200_101 ~]# openstack service list --long
+----------------------------------+-----------+-----------+-------------------+---------+
| ID                               | Name      | Type      | Description       | Enabled |
+----------------------------------+-----------+-----------+-------------------+---------+
| 265b4f3ec5494fafaa80dc33c2e4b1c3 | nova      | compute   | OpenStack Compute | True    |
| 83f39ed0bd274894ae6daf869ab5a767 | glance    | image     | OpenStack Image   | True    |
| 8b1f2346a33f4a12951d5b9b58aaf4cc | placement | placement | Placement API     | True    |
| 979284b23b2641c2a8f457a9f9099952 | keystone  | identity  |                   | True    |
+----------------------------------+-----------+-----------+-------------------+---------+
[root@LB-VM-Node-192_168_200_101 ~]# 

私有云 Openstack Ocata版安装(三)nova组件的安装和配置

lookback

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: