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

openstack stein部署手册 4. glance

时间:2019-11-16 10:55:57      阅读:81      评论:0      收藏:0      [点我收藏+]

标签:base   reg   syn   paste   bar   system   mysq   gen   开启   

# 建立数据库用户及权限
create database glance;
grant all privileges on glance.* to glance@'localhost' identified by 'Abc@123';
grant all privileges on glance.* to glance@'%' identified by 'Abc@123';
flush privileges;


# 建立用户、角色、服务、项目、域、端点
source ~/.openstack_admin
openstack user create --domain default --password Abc@123 glance
openstack role add --project service --user glance admin
openstack service create --name glance --description "OpenStack Image service" image

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


# 安装程序包
yum install -y openstack-glance


# 变更配置文件
cd /etc/glance/ 
mv glance-api.conf glance-api.conf.org

cat > /etc/glance/glance-api.conf << EOF
[DEFAULT]
bind_host = 0.0.0.0

[database]
connection = mysql+pymysql://glance:Abc@123@controller/glance

[keystone_authtoken]
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000/v3
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project _name = service
username = glance
password = Abc@123

[paste_deploy]
flavor = keystone

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

chmod 640 /etc/glance/glance-api.conf
chown root:glance /etc/glance/glance-api.conf


# 同步数据库
su -s /bin/bash -c "glance-manage db_sync" glance


# 开启服务
systemctl restart openstack-glance-api && systemctl enable openstack-glance-api


# 验证
互联网下载cp cirros-0.4.0-x86_64-disk.img, CentOS-7-x86_64-GenericCloud.qcow2文件

openstack image create "cirros" --file /tmp/cirros-0.4.0-x86_64-disk.img --disk-format qcow2 --container-format bare --public
openstack image create "centos-7-x86" --file /tmp/CentOS-7-x86_64-GenericCloud.qcow2 --disk-format qcow2 --container-format bare --public

openstack image list


openstack stein部署手册 4. glance

标签:base   reg   syn   paste   bar   system   mysq   gen   开启   

原文地址:https://www.cnblogs.com/liujitao79/p/11870763.html

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