openstack rally安装失败后折腾一遭

目前参考下面两篇文章搭建openstack rally, 但是都失败了

https://cloud.tencent.com/developer/article/1158765

https://blog.csdn.net/wylfengyujiancheng/article/details/70404392

这里不记录搭建的具体过程,安装没有成功,反而把openstack环境搞得一片狼藉,无法正常使用集群。 这里记录下问题的现象,以及最后的解决办法。
这也提醒了,要动手去实践, 所有的操作要经过自己环境的验证,不要只参考别的文章,很有可能就是个大坑等着你


问题的一些现象

安装完成后:

[root@test tmp]# 
[root@test tmp]# rally --rally-debug deployment check 
2019-08-21 15:50:51.017 2908919 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-08-21 15:50:51.017 2908919 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-08-21 15:50:51.018 2908919 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.
[root@test tmp]# 
[root@test tmp]# 
[root@test tmp]# 
[root@test tmp]# nova list


^C... terminating nova client
[root@test tmp]# 
[root@test tmp]# 
[root@test tmp]# nova flavor-list
No handlers could be found for logger "keystoneauth.identity.generic.base"
ERROR (ServiceUnavailable): Service Unavailable (HTTP 503)
[root@test tmp]# rally-manage db create 
`rally-manage db ` was deprecated since 0.10.0 version and is going to be removed soon. Please use `rally db `.
Creating database: sqlite:////var/lib/rally/database/rally.sqlite
DB Migration Error: 'DB schema is already under version control. Use upgrade() in
[root@test tmp]# rally-manage db create 
Traceback (most recent call last):
  File "/usr/bin/rally-manage", line 6, in 
    from rally.cli.manage import main
  File "/usr/lib/python2.7/site-packages/rally/cli/manage.py", line 23, in 
    from rally.cli import cliutils
  File "/usr/lib/python2.7/site-packages/rally/cli/cliutils.py", line 34, in 
    from rally import api
  File "/usr/lib/python2.7/site-packages/rally/api.py", line 29, in 
    from rally.common import objects
  File "/usr/lib/python2.7/site-packages/rally/common/objects/__init__.py", line 23, in 
    from rally.common.objects.verifier import Verifier  # noqa
  File "/usr/lib/python2.7/site-packages/rally/common/objects/verifier.py", line 18, in 
    from rally.verification import manager
  File "/usr/lib/python2.7/site-packages/rally/verification/manager.py", line 25, in 
    from rally.common.io import subunit_v2
  File "/usr/lib/python2.7/site-packages/rally/common/io/subunit_v2.py", line 18, in 
    from subunit import v2
  File "/usr/lib/python2.7/site-packages/subunit/__init__.py", line 141, in 
    from iso8601 import iso8601
ImportError: cannot import name iso8601
[root@test tmp]# 
[root@test ~]# 
[root@test ~]# rally deployment create --fromenv --name=openstack
configure() got an unexpected keyword argument 'platform'
[root@test ~]# 
[root@test ~]# 
[root@test ~]# 
[root@test ~]# rally task status
Task 3b53a84e-0d58-4c0f-9a2d-4b910df76f0f: crashed
[root@test ~]# rally task detailed

--------------------------------------------------------------------------------
Task 3b53a84e-0d58-4c0f-9a2d-4b910df76f0f: crashed
--------------------------------------------------------------------------------
PluginNotFound
There is no plugin `NovaServers.boot_and_delete_server` in in any platform.

For more details run:
rally -d task detailed 3b53a84e-0d58-4c0f-9a2d-4b910df76f0f

[root@test ~]# rally -d task detailed 3b53a84e-0d58-4c0f-9a2d-4b910df76f0f
2019-08-21 17:09:37.982 2930025 RALLYDEBUG rally.api [-] INFO logs from urllib3 and requests module are hide.
2019-08-21 17:09:37.983 2930025 RALLYDEBUG rally.api [-] urllib3 insecure warnings are hidden.
2019-08-21 17:09:37.983 2930025 RALLYDEBUG rally.api [-] ERROR log from boto module is hide.

--------------------------------------------------------------------------------
Task 3b53a84e-0d58-4c0f-9a2d-4b910df76f0f: crashed
--------------------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/rally/task/engine.py", line 390, in validate
    self._validate_config_syntax(self.config)
  File "/usr/lib/python2.7/site-packages/rally/common/logging.py", line 248, in wrapper
    result = f(self, *args, **kwargs)
  File "/usr/lib/python2.7/site-packages/rally/task/engine.py", line 334, in _validate_config_syntax
    self._validate_workload(workload, vtype="syntax")
  File "/usr/lib/python2.7/site-packages/rally/task/engine.py", line 259, in _validate_workload
    scenario_cls = scenario.Scenario.get(workload["name"])
  File "/usr/lib/python2.7/site-packages/rally/common/plugin/plugin.py", line 160, in get
    name=name, platform=platform or "in any")
