Glance项目提供虚拟机镜像的发现,注册,取得服务。

Glance提供restful API可以查询虚拟机镜像的metadata,并且可以获得镜像。

通过Glance,虚拟机镜像可以被存储到多种存储上,比如简单的文件存储或者对象存储(比如OpenStack中swiftx项目)。

Glance,像所有的OpenStack项目一样,遵循以下思想:

1.基于组件的架构      便于快速增加新特性

2.高可用性                  支持大负荷

3.容错性                      独立的进程避免串行错误

4.开放标准                  对社区驱动的API提供参考实现

Glance的几个重要概念:

1.Image identifiers                         Image使用URI作为唯一标识,URL符合以下格式:

<Glance Server Location>/images/<ID>

Glance Server Location是镜像的所在位置, ID是镜像在Glance的唯一标识。

2.Image Statuses                         共四种状态。

queued                                标识该镜像ID已经被保留,但是镜像还未上传。

saving                                  标识镜像正在被上传。

active                                    标识镜像在Glance中完全可用。

killed                                     标识镜像上传过程中出错,镜像完全不可用。

3.Disk and Container format

Disk  Format:raw vhd vmdk vdi iso qcow2 aki ari ami

Container Format: ovf bare aki ari ami

当disk format为aki ari ami时,disk format 和container format一致。

4.Image Registries

使用Glance,镜像metadata可以注册至image registries。

只要为image metadata提供了rest like API,任何web程序可以作为image registries与Glance对接。

当然,Glance也提供了参考实现。

更多信息可以参考on
Controlling Servers
,来自于Glance提供的Glance registry server。

Glance提供了如下Rest-like API:

GET     /images         Return brief information about public images
GET /images/detail Return detailed information about public images
GET /images/<ID> Return metadata about an image in HTTP headers
POST /images Register metadata about a new image
PUT /images/<ID> Update metadata about an existing image
DELETE /images/<ID> Remove an image's metadata from the registry

通过 GET /images and GET /images/detail对镜像过滤查询

 
支持以下参数:

  • name=NAME

    Filters images having a name attribute
    matching NAME.

  • container_format=FORMAT

    Filters images having a container_format attribute
    matching FORMAT

    For more information, see About Disk and Container Formats

  • disk_format=FORMAT

    Filters images having a disk_format attribute
    matching FORMAT

    For more information, see About Disk and Container Formats

  • status=STATUS

    Filters images having a status attribute
    matching STATUS

    For more information, see About Image Statuses

  • size_min=BYTES

    Filters images having a size attribute
    greater than or equal to BYTES

  • size_max=BYTES

    Filters images having a size attribute
    less than or equal to BYTES

These two resources also accept sort parameters:

  • sort_key=KEY

    Results will be ordered by the specified image attribute KEY.
    Accepted values include idnamestatusdisk_format,container_formatsizecreated_at (default)
    and updated_at.

  • sort_dir=DIR

    Results will be sorted in the direction DIR.
    Accepted values are asc for
    ascending or desc (default)
    for descending.

     
 

POST /images

request的body部分使用json编码,比如以下格式:

{'image':
{'id': <ID>|None,
'name': <NAME>,
'status': <STATUS>,
'disk_format': <DISK_FORMAT>,
'container_format': <CONTAINER_FORMAT>,
'properties': [ ... ]
}
}

如果输入不满足以下条件,将返回400错误:

  • status must
    be non-empty, and must be one of activesavingqueued, or killed
  • disk_format must
    be non-empty, and must be one of ariakiamirawisovhdvdiqcow2, or vmdk
  • container_format must
    be non-empty, and must be on of ariakiamibare, or ovf
  • If disk_format or container_format is ariakiami,
    then both disk_format and container_format must
    be the same.

Glance的架构:

Glance被设计为可以使用多种后端存储。

前端通过API Server向多个Client提供服务。

Glance目前提供的参考实现中Registry Server仅是使用Sql数据库存储metadata

Glance目前支持S3,Swift,简单的文件存储及只读的HTTPS存储。

后续也可能支持其他后端,如分布式存储系统(SheepDog或Ceph)。

