初めに
OpenStack Rockyでcomputeノードを構築していて、ちょいハマりしたので備忘として残しておく
環境
- 仮想マシン
- OS:CentOS7.7
- OpenStack
- OpenStack : Rocky
- Novaパッケージ : openstack-nova-compute-18.2.2-1.el7.noarch
※OpenStackはPackStackなどを使わずに、サービスを個別にインストールした
事象
OpenStack Computeノード上にNovaをインストールして、起動を試みた際に以下のようなメッセージが出力されて起動が失敗した
# systemctl start openstack-nova-compute.service
Job for openstack-nova-compute.service failed because the control process exited with error code. See "systemctl status openstack-nova-compute.service" and "journalctl -xe" for details.
journalを見てみると
0月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: File "/usr/lib/python2.7/site-packages/nova/conf/cinder.py", line 16, in <module>
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: from keystoneauth1 import loading as ks_loading
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/__init__.py", line 13, in <module>
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: from keystoneauth1.loading import adapter
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: File "/usr/lib/python2.7/site-packages/keystoneauth1/loading/adapter.py", line 13, in <module>
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: from keystoneauth1 import adapter
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: File "/usr/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 16, in <module>
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: from keystoneauth1 import session
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: File "/usr/lib/python2.7/site-packages/keystoneauth1/session.py", line 25, in <module>
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: import requests
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: File "/usr/lib/python2.7/site-packages/requests/__init__.py", line 94, in <module>
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: from urllib3.exceptions import DependencyWarning
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: ImportError: cannot import name DependencyWarning
10月 08 09:52:37 OpenStackAllInOne02 systemd[1]: openstack-nova-compute.service: main process exited, code=exited, status=1/FAILURE
10月 08 09:52:37 OpenStackAllInOne02 systemd[1]: Failed to start OpenStack Nova Compute Server.
-- Subject: Unit openstack-nova-compute.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit openstack-nova-compute.service has failed.
--
-- The result is failed.
と出力された
解決策
以下からPythonのライブラリインポートエラーではないかと考えられる
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: from urllib3.exceptions import DependencyWarning
10月 08 09:52:37 OpenStackAllInOne02 nova-compute[14820]: ImportError: cannot import name DependencyWarning
関連ライブラリをupdateする
pip install --upgrade request
※参考 : https://stackoverflow.com/questions/44927351/importerror-cannot-import-name-dependencywarning
update後、Novaが起動するようになった
# systemctl start openstack-nova-compute
# systemctl status openstack-nova-compute
● openstack-nova-compute.service - OpenStack Nova Compute Server
Loaded: loaded (/usr/lib/systemd/system/openstack-nova-compute.service; disabled; vendor preset: disabled)
Active: active (running) since 火 2019-10-08 10:41:42 JST; 1min 8s ago
Main PID: 14931 (nova-compute)
Tasks: 22
CGroup: /system.slice/openstack-nova-compute.service
mq14931 /usr/bin/python2 /usr/bin/nova-compute
10月 08 10:06:58 OpenStackAllInOne02 systemd[1]: Starting OpenStack Nova Compute Server...
10月 08 10:41:42 OpenStackAllInOne02 systemd[1]: Started OpenStack Nova Compute Server.
やっぱりOpenStackの環境構築は大変だわ。。