Ubuntu 14.04一步一步安装Openstack Kilo版本-8(glance)

8.1.  创建数据库

mysql -u root -p

create database glance;

grant all privileges on glance.* to'glance'@'kilo' identified by 'glance_dbpass';

grant all privileges on glance.* to'glance'@'localhost' identified by 'glance_dbpass';

grant all privileges on glance.* to'glance'@'%' identified by 'glance_dbpass';

exit

8.2.  创建认证服务

source admin-openrc.sh

openstack user create --password-promptglance

User Password:(填写密码:glance_pass)

Repeat User Password:

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

| Field    | Value                            |

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

| email    | None                             |

| enabled  | True                             |

| id       | d0962c616ca645ca87916abc709e3195 |

| name     | glance                           |

| username |glance                           |

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

openstack role add --project service --userglance admin

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

| Field |Value                            |

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

| id    | 14b826a870464c67900a963d675cc8cb |

| name  | admin                           |

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

openstack service create --name glance--description "Openstack Image Service" image

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

| Field       | Value                            |

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

| description |Openstack Image Service          |

| enabled     | True                             |

| id          | ae5bda0ebc10479ca156cb975c3a2eab |

| name        | glance                           |

| type        | image                            |

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

8.3.  创建镜像服务API endpoint

openstack endpoint create --publicurlhttp://kilo:9292 --internal http://kilo:9292 --adminurl http://kilo:9292--region RegionOne image

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

| Field        | Value                            |

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

| adminurl     | http://kilo:9292                 |

| id           | 43f4c5ce46744da29a33cabad834f6fa |

|internalurl  | http://kilo:9292                 |

| publicurl    | http://kilo:9292                 |

| region       | RegionOne                        |

| service_id   | ae5bda0ebc10479ca156cb975c3a2eab |

| service_name |glance                           |

| service_type |image                            |

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

8.4.  安装glance

sudo apt-get install glancepython-glanceclient -y

8.5.  配置glance

sudo vim /etc/glance/glance-api.conf

[DEFAULT]

notification_driver = noop

verbose = True

[database]

connection =mysql://glance:glance_dbpass@kilo/glance

[keystone_authtoken]

auth_uri = http://kilo:5000

auth_url = http://kilo:35357

auth_plugin = password

project_domain_id = default

user_domain_id = default

project_name = service

username = glance

password = glance_pass

revocation_cache_time = 10

[paste_deploy]

flavor=keystone

[glance_store]

default_store = file

filesystem_store_datadir =/var/lib/glance/images/

 

sudo vim /etc/glance/glance-registry.conf

 

[DEFAULT]

notification_driver = noop

verbose = True

[database]

connection =mysql://glance:glance_dbpass@kilo/glance

[keystone_authtoken]

auth_uri = http://kilo:5000

auth_url = http://kilo:35357

auth_plugin = password

project_domain_id = default

user_domain_id = default

project_name = service

username = glance

password = glance_pass

[paste_deploy]

flavor=keystone

8.6.  同步数据库

sudo bash -c "glance-managedb_sync" glance

 

8.7.  重启服务

sudo rm -f /var/lib/glance/glance.sqlite

sudo service glance-api restart

sudo service glance-registry restart

8.8.  glance安装验证

8.8.1.   在每一个客户端脚本,配置镜像服务客户端使用 APIversion 2.0

echo "exportOS_IMAGE_API_VERSION=2" | tee -a admin-openrc.sh demo-openrc.sh

source admin-openrc.sh

8.8.2.   下载镜像

wgethttp://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img

8.8.3.   上传镜像

glance image-create --name"cirros-0.3.3-x86_64" --file cirros-0.3.3-x86_64-disk.img--disk-format qcow2 --container-format bare --visibility public --progress

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

| Property         | Value                                |

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

| checksum         |133eae9fb1c98f45894a4e60d8736619     |

|container_format | bare                                 |

| created_at       | 2015-05-25T06:46:43Z                 |

|disk_format      | qcow2                                |

| id               |e056a34b-8226-4885-9b30-982dbf36a5dc |

| min_disk         | 0                                    |

| min_ram          | 0                                    |

| name             | cirros-0.3.3-x86_64                  |

| owner            |9e4ff200c6994bd6bd6e589c21afa2f8     |

| protected        | False                                |

| size             | 13200896                             |

| status           | active                               |

| tags             | []                                   |

| updated_at       | 2015-05-25T06:46:44Z                 |

|virtual_size     | None                                 |

| visibility       | public                               |

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

8.8.4.   确认成功

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

| ID                                   | Name                | Disk Format | Container Format |Size     | Status |

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

|e056a34b-8226-4885-9b30-982dbf36a5dc | cirros-0.3.3-x86_64 | qcow2       | bare             | 13200896 | active |

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值