码迷,mamicode.com
首页 > 其他好文 > 详细

OpenStack Pike Minimal安装:三、镜像管理

时间:2018-09-04 19:51:11      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:password   data   enable   分享   安装   url   glance   su -   min   

1.创建服务凭据
#先使用脚本登陆admin
[root@controller ~]# . admin-openstack.sh

①创建glance user

openstack user create --domain default --password-prompt glance
技术分享图片

②关联

openstack role add --project service --user glance admin

③创建glance service

openstack service create --name glance --description "OpenStack Image" image
技术分享图片

④创建服务API

openstack endpoint create --region RegionOne image public http://controller:9292
openstack endpoint create --region RegionOne image internal http://controller:9292
openstack endpoint create --region RegionOne image admin http://controller:9292
技术分享图片

2.在controller节点上安装glance

[root@controller ~]#  yum install openstack-glance -y

3.配置glance-api.conf

[root@controller ~]# vim /etc/glance/glance-api.conf
[database]
connection = mysql+pymysql://glance:glance@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 = glance

[paste_deploy]
flavor = keystone

[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/

4.配置glance-registry.conf

[root@controller ~]# vim /etc/glance/glance-registry.conf
[database]
connection = mysql+pymysql://glance:glance@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 = glance

[paste_deploy]
flavor = keystone

5.填充数据库

[root@controller ~]# su -s /bin/sh -c "glance-manage db_sync" glance
[root@controller ~]# mysql -h controller -uglance -pglance -e "use glance;show tables;"

6.启动服务

[root@controller ~]# systemctl enable openstack-glance-api.service openstack-glance-registry.service
[root@controller ~]# systemctl start openstack-glance-api.service openstack-glance-registry.service

7.上传镜像验证

①下载测试镜像

[root@controller ~]# wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img

②上传镜像到glance

openstack image create "cirros" --file cirros-0.3.5-x86_64-disk.img --disk-format qcow2 --container-format bare --public
技术分享图片

③查看镜像列表

技术分享图片

OpenStack Pike Minimal安装:三、镜像管理

标签:password   data   enable   分享   安装   url   glance   su -   min   

原文地址:http://blog.51cto.com/lullaby/2170256

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!