openstack核心组件——glance— 镜像服务(6)
云计算openstack核心组件——glance— 镜像服务(6)

- 如果要安装的系统多了效率就很低
- 时间长,工作量大
- 安装完还要进行手工配置,比如安装其他的软件,设置 IP 等
- 备份和恢复系统不灵活
- 先手工安装好这么一个虚机
- 然后对虚机执行 snapshot,这样就得到了一个 image
- 当有新员工入职需要办公环境时,立马启动一个或多个该 image 的 instance(虚机)就可以了
- 提供 REST API 让用户能够查询和获取 image 的元数据和 image 本身
- 支持多种方式存储 image,包括普通的文件系统、Swift、Amazon S3 等
- 对 Instance 执行 Snapshot 创建新的 image

glance-api

glance-registry


Database

Store backend
- A directory on a local file system(这是默认配置)
- GridFS
- Ceph RBD
- Amazon S3
- Sheepdog
- OpenStack Block Storage (Cinder)
- OpenStack Object Storage (Swift)
- VMware ESX






[DEFAULT] [cors]
[cors.subdomain] [database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance [glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/ [image_format] [keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance [matchmaker_redis] [oslo_concurrency] [oslo_messaging_amqp] [oslo_messaging_kafka] [oslo_messaging_notifications] [oslo_messaging_rabbit] [oslo_messaging_zmq] [oslo_middleware] [oslo_policy] [paste_deploy]
flavor = keystone [profiler] [store_type_location_strategy] [task] [taskflow_executor]
vim /etc/glance/glance-registry.conf
[DEFAULT] [database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@controller/glance [keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance [matchmaker_redis] [oslo_messaging_amqp] [oslo_messaging_kafka] [oslo_messaging_notifications] [oslo_messaging_rabbit] [oslo_messaging_zmq] [oslo_policy] [paste_deploy]
flavor = keystone [profiler]
布建openstack的glance
1. mysql -u root -p
2. CREATE DATABASE glance;
3.
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \ IDENTIFIED BY '123';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \ IDENTIFIED BY '123';
3.source openrc
创建用户 设置角色 设置服务 创建三种服务端点
(internal内部 admin管理 public公共)
4. 退出数据库 创建 glance用户 domain项目
openstack user create --domain default --password=glance glance
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | bcaefe90e2ce41879fde9c81332a2229 |
| name | glance |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
5把glance的用户 设置在service的项目中 设置admin的权限管理员
openstack role add --project service --user glance admin
6.创建服务
openstack service create --name glance \ --description "OpenStack Image" image
问题解决
[root@node1 ~]# openstack endpoint create --region RegionOne \
> image internal http://node1:9292
Missing value auth-url required for auth plugin password
[root@node1 ~]# source openrc
7创建服务端点
openstack endpoint create --region RegionOne \
image public http://node1:9292
服务端点列表 显示两种方式
1 openstack endpoint list
2 openstack catalog list
删除不要的服务端点
openstack endpoint delete 加上ID 号
8 创建内部服务端点
openstack endpoint create --region RegionOne \ image internal http://node1:9292
9 创建管理端点
openstack endpoint create --region RegionOne \ image admin http://node1:9292
openstack endpoint list 有3个glance
10 yum install openstack-glance -y
11 cd /etc/glance/
ls
LL
修改这两个配置文件 注意属主 属组
cp glance-api.conf glance-api.conf.beifen 备份一根文件进行修改
cp glance-rgistry.conf glance-registry.conf.beifen
12 之前的全部删除掉
vim glance-api.conf glance—store 进行后台存储
[DEFAULT]
[cors]
[cors.subdomain]
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@node1/glance
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
[image_format]
[keystone_authtoken]
auth_uri = http://node1:5000
auth_url = http://node1:35357
memcached_servers = node1:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_concurrency]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_middleware]
[oslo_policy]
[paste_deploy] 认证模板
flavor = keystone
[profiler]
[store_type_location_strategy]
[task]
[taskflow_executor]
13 之前的全部删除掉
vim glance-rgistry.conf 元数据有关的工作交给rgistry
[DEFAULT]
[database]
connection = mysql+pymysql://glance:GLANCE_DBPASS@node1/glance
[keystone_authtoken]
auth_uri = http://node1:5000
auth_url = http://node1:35357
memcached_servers = node1:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[matchmaker_redis]
[oslo_messaging_amqp]
[oslo_messaging_kafka]
[oslo_messaging_notifications]
[oslo_messaging_rabbit]
[oslo_messaging_zmq]
[oslo_policy]
[paste_deploy]
flavor = keystone
[profiler]
14 导入表内容同步数据库
su -s /bin/sh -c "glance-manage db_sync" glance
15 glance-api glance-registry 开机自启
# systemctl enable openstack-glance-api.service \ openstack-glance-registry.service # systemctl start openstack-glance-api.service \ openstack-glance-registry.service
查看状态
# systemctl status openstack-glance-api.service \ openstack-glance-registry.service # systemctl status openstack-glance-api.service \ openstack-glance-registry.service
创建镜像
16 wget http://download2.yunwei.edu/shell/openstack_app.tar.gz
17 ls
[root@node1 ~]# ls
1234.txt 2 3 5 7 9 apache-tomcat-9.0.20.zip openstack_app.tar.gz pjh.txt
1.txt 2.txt 4 6 8 anaconda-ks.cfg openrc openstack-ocata yum-repo.sh
18 tar zxf openstack_app.tar.gz
19 ls
[root@node1 openstack-ocata]# ls
cirros-0.3.3-x86_64-disk.img openstack-compute-yilai
20 openstack image create "cirros" \ --file cirros-0.3.3-x86_64-disk.img \ --disk-format qcow2 --container-format bare \ --public
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | 133eae9fb1c98f45894a4e60d8736619 |
| container_format | bare |
| created_at | 2019-08-03T01:22:51Z |
| disk_format | qcow2 |
| file | /v2/images/6a99c72d-e083-471d-a6f7-787cd05f8e56/file |
| id | 6a99c72d-e083-471d-a6f7-787cd05f8e56 |
| min_disk | 0 |
| min_ram | 0 |
| name | cirros |
| owner | 77539b5d86c6419d88e99140ed0f84a1 |
| protected | False |
| schema | /v2/schemas/image |
| size | 13200896 |
| status | active |
| tags | |
| updated_at | 2019-08-03T01:22:52Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+
21 openstack image list
glance image-list
openstack核心组件——glance— 镜像服务(6)的更多相关文章
- OpenStack核心组件-glance镜像服务
1. glance介绍 Glance是Openstack项目中负责镜像管理的模块,其功能包括虚拟机镜像的查找.注册和检索等. Glance提供Restful API可以查询虚拟机镜像的metadata ...
- 云计算OpenStack核心组件---glance镜像服务(6)
一.glance介绍: Glance是Openstack项目中负责镜像管理的模块,其功能包括虚拟机镜像的查找.注册和检索等. Glance提供Restful API可以查询虚拟机镜像的metadata ...
- 云计算openstack核心组件——glance— 镜像服务(6)
一.glance介绍: Glance是Openstack项目中负责镜像管理的模块,其功能包括虚拟机镜像的查找.注册和检索等. Glance提供Restful API可以查询虚 ...
- OpenStack组件——Glance镜像服务
1.glance介绍 Glance是Openstack项目中负责镜像管理的模块,其功能包括虚拟机镜像的查找.注册和检索等. Glance提供Restful API可以查询虚拟机镜像的metadata及 ...
- OpenStack (glance 镜像服务)
glance介绍 glance 提供云虚拟机上的服务镜像(Image)功能,该模块可看成车间里的模具生产部门,其功能包括虚拟机镜像的查找.注册和检索等.该模具最基本的使用方式就是在为云虚拟机实例提供安 ...
- openstack核心组件--glance镜像(2)
一.glance介绍: Glance是Openstack项目中负责镜像管理的模块,其功能包括虚拟机镜像的查找.注册和检索等. Glance提供Restful API可以查询虚 ...
- ##4.Glance 镜像服务-- openstack pike
##4.Glance 镜像服务 openstack pike 安装 目录汇总 http://www.cnblogs.com/elvi/p/7613861.html ##.Glance 镜像服务.txt ...
- OpenStack实践系列③镜像服务Glance
OpenStack实践系列③镜像服务Glance 3.5 Glance部署 修改glance-api和glance-registry的配置文件,同步数据库 [root@node1 ~]# vim /e ...
- CentOS7安装OpenStack(Rocky版)-03.安装Glance镜像服务组件(控制节点)
上篇文章分享了keystone的安装配置,本文接着分享openstack的镜像服务glance. --------------- 完美的分割线 ---------------- 3.0.glance概 ...
随机推荐
- 41.4 Method Security方法安全性
41.4.1 <global-method-security> 这个元素是为Spring Security beans上的安全方法添加支持的主要手段.可以通过使用注释(在接口或类级别定义) ...
- Lambda表达式的几种实现过程
1.无参数+语句(代码块):适用于匿名内部类中方法无参数的情况 private void threadTest(){ //普通写法 new Thread(new Runnable(){ @Overri ...
- JAVA使用urlrewrite实现伪静态化
什么是伪静态? 伪静态字面理解就是假的静态,说的官方点就是“地址重写,用户得到的全部地址都是经过处理后的URL地址”. 为什么要伪静态呢? 提高安全性,可以有效的避免一些参数名.ID等完全暴露在用户面 ...
- Ubuntu下载连接(阿里云镜像)
ubuntu 14.04: http://mirrors.aliyun.com/ubuntu-releases/14.04/ ubuntu 16.04: http://mirrors.aliyun.c ...
- aarch64 packages 地址链接收集
1.http://dl.fedoraproject.org/pub/epel/7/aarch64 2.https://rpmfind.net/linux/epel/7/aarch64/ 3.http: ...
- Mybatis分页插件: pageHelper的使用及其原理解析
在实际工作中,很进行列表查询的场景,我们往往都需要做两个步骤:1. 查询所需页数对应数据:2. 统计符合条件的数据总数:而这,又会导致我们必然至少要写2个sql进行操作.这无形中增加了我们的工作量,另 ...
- Better Key Sizes (and Attacks) for LWE-Based Encryption
郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! 以下是对本文关键部分的摘抄翻译,详情请参见原文 Abstract 基于“learning with errors”(LWE)问题,分析了理 ...
- 【干货!!】三句话搞懂 Redis 缓存穿透、击穿、雪崩
前言 如何有效的理解并且区分 Reids 穿透.击穿和雪崩之间的区别,一直以来都挺困扰我的.特别是穿透和击穿,过一段时间就稀里糊涂的分不清了. 为了有效的帮助笔者自己,以及拥有同样烦恼的朋友们区分这三 ...
- Vue 开发技巧总结
博客地址:https://ainyi.com/95 本人玩了 Vue 两年多,在此总结一下开发时的一些技巧和方法 自定义组件 v-model v-model 是 Vue 提供的一个语法糖,它本质上是 ...
- 码云git clone报错Incorrect username or password ( access token )
使用码云将仓库clone到本地,报错信息如下: D:\>git clone https://gitee.com/ycyzharry/helloworld.git Cloning into 'he ...