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;
获取对仅限管理员的 CLI 命令的访问权限:admin
#. admin-openrc
创建用户:glance
#openstack user create --domain default --password 000000 glance
将角色添加到用户和项目
#openstack role add --project service --user glance admin
创建服务实体:glance
#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
安装软件包:
#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/
填充影像服务数据库:
#su -s /bin/sh -c "glance-manage db_sync" glance
启动服务
#systemctl enable openstack-glance-api.service
#systemctl restart openstack-glance-api.service
#systemctl status openstack-glance-api.service
验证
上传镜像(二选一)
#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
确认上传图像并验证属性:
#glance image-list
标签:服务,--,image,controller,openstack,OpenStack,glance,create 来源: https://www.cnblogs.com/dagu666/p/16561403.html