问题描述
新人提问,求各位前辈指点迷津按照网上的一篇教程搭建openstack,一步步走到安装glance遇到了问题,我试图执行上传镜像的命令glanceimage-create--namemyFirstImage--is-publictrue--container-formatbare--disk-formatqcow2--locationhttp://download.cirros-cloud.net...3.1-x86_64-disk.img结果报错raiseexception.NotAuthenticated(res.read())NotAuthenticated:401UnauthorizedThisservercouldnotverifythatyouareauthorizedtoaccessthedocumentyourequested.Eitheryousuppliedthewrongcredentials(e.g.,badpassword),oryourbrowserdoesnotunderstandhowtosupplythecredentialsrequired.Authenticationrequired(HTTP500)我看了一下,大约是权限不对,密码错误。在论坛上浏览了一下帖子,感觉是环境变量的问题。这是我的环境变量exportOS_TENANT_NAME="admin"exportOS_USERNAME="admin"exportOS_PASSWORD="admin_pass"exportOS_AUTH_URL="http://192.168.1.50:5000/v2.0/"注册用户时使用的参数是HOST_IP=10.10.10.51ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin_pass}SERVICE_PASSWORD=${SERVICE_PASSWORD:-service_pass}exportSERVICE_TOKEN="ADMIN"exportSERVICE_ENDPOINT="http://${HOST_IP}:35357/v2.0"SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME:-service}实在不知道哪里的问题,当我把password从admin_pass改为其他时,会直接提示Unabletocommunicatewithidentityservice:{"error":{"message":"Therequestyouhavemaderequiresauthentication.","code":401,"title":"NotAuthorized"}}.(HTTP401)累感不爱,还望各位大神拨冗解答
解决方案
解决方案二:
环境变量问题,在导入一次环境变量里,或者直接写入到文件中