OpenStack组件系列☞glance简介的更多相关文章

  1. OpenStack组件系列☞glance搭建

    第一步:glance关于数据库的操作 mysql -u root -p #登入数据库 CREATE DATABASE glance; #新建库keystone GRANT ALL PRIVILEGES ...

  2. OpenStack组件系列☞Keystone搭建

    一:版本信息 官网:http://docs.openstack.org/newton/install-guide-rdo/keystone.html 二:部署keystone 官网文档:http:// ...

  3. OpenStack组件系列☞Keystone

    Keystone(OpenStack Identity Service)是 OpenStack 框架中负责管理身份验证.服务规则和服务令牌功能的模块.用户访问资源需要验证用户的身份与权限,服务执行操作 ...

  4. OpenStack组件系列☞horizon搭建

    第一步:部署horizon环境: 安装部署memcache 安装软件包 yum install memcached python-memcached 启动memcache并且设置开机自启动 syste ...

  5. OpenStack实践系列①openstack简介及基础环境部署

    OpenStack实践系列①openstack简介及基础环境部署 一.OpenStack初探1.1 OpenStack简介 OpenStack是一整套开源软件项目的综合,它允许企业或服务提供者建立.运 ...

  6. Openstack Sahara组件和架构简介

    1.简介 Apache Hadoop是目前被广泛使用的主流大数据处理计算框架,Sahara项目旨在使用用户能够在Openstack平台上便于创建和管理Hadoop以及其他计算框架集群,实现类似AWS的 ...

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

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

  8. Openstack组件实现原理 — Glance架构(V1/V2)

    目录 目录 Glance 安装列表 Glance Image service Image service 的组件 Glance-Api Glance-Registry Glance-db Image ...

  9. Openstack组件部署 — Overview和前期环境准备

    目录 目录 前言 软件环境 Openstack 简介 Openstack 架构 Openstack Install Overview 创建Node虚拟机 环境准备 基础设置 Install OpenS ...

随机推荐

  1. random模块&hashlib模块

    random模块1.random.randrange(1, 10):返回1-10之间的一个随机数,不包括102.random.randint(1,10):返回1-10之间的一个随机数,包括103.ra ...

  2. oracle function学习1

    oracle function学习基层: 函数就是一个有返回值的过程.  首先 知道oracle 使用限制:      函数调用限制: 1. SQL语句中只能调用存储函数(服务器端),而不能调用客户端 ...

  3. Android中使用ormlite实现持久化--HelloOrmLite

    Android中内置了sqlite,但是常用的开发语言java是面向对象的,而数据库是关系型的,二者之间的转化每次都很麻烦(主要是我对sql语言不熟悉).而Java Web开发中有很多orm框架,但是 ...

  4. 用Python的pandas框架操作Excel文件中的数据教程

    用Python的pandas框架操作Excel文件中的数据教程 本文的目的,是向您展示如何使用pandas 来执行一些常见的Excel任务.有些例子比较琐碎,但我觉得展示这些简单的东西与那些你可以在其 ...

  5. listView中的button控件获取索引

    1.在listitem中初始化button的时候,给该button添加一个setTag方法,将此时的索引值传进去,然后在button的onclick事件中调用view的getTag方法,即可将list ...

  6. [C#] 使用WebSocket进行通讯

    客户端 客户端很简单 string url = "ws://localhost:24900/" + "test.ashx"; try { System.Net. ...

  7. 阿里云发布SaaS加速器,用宜搭,像搭积木一样搭应用

    宜搭让不会编码的人也能快速搭建SaaS应用,大幅提升研发效率. (图:阿里云智能产品管理部总经理马劲在2019阿里云峰会·北京现场进行宜搭应用搭建演示. ) 3月21日,在2019阿里云峰会·北京上, ...

  8. 2019-5-25-win10-uwp-win2d-入门-看这一篇就够了

    title author date CreateTime categories win10 uwp win2d 入门 看这一篇就够了 lindexi 2019-5-25 20:0:52 +0800 2 ...

  9. python 顺序传入

  10. UVA_490:Rotating Sentences

    "R  Ie   n  te  h  iD  ne  kc  ,a   r  tt  he  es  r  eo  fn  oc  re  e   s  Ia   i  ad  m,  .  ...