glanceclient的安装和配置
搜索对应openstack版本,安装对应relaease版本,然后搜索glanceclient,安装。
dnf search all openstack
dnf install centos-release-openstack-yoga.noarch -y
dnf search all glance
dnf install python3-glanceclient
dnf install python3-glanceclient -y
环境配置
export OS_PROJECT_DOMAIN_NAME=Default
export OS_USER_DOMAIN_NAME=Default
# glance 在service项目下,这里选择service,需根据实际修改。
export OS_PROJECT_NAME=service
export OS_USERNAME=GLANCE
export OS_PASSWORD=GLANCE_PASS
# service对应的
export OS_PROJECT_ID=d660e1d89bca45329cd3bf9f7ef8368b
# identical api
export OS_AUTH_URL=http://OPENSTACK:5000/v3
export OS_IMAGE_URL=http://OPENSTACK:9292
# 这里的token需要认证获取。修改。
export OS_AUTH_TOKEN=gAAAAABknn-JUWRwbCrIl3FY4xtEtQ9FGMEBhn5q_umwBAXIJ3Qy8Bt237oiHmo3demVB2T2-5z7Jd2gAEWdDIiZNxgbCJi-ABGMtRNZov_gqHiEWH9fG1X27XQsNV6xZFMtt5ce82hR9LSHXDEtbsUfe-edaYspmeccdoAFpAR-p_dv04FAia8
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
获取token
curl -s -X POST $OS_AUTH_URL/auth/tokens?nocatalog -H "Content-Type: application/json" -d '{ "auth": { "identity": { "methods": ["password"],"password": {"user": {"domain": {"name": "'"$OS_USER_DOMAIN_NAME"'"},"name": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"} } }, "scope": { "project": { "domain": { "name": "'"$OS_PROJECT_DOMAIN_NAME"'" }, "name": "'"$OS_PROJECT_NAME"'" } } }}' -D - | awk '/X-Subject-Token/ { print $2 }'
获取token来修改环境变量值的token。
curl -s -X POST $OS_AUTH_URL/auth/tokens?nocatalog -H "Content-Type: application/json" -d '{ "auth": { "identity": { "methods": ["password"],"password": {"user": {"domain": {"name": "'"$OS_USER_DOMAIN_NAME"'"},"name": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"} } }, "scope": { "project": { "domain": { "name": "'"$OS_PROJECT_DOMAIN_NAME"'" }, "name": "'"$OS_PROJECT_NAME"'" } } }}' -D - | awk '/X-Subject-Token/ { print "/^export OS_AUTH_TOKEN=/s/=.*/=" $2 "/" }' | sed -i -f - ~/.bashrc
加载环境变量
source ~/.bashrc
标签:NAME,PROJECT,opsenstack,client,export,glance,password,OS,name
From: https://www.cnblogs.com/linga/p/17522766.html