Openstack Ocata安装(Image service)

一、镜像服务安装
1.创建glance数据库,授予对glance数据库的正确访问权限:

mysql -u root -p
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '123qwe';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '123qwe';

输入admin凭据以访问仅管理CLI命令,创建glance用户,将admin角色添加到glance用户和 service项目中,创建glance服务实体,创建图像服务API端点。

source /home/admin-openrc.sh
openstack user create --domain default --password-prompt glance
openstack role add --project service --user glance admin
openstack service create --name glance \
--description "OpenStack Image" 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

2.安装openstack-glance,编辑/etc/glance/glance-api.conf

yum install openstack-glance
vi /etc/glance/glance-api.conf

配置数据库访问,配置身份服务访问,配置本地文件系统存储和映像文件的位置

[database]

connection = mysql+pymysql://glance:123qwe@controller/glance

[keystone_authtoken]

auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = 123qwe

[paste_deploy]

flavor = keystone

[glance_store]

stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images

编辑/etc/glance/glance-registry.conf
配置数据库访问,配置身份服务访问,

vi /etc/glance/glance-registry.conf
[database]

connection = mysql+pymysql://glance:123qwe@controller/glance

[keystone_authtoken]

auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = 123qwe

[paste_deploy]

flavor = keystone

填充图像服务数据库,启动服务并将其配置为在系统引导时启动

su -s /bin/sh -c "glance-manage db_sync" glance
systemctl enable openstack-glance-api.service \
openstack-glance-registry.service
systemctl start openstack-glance-api.service \
openstack-glance-registry.service

输入admin凭据以访问仅管理CLI命令,下载源镜像,上传镜像,确认图像上传并验证属性。

source /home/admin-openrc.sh
wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
openstack image create "cirros" \
--file cirros-0.3.5-x86_64-disk.img \
--disk-format qcow2 --container-format bare \
--public
openstack image list
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章