1.Use the database access client to connect to the database server as the root user:
$ mysql -u root -p

2.Create the glance database:
CREATE DATABASE glance;

3.Grant proper access to the glance database:
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '123456';

4.Exit the database access client.

5.切换到管理员身份
source admin-openrc.sh 我保存的位置:/etc/keystone

6.创建glance用户
$ keystone user-create --name glance --pass 123456


7.为glance用户添加admin角色:
$ keystone user-role-add --user glance --tenant service --role admin


8.创建 glance 服务实体:
keystone service-create --name glance --type image --description "OpenStack Image Service"


9.创建Image Service API 端点:
keystone endpoint-create --service-id $(keystone service-list | awk '/ image / {print $2}') --publicurl http://controller:9292 --internalurl http://controller:9292 --adminurl http://controller:9292 --region regionOne


10. 安装包
# apt-get install glance python-glanceclient

11.编辑/etc/glance/glance-api.conf 加入下面的内容
[database]#connection = mysql://glance:GLANCE_DBPASS@controller/glance(不行)
connection = mysql://glance:GLANCE_DBPASS@10.0.0.11/glance...[keystone_authtoken]#Note:Comment out any auth_host, auth_port, and auth_protocol options because the identity_uri
option replaces them.auth_uri = http://controller:5000/v2.0identity_uri = http://controller:35357admin_tenant_name = serviceadmin_user = glanceadmin_password = GLANCE_PASS...[paste_deploy]flavor = keystone...[glance_store]...default_store = filefilesystem_store_datadir
= /var/lib/glance/images/[DEFAULT]...notification_driver = noop[DEFAULT]...verbose = True
在本文中GLANCEDBPASS和GLANCEPASS都为123456

12.编辑 /etc/glance/glance-registry.conf 加入下面的内容:
[database]...#connection = mysql://glance:GLANCE_DBPASS@controller/glance(不行)
connection = mysql://glance:GLANCE_DBPASS@10.0.0.11/glance[keystone_authtoken]...auth_uri = http://controller:5000/v2.0identity_uri = http://controller:35357admin_tenant_name
= serviceadmin_user = glanceadmin_password = GLANCE_PASS[paste_deploy]...flavor = keystone[DEFAULT]...notification_driver = noopverbose = True

13.Restart the Image Service services:
# service glance-registry restart
# service glance-api restart

14.Create and change into a temporary local directory:
$ mkdir /tmp/images

15.Download the image to the temporary local directory:(注:手册上的镜像地址有变化)
wget -p /tmp/images http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img

16.Source the admin credentials to gain access to admin-only CLI commands:
$ source admin-openrc.sh

17.Upload the image to the Image Service:
glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress
注:
(如果在安装镜像服务(Image Service)时,在Verify the Image Service installation这一步,上传镜像到镜像服务时(Upload the image to the Image Service)提示如标题所示的错误:Request returned
failure status. HTTPInternalServerError (HTTP 500).

解决方法:(参见16.Source the admin credentials to gain access to admin-only CLI commands:
$ source admin-openrc.sh)后重启glance-registry和glance-api两个服务,即在命令行输入 service
glance-registry restart和service glance-api restart  运行,问题迎刃而解!原因是重启Linux(ubuntu),导致以上两个服务被关闭。其实这只是一个低级错误,有很多人也遇到过这个错误。)

18.查询映像以确认数据是否正确
$ glance image-list

19.删除临时目录
$ rm -r /tmp/images

查找文件位置:locate 文件名
例:locate cirros-0.3.3-x86_64-disk.img