PluginNotFound: There is no plugin `NovaServers.boot_and_delete_server` in in any platform.

[root@test ~]# rally verify create-verifier --type tempest --name tempest-verifier
There is no plugin `tempest` in in any platform.
[root@test ~]# 

[root@test ~]# nova list
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-c70e4fa2-5c4d-4cda-88bd-a03b956b4330)
[root@test ~]# nova list
ERROR (ClientException): The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-c40720d1-312c-46fd-aae6-b248e9e5baff)
[root@test ~]# nova flavor-list
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| ID                                   | Name       | Memory_MB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
| 1                                    | 1-2048-60  | 2048      | 60   | 0         |      | 1     | 1.0         | True      |
+--------------------------------------+------------+-----------+------+-----------+------+-------+-------------+-----------+
[root@test ~]# 
[root@test ~]# 
[root@test ~]# 

[root@test python2.7]# 
[root@test python2.7]# systemctl restart openstack-nova-api
Job for openstack-nova-api.service failed because the control process exited with error code. See "systemctl status openstack-nova-api.service" and "journalctl -xe" for details.
[root@test python2.7]# 
[root@test python2.7]# 
[root@test python2.7]# journalctl -xe                          
-- Unit openstack-nova-api.service has failed.
-- 
-- The result is failed.
Aug 22 12:12:36 test systemd[1]: Unit openstack-nova-api.service entered failed state.
Aug 22 12:12:36 test systemd[1]: openstack-nova-api.service failed.
Aug 22 12:12:37 test systemd[1]: openstack-nova-api.service holdoff time over, scheduling restart.
Aug 22 12:12:37 test systemd[1]: Starting OpenStack Nova API Server...
-- Subject: Unit openstack-nova-api.service has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit openstack-nova-api.service has begun starting up.
Aug 22 12:12:38 test python2[3140919]: detected unhandled Python exception in '/usr/bin/nova-api'
Aug 22 12:12:38 test abrt-server[3140929]: Not saving repeating crash in '/usr/bin/nova-api'
Aug 22 12:12:38 test nova-api[3140919]: Traceback (most recent call last):
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/bin/nova-api", line 6, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.cmd.api import main
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/cmd/api.py", line 34, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova import service
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/service.py", line 31, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova import conductor
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/conductor/__init__.py", line 16, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.conductor import api as conductor_api
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/conductor/api.py", line 22, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.conductor import manager
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/conductor/manager.py", line 26, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.compute import rpcapi as compute_rpcapi
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/compute/rpcapi.py", line 29, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.objects import service as service_obj
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/objects/service.py", line 22, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.notifications.objects import base as notification
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/notifications/__init__.py", line 20, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.notifications.base import audit_period_bounds  # noqa
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/notifications/base.py", line 33, in 
Aug 22 12:12:38 test nova-api[3140919]: from nova.image import glance
Aug 22 12:12:38 test nova-api[3140919]: File "/usr/lib/python2.7/site-packages/nova/image/glance.py", line 27, in 
Aug 22 12:12:38 test nova-api[3140919]: import cryptography
Aug 22 12:12:38 test nova-api[3140919]: ImportError: No module named cryptography
Aug 22 12:12:38 test systemd[1]: openstack-nova-api.service: main process exited, code=exited, status=1/FAILURE
Aug 22 12:12:38 test systemd[1]: Failed to start OpenStack Nova API Server.
-- Subject: Unit openstack-nova-api.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel


总结现象如下:

  1. rally status 失败,搭建失败, 不知道哪里的原因
  2. 搭建完成后, nova list等命令可能无法正常使用了
  3. api服务等启停出现异常, 程序出现各种包异常, 应该是安装过程中更新了不兼容当前openstacl 版本的包
  4. 一些基础包异常

恢复办法

尝试

  1. yum reinstall 重装openstack
  2. 纠正python包, 但问题非常多, 修复失败

最后只有从另外一个controller上打包python包,替换当前controller节点的包
再根据openstack服务提醒进行修复,补齐对应的包重启服务即可

因此在做一些操作前,有必要进行备份,不然恢复起来非常折腾

你可能感兴趣的:(openstack源码分析)