glance image-list 错误

Submitted by Lizhe on Tue, 07/11/2017 - 16:27

 

我觉得我需要吐槽一下openstack的log .... 基本上你很难很难从log发现rootcause ... =.=

[root@centos_admin ~]# glance image-list
500 Internal Server Error: The server has either erred or is incapable of performing the requested operation. (HTTP 500)

处理办法

修改SELinux添加权限
ausearch -c 'glance-api' --raw | audit2allow -M my-glanceapi
semodule -i my-glanceapi.pp

当然简单粗暴直接关闭SELinux也行
临时关闭SELinux
setenforce 0

临时打开SELinux
setenforce 1

开机关闭SELinux
编辑/etc/selinux/config文件,将SELINUX的值设置为disabled

查看SELinux状态
执行getenforce命令

[root@centos_admin ~]# glance image-list
You must provide a username via either --os-username or env[OS_USERNAME]
 

处理办法 source 以下内容

[root@centos_admin ~]# cat admin-openrc.sh 
export OS_PROJECT_DOMAIN_ID=default 
export OS_USER_DOMAIN_ID=default 
export OS_PROJECT_NAME=admin 
export OS_TENANT_NAME=admin 
export OS_USERNAME=admin 
export OS_PASSWORD=admin 
export OS_AUTH_URL=http://192.168.1.151:35357/v3 
export OS_IDENTITY_API_VERSION=3

export OS_IMAGE_API_VERSION=2