接上一篇keystone, 这一篇介绍glance服务:

  • 在开始操作之前,先用source环境变量,然后创建glance 用户,并设置密码为glance

[root@linux-node1 ~]#openstack user create --domain default --password-prompt glance

User Password:

Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 31a0d9b7dd5f47b4b30ed4a77500a307 |
| name | glance |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
  • 添加admin角色到glance用户和service project
[root@linux-node1 ~]# openstack role add --project service --user glance admin
[root@linux-node1 ~]#
  • 编辑/etc/glance/glance-registry.conf 如下所示
[database]
# ...
connection = mysql+pymysql://glance:glance@192.168.56.11/glance
[keystone_authtoken]

auth_uri = http://192.168.56.11:5000 
auth_url = http://192.168.56.11:35357 
memcached_servers = 192.168.56.11:11211 
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[paste_deploy]

  flavor = keystone

  • 编辑/etc/glance/glance-api.conf 如下所示:

[database]
connection = mysql+pymysql://glance:glance@192.168.56.11/glance
[keystone_authtoken]
auth_uri = http://192.168.56.11:5000 
auth_url = http://192.168.56.11:35357
memcached_servers = 192.168.56.11:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
[glance_store]
stores = file,http 
default_store = file
filesystem_store_datadir = /var/lib/glance/images
  • 同步glance数据库
[root@linux-node1 ~]# su -s /bin/sh -c "glance-manage db_sync" glance
  • 验证数据库是否同步
[root@linux-node1 ~]# mysql -h 192.168.56.11 -uglance -pglance -e "use glance;show tables" 
+----------------------------------+
| Tables_in_glance |
+----------------------------------+
| alembic_version |
| image_locations |
| image_members |
| image_properties | i
|mage_tags|
| metadef_namespaces |
| metadef_objects |
| metadef_properties |
| metadef_resource_types |
| metadef_tags |
| images |
| metadef_namespace_resource_types |
| migrate_version |
| task_info |
| tasks |
+----------------------------------+
  • 启动memcached并设置开机启动
[root@linux-node1 ~]# systemctl enable memcached
[root@linux
-node1 ~]# systemctl start memcached
  • 启动glance服务并设置开机启动
systemctl enable openstack-glance-api.service \
openstack-glance-
registry.service
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-glance-api.service
to /usr/lib/systemd/system/openstack-glance-api.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/openstack-glance-registry.service to /usr/lib/systemd/system/openstack-glance-registry.service.
systemctl start openstack-glance-api.service \
openstack-glance-registry.service
  • 创建glance实例
openstack service create --name glance \
--description "OpenStack Image" image
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image |
| enabled | True |
| id | 4c4dd5eb35324b568cd9722f174a632b |
| name | glance |
| type | image |
+-------------+----------------------------------+
  • 创建glance服务API 端点
openstack endpoint create --region RegionOne \
image public http://192.168.56.11:9292

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 47e8d9659f70422487cf600405f518bf |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 4c4dd5eb35324b568cd9722f174a632b |
| service_name | glance |
| service_type | image |
| url | http://192.168.56.11:9292 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
image internal http://192.168.56.11:9292

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 859936e9632642d58517d9ac6a2c3176 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 4c4dd5eb35324b568cd9722f174a632b |
| service_name | glance |
| service_type | image |
| url | http://192.168.56.11:9292 |
+--------------+----------------------------------+openstack endpoint create --region RegionOne \
image admin http://192.168.56.11:9292

+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 223775040aaf460da4f275ebbcd01ae1 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 4c4dd5eb35324b568cd9722f174a632b |
| service_name | glance |
| service_type | image |
| url | http://192.168.56.11:9292 |
+--------------+----------------------------------+
  • 验证创建,现在是两个服务的六个端点
[root@linux-node1 ~]# openstack endpoint list
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| ID | Region | Service Name | Service Type | Enabled | Interface | URL |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
| 16964c23761c428b909e9a8617d8146e | RegionOne | keystone | identity | True | internal | http://192.168.56.11:5000/v3/ |
| 223775040aaf460da4f275ebbcd01ae1 | RegionOne | glance | image | True | admin | http://192.168.56.11:9292 |
| 36fb4b5b955d471783a982ea455cf58d | RegionOne | keystone | identity | True | public | http://192.168.56.11:5000/v3/ |
| 47e8d9659f70422487cf600405f518bf | RegionOne | glance | image | True | public | http://192.168.56.11:9292 |
| 62766176a40f43bbbb40d4b986b4400e | RegionOne | keystone | identity | True | admin | http://192.168.56.11:35357/v3/ |
| 859936e9632642d58517d9ac6a2c3176 | RegionOne | glance | image | True | internal | http://192.168.56.11:9292 |
+----------------------------------+-----------+--------------+--------------+---------+-----------+--------------------------------+
  • 这个时候,输入openstack image list,如果没有报错,即证明上面的操作是对的
[root@linux-node1 ~]# openstack image list
[root@linux-node1 ~]#
  • 下面我们用一个小镜像来验证一下,首先先获取这个镜像
wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
  • 创建并验证镜像
