root@controller:/home/dhbm# openstack server create --flavor m1.nano --image cirros.0.5.2
–nic net-id=1c17dcdc-ab9a-4324-8dc0-e5a21515323d --security-group default
–key-name mykey provider-instance

报错

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-2d5d4413-4e7b-413a-bed5-920e8b3c80bd)

查看错误日志

root@controller:/home/dhbm# tail /var/log/nova/nova-api.log

2022-12-06 13:46:49.000 2054 ERROR nova.api.openstack.wsgi     raise exceptions.from_response(resp, method, url)
2022-12-06 13:46:49.000 2054 ERROR nova.api.openstack.wsgi keystoneauth1.exceptions.http.Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: req-6c59084a-b54a-430b-a7f3-7c6152c978a8)
2022-12-06 13:46:49.000 2054 ERROR nova.api.openstack.wsgi 
2022-12-06 13:46:49.003 2054 INFO nova.api.openstack.wsgi [req-1dbb9a99-ab67-46f2-aab1-b05f2353f29a fa56979083f94f33b22c0dc44cd0baa4 46fa52e179854921b1f9ad7f034ec645 - default default] HTTP exception thrown: 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'>
2022-12-06 13:46:49.005 2054 INFO nova.osapi_compute.wsgi.server [req-1dbb9a99-ab67-46f2-aab1-b05f2353f29a fa56979083f94f33b22c0dc44cd0baa4 46fa52e179854921b1f9ad7f034ec645 - default default] 127.0.0.1 "POST /v2.1/servers HTTP/1.1" status: 500 len: 649 time: 5.6900895
2022-12-06 13:47:24.373 2055 INFO nova.osapi_compute.wsgi.server [-] 127.0.0.1 "GET /v2.1 HTTP/1.1" status: 200 len: 783 time: 0.0019321
2022-12-06 13:47:24.753 2055 WARNING oslo_db.sqlalchemy.utils [req-0d24a8b1-2663-4602-8d1a-1384ef033851 fa56979083f94f33b22c0dc44cd0baa4 46fa52e179854921b1f9ad7f034ec645 - default default] Unique keys not in sort_keys. The sorting order may be unstable.
2022-12-06 13:47:24.760 2055 WARNING oslo_db.sqlalchemy.utils [req-0d24a8b1-2663-4602-8d1a-1384ef033851 fa56979083f94f33b22c0dc44cd0baa4 46fa52e179854921b1f9ad7f034ec645 - default default] Unique keys not in sort_keys. The sorting order may be unstable.
2022-12-06 13:47:24.774 2055 INFO nova.osapi_compute.wsgi.server [req-0d24a8b1-2663-4602-8d1a-1384ef033851 fa56979083f94f33b22c0dc44cd0baa4 46fa52e179854921b1f9ad7f034ec645 - default default] 127.0.0.1 "GET /v2.1/os-keypairs HTTP/1.1" status: 200 len: 1116 time: 0.3940530

手动配置,只要有错。大概率就是某个地方疏忽了
看日志情况,应该是 nova.conf 中 passowrd 错了

vim /etc/nova/nova.conf

果然发现遗漏了

在这里插入图片描述

改正后,按照 Install and configure controller node for Ubuntu 重启服务

# service nova-api restart
# service nova-scheduler restart
# service nova-conductor restart
# service nova-novncproxy restart

如果存在 compute 节点的话,按照Install and configure a compute node for Ubuntu 重新同步发现

也在 Controller 节点执行

$ . admin-openrc

$ openstack compute service list --service nova-compute

# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