首页 > 代码库 > Openstack-glance镜像服务
Openstack-glance镜像服务
Openstack-glance镜像服务
教程大纲
1. glance的服务组件介绍
2. glance的安装部署
3. 上传镜像测试
1.创建glance的数据库
mysql -u root -p -e "create database glance;"
mysql -u root -p -e "grant all privileges on glance.* to ‘glance‘@‘localhost‘ identified by ‘glance‘;"
mysql -u root -p -e "grant all privileges on glance.* to ‘glance‘@‘%‘ identified by ‘glance‘;"
2.安装glance的组件
yum install openstack-glance
3.修改 glance-api的配置
verbose = true
connection = mysql://glance:glance@192.168.100.40/glance
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images
auth_uri = http://192.168.100.40:5000
auth_url = http://192.168.100.40:35357
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
flavor = keystone
4.修改 glance-registry.conf
connection = mysql://glance:glance@192.168.100.40/glance
auth_uri = http://192.168.100.40:5000
auth_url = http://192.168.100.40:35357
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
flavor = keystone
5.同步glance数据库
su -s /bin/sh -c "glance-manage db_sync" glance
6.启动glance服务
systemctl enable openstack-glance-api.service \
openstack-glance-registry.service
systemctl start openstack-glance-api.service \
openstack-glance-registry.service
7.创建glance用户
openstack user create --domain default --password-prompt glance
将glance 加入服务中
openstack role add --project service --user glance admin
8.注册glance 的服务(如果想用glance 必须在keystone上做注册)
openstack service create --name glance \
--description "OpenStack Image" image
9.创建glance服务
openstack service create --name glance --description "OpenStack Image service" image
10.创建glance的三个端点
openstack endpoint create --region RegionOne image public http://192.168.100.40:9292
openstack endpoint create --region RegionOne image internal http://192.168.100.40:9292
openstack endpoint create --region RegionOne image admin http://192.168.100.40:9292
11.上传镜像测试
(如果没有镜像就可以 wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img)
创建系统镜像的glance命令
openstack image create "cirros" \
--file cirros-0.3.4-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--public
查看镜像的存放目录
ls /var/lib/glance/images/
13.验证glance 的节点
glance image-list
请观看视屏
视屏会在腾讯课堂和优酷、56视屏网站中上传。请大家搜索中祥课堂即可观看
Openstack-glance镜像服务