openstack镜像服务(glance)的更多相关文章

  1. 云计算管理平台之OpenStack镜像服务glance

    一.glance简介 openstack中的glance服务是用来存储在openstack上启动虚拟机所需镜像:它主要用于发现.注册及检索虚拟机镜像:它通过提供RESTful风格的api对外提供服务: ...

  2. OpenStack 镜像服务 Glance部署(六)

    Glance介绍 创建虚拟机我们需要有glance的支持,因为glance是提供镜像的服务. Glance有两个比较重要的服务: Glance-api:接受云系统镜像的构建.删除.读取请求 Glanc ...

  3. OpenStack 镜像服务 Glance部署(七)

    创建虚拟机我们需要有glance的支持,因为glance是提供镜像的服务. Glance有两个比较重要的服务: Glance-api:接受云系统镜像的构建.删除.读取请求 Glance-Registr ...

  4. 【openstack N版】——镜像服务glance

    一.openstack镜像服务glance 1.1 glance介绍 glance主要是由三部分组成 glance-api:接收云系统镜像的创建,删除,读取请求,类似nova-api,通过其他模块(g ...

  5. Centos7 install Openstack - (第三节)添加镜像服务(Glance)

    Centos7 install Openstack - (第三节)添加镜像服务(Glance) 我的blog地址:http://www.cnblogs.com/caoguo 该文根据openstack ...

  6. OpenStack实践系列③镜像服务Glance

    OpenStack实践系列③镜像服务Glance 3.5 Glance部署 修改glance-api和glance-registry的配置文件,同步数据库 [root@node1 ~]# vim /e ...

  7. Openstack(八)部署镜像服务glance

    8.1glance镜像服务介绍 Glance是OpenStack镜像服务组件,glance服务默认监听在9292端口,其接收REST API请求,然后通过其他模块(glance-registry及im ...

  8. [ Openstack ] OpenStack-Mitaka 高可用之 镜像服务(glance)

    目录 Openstack-Mitaka 高可用之 概述    Openstack-Mitaka 高可用之 环境初始化    Openstack-Mitaka 高可用之 Mariadb-Galera集群 ...

  9. 探索 OpenStack 之(10):深入镜像服务Glance

    本篇博文来探讨下镜像服务Glance. 0.  基本概念 0.1 基本功能 Glance提供REST API来支持以下镜像操作: 查询 注册 上传 获取 删除 访问权限管理 0.2 Glance RE ...

  10. OpenStack入门篇(八)之镜像服务Glance

    一.Glance的概述 Glance是为虚拟机的创建提供镜像的服务,我们基于Openstack是构建基本的IaaS平台对外提供虚拟机,而虚拟机在创建时必须为选择需要安装的操作系统,Glance服务就是 ...

随机推荐

  1. Excel筛选操作

    Excel的筛选操作如下: 选中指定列: 点击"开始"中的"排序和筛选" 点击如下小三角即可按条件进行筛选

  2. spark性能调优点(逐步完善)

    1.使用高性能序列化类库2.优化数据结构3.对多次使用的RDD进行持久化/CheckPoint4.使用序列化的持久化级别5.Java虚拟机垃圾回收调优 降低RDD缓存占用空间的比例:new Spark ...

  3. Github添加密钥

    打开git bash添加上自己的git用户名和git邮箱: 添加上远程仓库:git remote add [shortname] [url] 输入命令:ssh-keygen -t rsa -C &qu ...

  4. ps -aux显示信息COMMAND不全

    ps -aux结果: ps -auxwww结果:

  5. PHP基础教程 php 网络上关于设计模式一些总结

    1.单例模式 单例模式顾名思义,就是只有一个实例.作为对象的创建模式,单例模式确保某一个类只有一个实例,而且自行实例化并向整个系统提供这个实例. 单例模式的要点有三个: 一是某个类只能有一个实例; 二 ...

  6. npm 安装与卸载模块

    1. 只卸载模块 由于之前安装过,在 package.json 中的记录仍然存在 npm uninstall lodash 2. --save 参数使用 卸载模块的同时删除在 package.json ...

  7. 洛谷 P1505 BZOJ 2157 [国家集训队]旅游

    bzoj题面 Time limit 10000 ms Memory limit 265216 kB OS Linux 吐槽 又浪费一个下午--区间乘-1之后,最大值和最小值更新有坑.新的最大值是原来最 ...

  8. 【Leetcode】最长回文子串

    启发 1)做题前一定要读懂题目 在本题中,首先要清楚地定义回文子串的概念,然后才能设计算法查找它. 如中心扩散法,其主要思想在于找到一个回文子串的定义——两侧互为镜像.进一步分为奇数长度和偶数长度进行 ...

  9. VMware NAT 静态IP模式下上网

    自从开始学Linux之后,对使用NAT模式上网,很是困惑.具体原理,还待求证. 使用方法(VMware): 简介: wmware在NAT使用方面很是轻松 打开本地的网络适配器. 修改虚拟网卡VMnet ...

  10. Oracle 字符串拼接会出现0自动忽略,解决方案

    解决方案 ,),'||num,num) from table_name 参考:https://blog.csdn.net/menghuannvxia/article/details/73089903