Glance

Install glance using the following command:

sudo apt-get install glance glance-api glance-client glance-common glance-registry python-glance运行结果:localadmin@OpenStack-1:~$ sudo apt-get install glance glance-api glance-client glance-common glance-registry python-glance[sudo] password for localadmin:Reading package lists... DoneBuilding dependency treeReading state information... DoneThe following extra packages will be installed:  libyaml-0-2 python-amqplib python-anyjson python-dateutil python-kombu python-xattr python-yamlSuggested packages:  python-amqplib-doc python-boto python-couchdb python-kombu-doc python-pymongoThe following NEW packages will be installed:  glance glance-api glance-client glance-common glance-registry libyaml-0-2 python-amqplib python-anyjson python-dateutil python-glance python-kombu python-xattr  python-yaml0 upgraded, 13 newly installed, 0 to remove and 3 not upgraded.Need to get 649 kB of archives.After this operation, 3,709 kB of additional disk space will be used.Do you want to continue [Y/n]? yGet:1 http://mirrors.163.com/ubuntu/ precise/main libyaml-0-2 amd64 0.1.4-2 [56.9 kB]Get:2 http://mirrors.163.com/ubuntu/ precise/main python-amqplib all 1.0.0+ds-1 [34.5 kB]Get:3 http://mirrors.163.com/ubuntu/ precise/main python-anyjson all 0.3.1-1build1 [7,208 B]Get:4 http://mirrors.163.com/ubuntu/ precise/main python-dateutil all 1.5-1 [54.2 kB]Get:5 http://mirrors.163.com/ubuntu/ precise/main python-kombu all 1.4.3-1 [94.1 kB]Get:6 http://mirrors.163.com/ubuntu/ precise/main python-xattr amd64 0.6.2-1ubuntu1 [13.9 kB]Get:7 http://mirrors.163.com/ubuntu/ precise/main python-yaml amd64 3.10-2 [122 kB]Get:8 http://mirrors.163.com/ubuntu/ precise-proposed/main python-glance all 2012.1-0ubuntu2.1 [229 kB]Get:9 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-common all 2012.1-0ubuntu2.1 [6,506 B]Get:10 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-api all 2012.1-0ubuntu2.1 [12.1 kB]Get:11 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-registry all 2012.1-0ubuntu2.1 [4,700 B]Get:12 http://mirrors.163.com/ubuntu/ precise-proposed/main glance all 2012.1-0ubuntu2.1 [1,742 B]Get:13 http://mirrors.163.com/ubuntu/ precise-proposed/main glance-client all 2012.1-0ubuntu2.1 [10.8 kB]Fetched 649 kB in 10s (64.0 kB/s)Selecting previously unselected package libyaml-0-2.(Reading database ... 52116 files and directories currently installed.)Unpacking libyaml-0-2 (from .../libyaml-0-2_0.1.4-2_amd64.deb) ...Selecting previously unselected package python-amqplib.Unpacking python-amqplib (from .../python-amqplib_1.0.0+ds-1_all.deb) ...Selecting previously unselected package python-anyjson.Unpacking python-anyjson (from .../python-anyjson_0.3.1-1build1_all.deb) ...Selecting previously unselected package python-dateutil.Unpacking python-dateutil (from .../python-dateutil_1.5-1_all.deb) ...Selecting previously unselected package python-kombu.Unpacking python-kombu (from .../python-kombu_1.4.3-1_all.deb) ...Selecting previously unselected package python-xattr.Unpacking python-xattr (from .../python-xattr_0.6.2-1ubuntu1_amd64.deb) ...Selecting previously unselected package python-yaml.Unpacking python-yaml (from .../python-yaml_3.10-2_amd64.deb) ...Selecting previously unselected package python-glance.Unpacking python-glance (from .../python-glance_2012.1-0ubuntu2.1_all.deb) ...Selecting previously unselected package glance-common.Unpacking glance-common (from .../glance-common_2012.1-0ubuntu2.1_all.deb) ...Selecting previously unselected package glance-api.Unpacking glance-api (from .../glance-api_2012.1-0ubuntu2.1_all.deb) ...Selecting previously unselected package glance-registry.Unpacking glance-registry (from .../glance-registry_2012.1-0ubuntu2.1_all.deb) ...Selecting previously unselected package glance.Unpacking glance (from .../glance_2012.1-0ubuntu2.1_all.deb) ...Selecting previously unselected package glance-client.Unpacking glance-client (from .../glance-client_2012.1-0ubuntu2.1_all.deb) ...Processing triggers for man-db ...Processing triggers for ureadahead ...ureadahead will be reprofiled on next rebootSetting up libyaml-0-2 (0.1.4-2) ...Setting up python-amqplib (1.0.0+ds-1) ...Setting up python-anyjson (0.3.1-1build1) ...Setting up python-dateutil (1.5-1) ...Setting up python-kombu (1.4.3-1) ...Setting up python-xattr (0.6.2-1ubuntu1) ...Setting up python-yaml (3.10-2) ...Setting up python-glance (2012.1-0ubuntu2.1) ...Setting up glance-common (2012.1-0ubuntu2.1) ...Adding system user `glance' (UID 109) ...Adding new user `glance' (UID 109) with group `glance' ...Not creating home directory `/var/lib/glance'.Setting up glance-api (2012.1-0ubuntu2.1) ...glance-api start/running, process 2001Setting up glance-registry (2012.1-0ubuntu2.1) ...glance-registry start/running, process 2053Setting up glance (2012.1-0ubuntu2.1) ...Setting up glance-client (2012.1-0ubuntu2.1) ...Processing triggers for libc-bin ...ldconfig deferred processing now taking place