openstack image create "cirros" \
--file cirros-0.3.-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--public
+------------------+------------------------------------------------------+
| Field | Value |
+------------------+------------------------------------------------------+
| checksum | f8ab98ff5e73ebab884d80c9dc9c7290 |
| container_format | bare |
| created_at | --12T08::52Z |
| disk_format | qcow2 |
| file | /v2/images/24a1486b-d1b5--b2cc-3397fdf295cf/file |
| id | 24a1486b-d1b5--b2cc-3397fdf295cf |
| min_disk | |
| min_ram | |
| name | cirros |
| owner | fb6761ab3d3d43569d5fdfafcdfa5e28 |
| protected | False |
| schema | /v2/schemas/image |
| size | |
| status | active |
| tags | |
| updated_at | --12T08::52Z |
| virtual_size | None |
| visibility | public |
+------------------+------------------------------------------------------+
[root@linux-node1 ~]# openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 24a1486b-d1b5--b2cc-3397fdf295cf | cirros | active |
+--------------------------------------+--------+--------+

至此,glance部分创建完毕

OpenStack 安装:glance 安装的更多相关文章

  1. openstack之~glance安装部署

    接着部署完keystone后,接着部署glance 第一:部署安装glance glance关于数据库的操作: [root@controller /]# mysql -u root -p Enter ...

  2. openstack学习-glance安装(三)

    glance在openstack负责镜像相关管理的,对外提供标准的api提供服务,glance有两个服务,一个是glance-api接受云系统镜像的创建.删除.读取请求.glance-registry ...

  3. OpenStack:安装Glance

    >安装Glance1. 安装# apt-get install glance python-glanceclient删除sqlite文件rm -f /var/lib/glance/glance. ...

  4. CentOS7安装OpenStack(Rocky版)-03.安装Glance镜像服务组件(控制节点)

    上篇文章分享了keystone的安装配置,本文接着分享openstack的镜像服务glance. --------------- 完美的分割线 ---------------- 3.0.glance概 ...

  5. openstack Glance安装与配置

    一.实验目的: 1.理解glance镜像服务在OpenStack框架中的作用 2.掌握glance服务安装的基本方法 3.掌握glance的配置基本方法 二.实验步骤: 1.在controller节点 ...

  6. OpenStack Train版-3.安装glance镜像服务

    安装glance镜像服务 创建数据库并授权 mysql -u root create database glance; GRANT ALL PRIVILEGES ON glance.* TO 'gla ...

  7. (四)OpenStack---M版---双节点搭建---Glance安装和配置

    ↓↓↓↓↓↓↓↓视频已上线B站↓↓↓↓↓↓↓↓ >>>>>>传送门 1.创建glance数据库 2.获得 admin 凭证来获取只有管理员能执行的命令的访问权限 3 ...

  8. 安装glance

    在控制节点上执行 controllerHost='controller' MYSQL_PASSWD='m4r!adbOP' GLANCE_PASSWD='glance1234!' 1.创建数据库 my ...

  9. openstack June all-in-one 安装手册

    by lt,hyc 1.安全规范 表1:openstack用户和密码值设置 用户名 含义  本文的设置值 Admin openstack管理员用户 ADMIN_PASS Keystone openst ...

随机推荐

  1. ie8网页时调用特定的css文件

    加上条件注释语句<!--[if IE 8]><link rel="".........................><![endif]--> ...

  2. Js高级 事件 对象

    1.事件 浏览器客户端上客户触发的行为都成为事件 所有的事件都是天生自带的,不需要我们我去绑定,只需要我们去触发. 通过obj.事件名=function(){} 事件名:onmouseover onm ...

  3. CVE-2017-12615和CVE-2017-12616

    Tomcat代码执行漏洞分析测试 1. 漏洞花絮        2017年9月19日,Apache Tomcat官方确认并修复了两个高危漏洞,漏洞CVE编号:CVE-2017-12615和CVE-20 ...

  4. SQL 入门了解

    SQL 随着应用程序的功能越来越复杂,数据量越来越大,如何管理这些数据就成了大问题: 读写文件并解析出数据需要大量重复代码: 从成千上万的数据中快速查询出指定数据需要复杂的逻辑. 如果每个应用程序都各 ...

  5. 看淘宝营销api 文档有感

    total: use appkey & secrect variance naming rule 提供沙箱环境 使用api gateway 使用rest(但返回结果包裹了 isp.thread ...

  6. windows openssh server 安装试用

    使用Windows的可能会知道win10 的已经包好了openssh 服务,但是对于其他机器win 7 windows 2008 ,就需要其他的方法了 还好powershell 团队开发了支持wind ...

  7. ARTIFICIAL INTELLIGENCE FOR GAMES (Ian Millington / John Funge 著)

    相关网站:http://www.ai4g.com PART I AI AND GAMESCHAPTER1 INTRODUCTIONCHAPTER2 GAME AIPART II TECHNIQUESC ...

  8. django路由系统URLS

    usrls: from django.contrib import admin from django.urls import path from cmbd import views from dja ...

  9. Nodepad++ 进行数据分析操作

    查找: ^.*大师兄.*$ 替换为:(空)   如果不留空行: 查找: ^.*大师兄.*\r?\n   注意: Notepad++的[全部替换]受[方向]约束,所以如果想“向下”全部替换,要把光标放到 ...

  10. 涂抹mysql笔记-InnoDB/MyISAM及其它各种存储引擎

    存储引擎:一种设计的存取和处理方式.为不同访问特点的表对象指定不同的存储引擎,可以获取更高的性能和处理数据的灵活性.通常是.so文件,可以用mysql命令加载它. 查看当前mysql数据库支持的存储引 ...