openstack stein部署手册 4. glance

Posted liujitao79

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了openstack stein部署手册 4. glance相关的知识,希望对你有一定的参考价值。

# 建立数据库用户及权限
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的主要内容,如果未能解决你的问题,请参考以下文章

openstack stein部署手册 3. keystone

openstack stein部署手册 2. 基础应用

openstack stein部署手册 1. 准备

ubuntu18.04 devstack openstack stein部署

19th!OpenStack Stein亮点介绍

基于ARM 的 OpenStack Stein 部署