立即注册 登录
About云-梭伦科技 返回首页

pig2的个人空间 https://www.aboutyun.com/?61 [收藏] [复制] [分享] [RSS]

日志

openstack【juno】入门 【glance 篇】十二:glance安装配置验证及相关操作

已有 992 次阅读2015-2-26 17:50 | glance




问题导读:
1.如何上传镜像
2.如何判断环境变量是否生效?




接上一篇:
openstack【juno】入门 【glance 篇】十:glance安装配置

这一篇,主要使用 CirrOS验证glance是否安装成功。CirrOS是一个小的Linux镜像,帮助测试openstack部署
这一篇不是很顺利,遇到了一个openstack ubuntu的一个bug


1.创建一个临时本地目录

  1. mkdir /tmp/images
复制代码
  1. cd /tmp/images



2.下载镜像到本地目录

  1. wget http://cdn.download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img


3.环境变量生效


  1. source admin-openrc.sh
复制代码
(需要找到admin-openrc.sh)

4.上传镜像

  1. glance image-create --name "cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img \
  2.   --disk-format qcow2 --container-format bare --is-public True --progress



5.确认上传成功,并且可用
  1. glance image-list



6.移除本地临时目录(选操作,当然自己可以保留着)


  1. rm -r /tmp/images




遇到问题:

  1. glance image-create --name "cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img \
  2.   --disk-format qcow2 --container-format bare --is-public True --progress

global name '_' is not defined glance
原来环境变量的问题。source 已经source了,但是却没有起作用。最后使用绝招
  1. export OS_TENANT_NAME=admin
  2. export OS_USERNAME=admin
  3. export OS_PASSWORD=ADMIN_PASS
  4. export OS_AUTH_URL=http://controller:35357/v2.0


在shell中直接执行shell。然后
通过
  1. echo $OS_TENANT_NAME

检验能否安装成功。

路过

雷人

握手

鲜花

鸡蛋

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 立即注册

关闭

推荐上一条 /2 下一条