其他分享
首页 > 其他分享> > OpenStack-T版glance 服务

OpenStack-T版glance 服务

作者:互联网

glance 服务

使用数据库访问客户端以用户身份连接到数据库服务器:root

#mysql -u root -p000000

创建数据库:glance

> CREATE DATABASE glance;

授予对数据库的正确访问权限:glance

> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost'    IDENTIFIED BY '000000';
> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%'    IDENTIFIED BY '000000';
 flush privileges;

img

获取对仅限管理员的 CLI 命令的访问权限:admin

#. admin-openrc

创建用户:glance

#openstack user create --domain default --password 000000 glance

img

将角色添加到用户和项目

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

img

创建服务实体:glance

#openstack service create --name glance \

--description "OpenStack Image" image

img

创建影像服务 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 

img


安装软件包:

#yum install openstack-glance -y

编辑配置文件

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

[database]

connection = mysql+pymysql://glance:000000@controller/glance

[keystone_authtoken]

www_authenticate_uri = http://controller:5000

auth_url = http://controller:5000

memcached_servers = controller:11211

auth_type = password

project_domain_name = Default

user_domain_name = Default

project_name = service

username = glance

password = 000000

[paste_deploy]

flavor = keystone

[glance_store]

stores = file,http

default_store = file

filesystem_store_datadir = /var/lib/glance/images/

img

填充影像服务数据库:

#su -s /bin/sh -c "glance-manage db_sync" glance

img

启动服务

#systemctl enable openstack-glance-api.service 
#systemctl restart openstack-glance-api.service
#systemctl status openstack-glance-api.service

img

验证

上传镜像(二选一)

 #openstack image create ‐‐file /root/cirros‐0.3.3‐ x86_64‐disk.img ‐‐disk‐format qcow2 ‐‐container‐format bare ‐‐public cirr os‐0.3.3 
 openstack image list 

获取对仅限管理员的 CLI 命令的访问权限:admin

#. admin-openrc

下载源图像

#wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img

使用 QCOW2 磁盘格式、容器格式和公众可见性将图像上传到映像服务以便所有项目都可以访问它:

# glance image-create --name "cirros" \
   --file cirros-0.4.0-x86_64-disk.img \
   --disk-format qcow2 --container-format bare \
   --visibility public

img

确认上传图像并验证属性:

#glance image-list

img

标签:服务,--,image,controller,openstack,OpenStack,glance,create
来源: https://www.cnblogs.com/dagu666/p/16561403.html