Ubuntu16.10安装Ocata之3:Glance

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
云数据库 RDS MySQL Serverless,价值2615元额度,1个月
简介:

1、创建Glance数据库

root@controller:~/ocata# mysql -uroot -p -e "CREATE DATABASE glance"

Enter password:

root@controller:~/ocata# mysql -uroot -p -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'zoomtech'"

Enter password:

root@controller:~/ocata# mysql -uroot -p -e "GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'zoomtech'"

Enter password:


2、创建Glance用户、

root@controller:~/ocata# source admin-openrc

root@controller:~/ocata# openstack user create --domain default --password-prompt glance

User Password:

Repeat User Password:

+---------------------+----------------------------------+

| Field               | Value                            |

+---------------------+----------------------------------+

| domain_id           | default                          |

| enabled             | True                             |

| id                  | 077fa99f355f43389d28bf476e1c4549 |

| name                | glance                           |

| options             | {}                               |

| password_expires_at | None                             |

+---------------------+----------------------------------+

root@controller:~/ocata# openstack role add --project service --user glance admin


3、创建glance服务

root@controller:~/ocata# openstack service create --name glance \

   --description "OpenStack Image" image

+-------------+----------------------------------+

| Field       | Value                            |

+-------------+----------------------------------+

| description | OpenStack Image                  |

| enabled     | True                             |

| id          | 86a9f0234e4846bdac32c10b553a41f5 |

| name        | glance                           |

| type        | image                            |

+-------------+----------------------------------+


4、创建glance API端点

root@controller:~/ocata# openstack endpoint create --region RegionOne \

   image public http://controller:9292

+--------------+----------------------------------+

| Field        | Value                            |

+--------------+----------------------------------+

| enabled      | True                             |

| id           | 47bce25719a24321980283481d751374 |

| interface    | public                           |

| region       | RegionOne                        |

| region_id    | RegionOne                        |

| service_id   | 86a9f0234e4846bdac32c10b553a41f5 |

| service_name | glance                           |

| service_type | image                            |

| url          | http://controller:9292           |

+--------------+----------------------------------+

root@controller:~/ocata# openstack endpoint create --region RegionOne \

   image internal http://controller:9292

+--------------+----------------------------------+

| Field        | Value                            |

+--------------+----------------------------------+

| enabled      | True                             |

| id           | 53e7ab3597ad4543bde2d85e780d3736 |

| interface    | internal                         |

| region       | RegionOne                        |

| region_id    | RegionOne                        |

| service_id   | 86a9f0234e4846bdac32c10b553a41f5 |

| service_name | glance                           |

| service_type | image                            |

| url          | http://controller:9292           |

+--------------+----------------------------------+

root@controller:~/ocata# openstack endpoint create --region RegionOne \

>   image admin http://controller:9292

+--------------+----------------------------------+

| Field        | Value                            |

+--------------+----------------------------------+

| enabled      | True                             |

| id           | 4fc7c8f3208a4159a34ee23e733e5115 |

| interface    | admin                            |

| region       | RegionOne                        |

| region_id    | RegionOne                        |

| service_id   | 86a9f0234e4846bdac32c10b553a41f5 |

| service_name | glance                           |

| service_type | image                            |

| url          | http://controller:9292           |

+--------------+----------------------------------+

root@controller:~/ocata#


5、配置glance api

root@controller:~/ocata# vim /etc/glance/glance-api.conf

[database]

connection = mysql+pymysql://glance:zoomtech@controller/glance

[keystone_authtoken]

auth_uri = http://controller:5000

auth_url = http://controller:35357

memcached_servers = controller:11211

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = glance

password = zoomtech

[paste_deploy]

flavor = keystone

[glance_store]

stores = file,http

default_store = file

filesystem_store_datadir = /var/lib/glance/images/


6、配置glance registry

root@controller:~/ocata# vim /etc/glance/glance-registry.conf

[database]

connection = mysql+pymysql://glance:zoomtech@controller/glance

[keystone_authtoken]

auth_uri = http://controller:5000

auth_url = http://controller:35357

memcached_servers = controller:11211

auth_type = password

project_domain_name = default

user_domain_name = default

project_name = service

username = glance

password = zoomtech

[paste_deploy]

flavor = keystone


7、同步数据库

root@controller:~/ocata# su -s /bin/sh -c "glance-manage db_sync" glance

8、启动glance

root@controller:~/ocata# service glance-registry restart

root@controller:~/ocata# service glance-api restart

root@controller:~/ocata# service glance-registry status

root@controller:~/ocata# service glance-api status


9、测试images

root@controller:~/ocata# wget wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img

root@controller:~/ocata# openstack image create "cirros"    --file cirros-0.3.4-x86_64-disk.img    --disk-format qcow2 --container-format bare    --public

+------------------+------------------------------------------------------+

| Field            | Value                                                |

+------------------+------------------------------------------------------+

| checksum         | ee1eca47dc88f4879d8a229cc70a07c6                     |

| container_format | bare                                                 |

| created_at       | 2017-02-28T05:53:02Z                                 |

| disk_format      | qcow2                                                |

| file             | /v2/images/9b51b435-c6ed-4c8d-814b-760cda0d813e/file |

| id               | 9b51b435-c6ed-4c8d-814b-760cda0d813e                 |

| min_disk         | 0                                                    |

| min_ram          | 0                                                    |

| name             | cirros                                               |

| owner            | 56d3f276e94d48ffb014a6fe5776d0e5                     |

| protected        | False                                                |

| schema           | /v2/schemas/image                                    |

| size             | 13287936                                             |

| status           | active                                               |

| tags             |                                                      |

| updated_at       | 2017-02-28T05:53:02Z                                 |

| virtual_size     | None                                                 |

| visibility       | public                                               |

+------------------+------------------------------------------------------+

root@controller:~/ocata# openstack image list

+--------------------------------------+--------+--------+

| ID                                   | Name   | Status |

+--------------------------------------+--------+--------+

| 9b51b435-c6ed-4c8d-814b-760cda0d813e | cirros | active |

+--------------------------------------+--------+--------+


本文转自    OpenStack2015 博客,原文链接:     http://blog.51cto.com/andyliu/1902054     如需转载请自行联系原作者

相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
Linux 开发工具 git
centos安装gitea
centos安装gitea,使用内置库
631 0
centos安装gitea
|
Linux Docker 容器
|
Linux 关系型数据库 Oracle
foreman ubuntu16快速安装
Quickstart Guide The Foreman installer is a collection of Puppet modules that installs everything required for a full working Foreman setup.
971 0
|
关系型数据库 MySQL 开发工具
|
消息中间件 Ubuntu 关系型数据库
|
关系型数据库 MySQL 开发工具