说明
环境: Ubuntu server20,openstack Ussuri
提示400错误: Block Device Mapping is Invalid: failed to get volume e8dc8e2b-e96d-4402-9767-0007872255d1. (HTTP 400) (Request-ID: req-bbea9863-b078-4ebd-9c64-d484cdade379)
提示500错误: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible. <class ‘keystoneauth1.exceptions.discovery.DiscoveryFailure’> (HTTP 500) (Request-ID: req-a7583298-9ec9-460e-977c-eaf662df6f7e)
解决办法
操作如下:
vim /etc/nova/nova.conf
[service_user]
send_service_user_token = true
auth_url = https://controller/identity #解决问题所在
auth_strategy = keystone
auth_type = password
project_domain_name = Default
project_name = service
user_domain_name = Default
username = nova
password = nova
备注:auth_url 处需要注意两个点
- keystone认证地址用的是http、https协议
- keystone认证地址的端口号是80还是5000
#重启nova服务
$ service nova-api restart
$ service nova-scheduler restart
$ service nova-conductor restart
$ service nova-novncproxy restart
结论
两个错误与nova的配置和keystone的认证地址有关。