openstack创建实例报错

1、使用普通用户在Horizon页面创建虚机的时候失败,并提示危险:在提交表单时出现错误,请再次尝试

image.png

通过查看Horizon的日志发现如下报错

(horizon)[root@root horizon]# tail -100f horizon.log
[Mon Dec 10 08:15:26.579560 2018] [:error] [pid 37:tid 140566874670848]   File "/var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../novaclient/base.py", line 72, in _list
[Mon Dec 10 08:15:26.579565 2018] [:error] [pid 37:tid 140566874670848]     _resp, body = self.api.client.get(url)
[Mon Dec 10 08:15:26.579569 2018] [:error] [pid 37:tid 140566874670848]   File "/var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../novaclient/client.py", line 446, in get
[Mon Dec 10 08:15:26.579574 2018] [:error] [pid 37:tid 140566874670848]     return self._cs_request(url, 'GET', **kwargs)
[Mon Dec 10 08:15:26.579586 2018] [:error] [pid 37:tid 140566874670848]   File "/var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../novaclient/client.py", line 424, in _cs_request
[Mon Dec 10 08:15:26.579613 2018] [:error] [pid 37:tid 140566874670848]     resp, body = self._time_request(url, method, **kwargs)
[Mon Dec 10 08:15:26.579618 2018] [:error] [pid 37:tid 140566874670848]   File "/var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../novaclient/client.py", line 397, in _time_request
[Mon Dec 10 08:15:26.579624 2018] [:error] [pid 37:tid 140566874670848]     resp, body = self.request(url, method, **kwargs)
[Mon Dec 10 08:15:26.579629 2018] [:error] [pid 37:tid 140566874670848]   File "/var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/wsgi/../../novaclient/client.py", line 391, in request
[Mon Dec 10 08:15:26.579634 2018] [:error] [pid 37:tid 140566874670848]     raise exceptions.from_response(resp, body, url, method)
[Mon Dec 10 08:15:26.579639 2018] [:error] [pid 37:tid 140566874670848] Forbidden: Policy doesn't allow os_compute_api:servers:detail:get_all_tenants to be performed. (HTTP 403) (Request-ID: req-d73514ec-cbb9-45c0-9fed-432679a79118)
image.png

原来是权限问题导致普通用户不能创建虚机

解决办法如下:

(horizon)[root@root horizon]# vim /var/lib/kolla/venv/lib/python2.7/site-packages/openstack_dashboard/usage/quotas.py

按照以下链接删掉标红的部分

https://review.openstack.org/#/c/422760/1/openstack_dashboard/usage/quotas.py

image.png

你可能感兴趣的:(openstack创建实例报错)