Glance Configuration

Glance uses SQLite by default. MySQL and PostgreSQL can also be configured to work with Glance.

Open /etc/glance/glance-api-paste.ini and at the end of the file, edit the following lines:

admin_tenant_name = %SERVICE_TENANT_NAME%
admin_user = %SERVICE_USER%
admin_password = %SERVICE_PASSWORD%

These values have to be modified as per the configurations made earlier. The admin_tenant_name will be 'service', admin_user will be 'glance' and admin_password is 'glance'.

After editing, the lines should be as follows:

admin_tenant_name = service
admin_user = glance
admin_password = glance

Now open /etc/glance/glance-registry-paste.ini and make similar changes at the end of the file.

Open the file /etc/glance/glance-registry.conf and edit the line which contains the option "sql_connection =" to this:

sql_connection = mysql://glancedbadmin:glancesecret@192.168.26.128/glance

In order to tell glance to use keystone for authentication, add the following lines at the end of the file.

[paste_deploy]
flavor = keystone

Open /etc/glance/glance-api.conf and add the following lines at the end of the document.

[paste_deploy]
flavor = keystone

Create glance schema in the MySQL database.:

sudo glance-manage version_control 0
sudo glance-manage db_sync

Restart glance-api and glance-registry after making the above changes.

sudo restart glance-api
sudo restart glance-registry

Export the following environment variables.

   export SERVICE_TOKEN=admin
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=admin
export OS_AUTH_URL="http://localhost:5000/v2.0/"
export SERVICE_ENDPOINT=http://localhost:35357/v2.0

Alternatively, you can add these variables to ~/.bashrc.

To test if glance is setup correectly execute the following command.

glance index

The above command will not return any output. The output of the last command executed can be known from its return code - echo $?. If the return code is zero, then glance is setup properly and connects with Keystone.

With glance configured properly and using keystone as the authentication mechanism, now we can upload images to glance. This has been explained in detail in "Image Management" chapter.

localadmin@OpenStack-1:~$ glance
Usage: glance <command> [options] [args]

Commands:

help <command>  Output help for one of the commands below

add             Adds a new image to Glance

update          Updates an image's metadata in Glance

delete          Deletes an image from Glance

index           Return brief information about images in Glance

details         Return detailed information about images in
                    Glance

show            Show detailed information about an image in
                    Glance

clear           Removes all images and metadata from Glance

Member Commands:

image-members    List members an image is shared with

member-images    List images shared with a member

member-add       Grants a member access to an image

member-delete    Revokes a member's access to an image

members-replace  Replaces all membership for an image

Options:
  --version             show program's version number and exit
  -h, --help            show this help message and exit
  --silent-upload       disable progress bar animation and information during
                        upload
  -v, --verbose         Print more verbose output
  -d, --debug           Print more verbose output
  -H ADDRESS, --host=ADDRESS
                        Address of Glance API host. Default: 0.0.0.0
  -p PORT, --port=PORT  Port the Glance API host listens on. Default: 9292
  --ssl                 Use SSL when talking to Glance API host
  -U URL, --url=URL     URL of Glance service. This option can be used to
                        specify the hostname, port and protocol (http/https)
                        of the glance server, for example -U
                        https://localhost:9292/v1 Default: None. If given,
                        this option will override settings for --host, --port,
                        and --ssl.
  -k, --insecure        Explicitly allow glance to perform "insecure" SSL
                        (https) requests. The server's certificate will not be
                        verified against any certificate authorities. This
                        option should be used with caution.
  -A TOKEN, --os_auth_token=TOKEN, --auth_token=TOKEN
                        Authentication token to use to identify the client to
                        the glance server.  --auth_tokenis deprecated and will
                        be removed
  -I USER, --os_username=USER
                        User name used to acquire an authentication token
  -K PASSWORD, --os_password=PASSWORD
                        Password used to acquire an authentication token
  -R REGION, --os_region_name=REGION
                        Region name. When using keystone authentication
                        version 2.0 or later this identifies the region name
                        to use when selecting the service endpoint. A region
                        name must be provided if more than one region endpoint
                        is available
  -T TENANT, --os_tenant_name=TENANT
                        Tenant name
  -N AUTH_URL, --os_auth_url=AUTH_URL
                        Authentication URL
  -S STRATEGY, --os_auth_strategy=STRATEGY
                        Authentication strategy (keystone or noauth)
  --limit=LIMIT         Page size to use while requesting image metadata
  --marker=MARKER       Image index after which to begin pagination
  --sort_key=KEY        Sort results by this image attribute.
  --sort_dir=[desc|asc]
                        Sort results in this direction.
  -f, --force           Prevent select actions from requesting user
                        confirmation
  --dry-run             Don't actually execute the command, just print output
                        showing what WOULD happen.
  --can-share           Allow member to further share image.

