glance CLI 手册页¶
概要¶
glance [选项] <命令> [命令选项]
glance help
glance help <命令>
描述¶
glance 命令行工具与 OpenStack 镜像服务 (Glance) 交互。
为了使用 CLI,您必须提供您的 OpenStack 用户名、密码、项目 (历史上称为租户) 和认证端点。您可以使用配置选项 --os-username, --os-password, --os-project-id 和 --os-auth-url,或者设置相应的环境变量
export OS_USERNAME=user
export OS_PASSWORD=pass
export OS_PROJECT_ID=b363706f891f48019483f8bd6503c54b
export OS_AUTH_URL=http://auth.example.com:5000/v2.0
命令行工具将尝试为每个请求使用提供的凭据重新认证。您可以通过手动使用 --os-image-url 和 --os-auth-token 或设置相应的环境变量来覆盖此行为
export OS_IMAGE_URL=http://glance.example.org:9292/
export OS_AUTH_TOKEN=3bcc3d3a03f44e3d8377f9247b0ad155
您可以通过 --os-image-api-version 选项或设置相应的环境变量来选择要使用的 API 版本
export OS_IMAGE_API_VERSION=1
默认使用的镜像 API 是 v2。
选项¶
要获取可用命令和选项的列表,请运行
glance help
获取命令的使用方法和选项
glance help <command>
示例¶
获取关于 image-create 命令的信息
glance help image-create
查看可用镜像
glance image-list
获取详细输出,包括镜像列表响应中的更多字段
glance --verbose image-list
创建新镜像
glance image-create --name foo --disk-format=qcow2 \
--container-format=bare --visibility=public \
--file /tmp/foo.img
描述特定镜像
glance image-show <Image-ID>
错误¶
Glance 客户端托管在 Launchpad 上,您可以在 https://bugs.launchpad.net/python-glanceclient/ 上查看当前错误。