Centos7 install Openstack - (第三节)添加镜像服务(Glance)
Centos7 install Openstack - (第三节)添加镜像服务(Glance)
我的blog地址:http://www.cnblogs.com/caoguo
该文根据openstack官方文档配置
官方文档地址: http://docs.openstack.org/juno/install-guide/install/yum/content/#
0x01. 基本安装配置(控制节点)
一) To configure prerequisites
1. To create the database, complete these steps:(在数据创建该服务需要使用的数据库帐户)
[root@controller ~]# mysql -uroot -p MariaDB [(none)]> CREATE DATABASE glance; MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \ -> IDENTIFIED BY 'GLANCE_DBPASS'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \ -> IDENTIFIED BY 'GLANCE_DBPASS';
2. 加载admin环境变量
[root@controller ~]# source admin-openrc.sh
3. To create the service credentials, complete these steps:
a. Create the glance user: #在认证服务中创建一个glance的帐户
[root@controller ~]# keystone user-create --name glance --pass GLANCE_PASS +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | b5eb644a0049459c9f1b1bb87eaa2f35 | | name | glance | | username | glance | +----------+----------------------------------+
b. Add the admin role to the glance user: #将用户添加至admin用户组 service租户中
[root@controller ~]# keystone user-role-add --user glance --tenant service --role admin
c. Create the glance service entiry:
[root@controller ~]# keystone service-create --name glance --type image \ --description "OpenStack Image Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | OpenStack Image Service | | enabled | True | | id | 95b4d1e8cee046ada8e131cdef6d01da | | name | glance | | type | image | +-------------+----------------------------------+
4. Create the Image Service API endpoints: #创建镜像服务api
[root@controller ~]# 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
二) To install and configure the Image Service components
1. Install the packages: # 安装镜像服务软件包
[root@controller ~]# yum install -y openstack-glance python-glanceclient
2. Edit the /etc/glance/glance-api.conf file
[root@controller ~]# cp /etc/glance/glance-api.conf /etc/glance/glance-api.conf.old [root@controller ~]# vi /etc/glance/glance-api.conf # 在配置文件节点下新增配置 [database] connection = mysql://glance:GLANCE_DBPASS@controller/glance [keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = glance admin_password = GLANCE_PASS[paste_deploy] flavor = keystone[glance_store] default_store = file filesystem_store_datadir = /var/lib/glance/images/[DEFAULT] notification_driver = noop
3. Edit the /etc/glance/glance-registry.conf file
[root@controller ~]# cp /etc/glance/glance-registry.conf /etc/glance/glance-registry.conf.old [root@controller ~]# vi /etc/glance/glance-registry.conf [database] connection = mysql://glance:GLANCE_DBPASS@controller/glance [keystone_authtoken] auth_uri = http://controller:5000/v2.0 identity_uri = http://controller:35357 admin_tenant_name = service admin_user = glance admin_password = GLANCE_PASS[paste_deploy] flavor = keystone[DEFAULT] notification_driver = noop verbose = True
4. Populate the Image Service database: # 镜像服务数据同步
[root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance
三)To finalize installation(收尾工作)
[root@controller ~]# systemctl enable openstack-glance-api.service openstack-glance-registry.service [root@controller ~]# systemctl start openstack-glance-api.service openstack-glance-registry.service
0x02. 确认以上操作
1. Create and change into a temporary local directory: # 创建一个临时目录
[root@controller ~]# mkdir /tmp/images
2. Download the image to the temporary local directory: # 下载一个测试镜像
[root@controller ~]# yum install -y wget [root@controller ~]# wget -P /tmp/images http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
3. Source the admin credentials to gain access to admin-only CLI commands: # 导入admin环境变量
[root@controller ~]# source admin-openrc.sh
4. Upload the image to the Image Service: # 上传镜像文件
[root@controller ~]# 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 [=============================>] 100% +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ | checksum | 133eae9fb1c98f45894a4e60d8736619 | | container_format | bare | | created_at | 2015-11-01T10:16:39 | | deleted | False | | deleted_at | None | | disk_format | qcow2 | | id | 833b50a1-167e-4968-8d8e-27799ad4c52a | | is_public | True | | min_disk | 0 | | min_ram | 0 | | name | cirros-0.3.3-x86_64 | | owner | f42937a2fd484d638ce58e67fef59b67 | | protected | False | | size | 13200896 | | status | active | | updated_at | 2015-11-01T10:16:40 | | virtual_size | None | +------------------+--------------------------------------+
5. Confirm upload for image and validate attributes: # 查看当前已经上传成功的镜像
[root@controller ~]# glance image-list +--------------------------------------+---------------------+-------------+------------------+----------+--------+ | ID | Name | Disk Format | Container Format | Size | Status | +--------------------------------------+---------------------+-------------+------------------+----------+--------+ | 74da30a6-8e15-4b11-807c-2eba444e6a54 | cirros-0.3.3-x86_64 | qcow2 | bare | 13200896 | active | +--------------------------------------+---------------------+-------------+------------------+----------+--------+
6. Remove the temporary local directory:
[root@controller ~]# rm -r /tmp/images rm: descend into directory ‘/tmp/images’? y rm: remove regular file ‘/tmp/images/cirros-0.3.3-x86_64-disk.img’? y rm: remove directory ‘/tmp/images’? y
结束!!!
更多精彩请访问:http://www.cnblogs.com/caoguo
转载于:https://www.cnblogs.com/caoguo/p/4937323.html
Centos7 install Openstack - (第三节)添加镜像服务(Glance)相关推荐
- OpenStack 镜像服务Glance [三]
OpenStack 镜像服务Glance [三] 标签(空格分隔): openstack 时间:2016年11月28日 博客地址:www.abcdocker.com 公众号:abcdocker Ope ...
- 探索 OpenStack 之(10):深入镜像服务Glance
本篇博文来探讨下镜像服务Glance. 0. 基本概念 0.1 基本功能 Glance提供REST API来支持以下镜像操作: 查询 注册 上传 获取 删除 访问权限管理 0.2 Glance RE ...
- OpenStack安装流程(juno版)- 添加镜像服务(glance)
OpenStack镜像服务(glance)可以让用户查询,存取虚拟机. 安装和配置 glance安装在controller节点上. 创建配置glance所需的数据库,服务证书和API端点 创建glan ...
- OpenStack(Kilo版本)镜像服务glance的安装部署
OpenStack镜像服务(glance)允许用户发现.注册和恢复虚拟机镜像.Glance提供Rest API可以查询虚拟机镜像的metadata并且可以获取镜像.通过Glance,虚拟机镜像可以被存 ...
- OpenStack(四)—镜像服务
前言:在OpenStack中的项目名称为Glance. 在早期的OpenStack版本中,Glance只有管理镜像的功能,并不具备镜像存储功能.现在,Glance已发展成为集镜像上传.检索.管理和存储 ...
- OpenStack入门篇(八)之镜像服务Glance
一.Glance的概述 Glance是为虚拟机的创建提供镜像的服务,我们基于Openstack是构建基本的IaaS平台对外提供虚拟机,而虚拟机在创建时必须为选择需要安装的操作系统,Glance服务就是 ...
- 《3》CentOS7.0+OpenStack+kvm云平台部署—配置Glance
感谢朋友支持本博客,欢迎共同探讨交流.因为能力和时间有限,错误之处在所难免,欢迎指正. 假设转载.请保留作者信息. 博客地址:http://blog.csdn.net/qq_21398167 原博文地 ...
- Glance 镜像服务
项目介绍OpenStack镜像服务(glance)允许用户发现.注册和恢复虚拟机镜像.Glance提供Rest API可以查询虚拟机镜像的metadata并且可以获取镜像.通过Glance,虚拟机镜 ...
- OpenStack核心组件原理与应用之Glance
概览 OpenStack 镜像服务 Glance 是 IaaS(Infrastructure as a Service,基础设施即服务)的核心服务.允许用户发现.注册和获取虚拟机镜像.它提供了一个 R ...
最新文章
- window10 系统查看控制面板的方法
- python curses_用 Python 进行 Curses 编程
- 基于Javaweb实现企业财务管理系统
- 用window.open在同一个新窗口中访问指定url【IE页面缓存问题】
- 计算机视觉库OpenCV中shape和resize函数的区别
- 华为云部署html网页,手把手教你如何在华为云服务器上部署一个自己的弹幕网站!...
- 常用的几款工具让 Kubernetes 集群上的工作更容易
- oracle 11g 备份导入12c,关于12C版本导出导入11G版本的这点事
- 《SQL必知必会》附录
- 设计模式(博客园精华集)
- 完美世界手游服务器维护,完美世界手游更新失败_完美世界手游更新失败解决办法_玩游戏网...
- 腾讯云轻量应用服务器器使用技巧-腾讯云OrcaTerm的上传下载
- 魔方(9)四轴枫叶魔方、四轴斜转魔方
- matlab bsxfun
- DZ 系统维护工具箱Tools
- 中国土地市场网landchina.com数据采集心得
- 耳机四根线的图解_耳机线材编法汇总
- 【bzoj3698】【XWW的难题】【有上下界的网络流】
- 微信开发 事件 trim subscribe
- 河南理工大学计算机学院保研,#研历言谈#优秀保研生介绍之测绘篇
热门文章
- x79主板bios设置中文_bios菜单
- 替换某个字符串_Schema技术(四)-字符串数据类型
- mr利用mapjoin计算出每个部门的总工资以及部门名称
- C语言写300k文件大概多少行,为什么 DELPHI 编译出的程序一般的来说至少都有300k呢?...
- Xilinx IOdelay--Virtex-5介绍
- linux搜索指定文件夹里文件是否存在,Linux文件操作之文件查询与搜索命令详解...
- php正则表达式程序,php正则表达式 Web程序 - 贪吃蛇学院-专业IT技术平台
- nodejs连接池 连接关闭_「转」连接池居然这么简单?
- mysql的root用户密码_MySQL的root用户密码忘了 , 该怎么办?
- arouter跨module传递消息_利用ARouter实现组件间通信,解决子模块调用主模块问题...