转载于:https://www.cnblogs.com/licheng/archive/2012/06/04/2534628.html

[OpenStack] OpenStack Essex - Glance 安装部署与命令行详解相关推荐

  1. Ubuntu14.04下Mongodb数据库可视化工具安装部署步骤(图文详解)(博主推荐)

    不多说,直接上干货! 前期博客 Ubuntu14.04下Mongodb(离线安装方式|非apt-get)安装部署步骤(图文详解)(博主推荐) Ubuntu14.04下Mongodb官网安装部署步骤(图 ...

  2. Ubuntu16.04下Mongodb官网安装部署步骤(图文详解)(博主推荐)

    不多说,直接上干货! 在这篇博客里,我采用了非官网的安装步骤,来进行安装.走了弯路,同时,也是不建议.因为在大数据领域和实际生产里,还是要走正规的为好. Ubuntu16.04下Mongodb(离线安 ...

  3. python的pytest模块:pytest命令行详解

    一.官方文档 How to invoke pytest - pytest documentationhttps://docs.pytest.org/en/latest/how-to/usage.htm ...

  4. GCC 命令行详解 -L -l

    我们用gcc编译程序时,常常会用到"-I"(大写i),"-L"(大写l),"-l"(小写l)等参数,下面做个记录: GCC 命令行详解 -L ...

  5. 7Z解压缩包软件命令行详解

    7Z命令行 7z.exe在CMD窗口的使用说明如下: 7-Zip (A) 4.57 Copyright (c) 1999-2007 Igor Pavlov 2007-12-06 Usage: 7za ...

  6. Ubuntu14.04下Neo4j图数据库官网安装部署步骤(图文详解)(博主推荐)

    不多说,直接上干货! 说在前面的话  首先,查看下你的操作系统的版本. root@zhouls-virtual-machine:~# cat /etc/issue Ubuntu 14.04.4 LTS ...

  7. Ubuntu16.04下Neo4j图数据库官网安装部署步骤(图文详解)(博主推荐)

    不多说,直接上干货! 说在前面的话  首先,查看下你的操作系统的版本. root@zhouls-virtual-machine:~# cat /etc/issue Ubuntu 16.04.1 LTS ...

  8. 云服务器CentOS8.2安装部署Docker一文详解

    目录 前言 一.Docker简介 二.安装部署以及测试Docker 1.安装Docker 1.1查看系统版本 1.2移除旧依赖 1.3安装方法 1.4设置存储库 ​编辑 1.5安装Docker引擎 1 ...

  9. Gradle安装部署与基础入门详解

    [1]Gradle简介 Gradle 是一款Google 推出的基于JVM.通用灵活的项目构建工具,支持Maven,JCenter 多种第三方仓库;支持传递性依赖管理.废弃了繁杂的xml 文件,转而使 ...

最新文章

  1. c++调用cplex求解例子_递归算法的R语言实现 (罗汉塔、九连环、斐波那契数列等问题的求解)...
  2. css_oneday
  3. php为什么要提前定义变量
  4. 泛型系列3:获取泛型的类型
  5. 追影windows7 虚拟4桌面
  6. 大学物理实验电学基本参数的测量实验报告_思你所想 | 那些年,我们做过的实验...
  7. Centos7挂载iso镜像文件配置本地yum源
  8. 【LwM2M】LwM2M相关的开源项目
  9. DDIA - 第5章 数据复制
  10. repair table accessright
  11. 【转】深入理解Instrument
  12. 九秒倒计时c语言编程,可变信息倒九秒半程倒计时器的制作方法
  13. uniApp uview图片懒加载
  14. 如何解决eclipse官网下载速度超慢的问题
  15. 路由器的flash和内存
  16. rust自创服务器_用Rust写了一个简单的Web服务器
  17. terraform 安装及命令
  18. AlphaFold2源码解析(10)--补充信息1(residue_constants)
  19. 这几个摸鱼神器,你怎么能不知道
  20. 墨西哥城新机场 | 一座来自未来的机场

热门文章

  1. 数据表格搜索php代码_手把手教学:提取PDF各种表格文本数据(附代码)
  2. qt与python互联_PYQT5 vscode联合操作qtdesigner的方法
  3. 简单Android手机APP地图,android最简单手机地图APP(只需5分钟)
  4. 四川大学计算机学院夏欣,自适应窗口的图像平滑去噪.pdf
  5. linux shell set 赋值,请教linux下shell 中 set 的用法?
  6. 测试ESP32S基本模块的功能,并验证是否可以应用在AI智能车竞赛检测激光信号中
  7. 比Tiny YOLOv3小8倍,性能提升11个点,4MB的网络也能做目标检测
  8. 海军工程大学学生电子课程-DIY Final预验收
  9. DRV8834用于驱动双电机
  10. 2020年春季学期信号与系统课程作业参考答案-第十二次作业