Ubuntu16.10安装Ocata之3:Glance
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu16.10安装Ocata之3:Glance相关的知识,希望对你有一定的参考价值。
1、创建Glance数据库
[email protected]:~/ocata# mysql -uroot -p -e "CREATE DATABASE glance"
Enter password:
[email protected]:~/ocata# mysql -uroot -p -e "GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘localhost‘ IDENTIFIED BY ‘zoomtech‘"
Enter password:
[email protected]:~/ocata# mysql -uroot -p -e "GRANT ALL PRIVILEGES ON glance.* TO ‘glance‘@‘%‘ IDENTIFIED BY ‘zoomtech‘"
Enter password:
2、创建Glance用户、
[email protected]:~/ocata# source admin-openrc
[email protected]:~/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 |
+---------------------+----------------------------------+
[email protected]:~/ocata# openstack role add --project service --user glance admin
3、创建glance服务
[email protected]:~/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端点
[email protected]:~/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 |
+--------------+----------------------------------+
[email protected]:~/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 |
+--------------+----------------------------------+
[email protected]:~/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 |
+--------------+----------------------------------+
[email protected]:~/ocata#
5、配置glance api
[email protected]:~/ocata# vim /etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:[email protected]/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
[email protected]:~/ocata# vim /etc/glance/glance-registry.conf
[database]
connection = mysql+pymysql://glance:[email protected]/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、同步数据库
[email protected]:~/ocata# su -s /bin/sh -c "glance-manage db_sync" glance
8、启动glance
[email protected]:~/ocata# service glance-registry restart
[email protected]:~/ocata# service glance-api restart
[email protected]:~/ocata# service glance-registry status
[email protected]:~/ocata# service glance-api status
9、测试images
[email protected]:~/ocata# wget wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
[email protected]:~/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 |
+------------------+------------------------------------------------------+
[email protected]:~/ocata# openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 9b51b435-c6ed-4c8d-814b-760cda0d813e | cirros | active |
+--------------------------------------+--------+--------+
本文出自 “技术成就梦想” 博客,请务必保留此出处http://andyliu.blog.51cto.com/518879/1902054
以上是关于Ubuntu16.10安装Ocata之3:Glance的主要内容,如果未能解决你的问题,请参考以下文章
在Ubuntu 16.10安装mysql workbench报未安装软件包 libpng12-0错误