1. 程式人生 > 其它 >OpenStack-Train版-建立例項錯誤: neutronclient.common.exceptions.Unauthorized

OpenStack-Train版-建立例項錯誤: neutronclient.common.exceptions.Unauthorized

記錄一次OpenStack-Train的建立例項錯誤。

問題描述
建立虛擬機器例項的時候出現錯誤:

Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'keystoneauth1.exceptions.http.Unauthorized'> (HTTP 500) (Request-ID: req-89a91418-1eff-497e-a3f6-e92d9a61cd9f)

問題分析
Nova-api日誌

2021-08-07 18:51:10.263 20866 ERROR nova.network.neutronv2.api [req-7975a767-8612-4d8f-928f-fc56cdd079a4 8186828629f241ee98a33dd99edd1c2a 51054bfb82f24faa9e5f9647aa70821a - default default] The [neutron] section of your nova configuration file must be configured for authentication with the networking service endpoint. See the networking service install guide for details: https://docs.openstack.org/neutron/latest/install/


分析日誌以後發現nova-api的錯誤而導致其他的網路伺服器超時。
根據提示“The [neutron] section of your nova configuration file must be configured for authentication with the networking service endpoint.”大概意思是 必須將nova配置檔案的[neutron]部分配置為與網路服務端點進行身份驗證。
按照錯誤提示開啟官方按照文件:
https://docs.openstack.org/neutron/latest/install/


解決方案
1、修改控制節點nova.conf檔案,新增[neutron]相關配置

vim /etc/nova/nova.conf
[neutron]
# ...
auth_url=http://controller:5000
auth_type=password
project_domain_name=default
user_domain_name=default
region_name=RegionOne
project_name=service
username=neutron
password=NEUTRON_PASS
service_metadata_proxy=true
metadata_proxy_shared_secret=METADATA_SECRET


2、在控制節點重啟nova計算服務

systemctl restart \
openstack-nova-api.service \
openstack-nova-scheduler.service \
openstack-nova-conductor.service \
openstack-nova-novncproxy.service

  



再次重新建立虛擬機器例項問題解決。