openstack镜像服务(glance)
来源:互联网 发布:互联网装修 知乎 编辑:程序博客网 时间:2024/05/21 06:59
1.Use the database access client to connect to the database server as the root user:
$ mysql -u root -p
2.Create the glance database:
CREATE DATABASE glance;
3.Grant proper access to the glance database:
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '123456';
4.Exit the database access client.
5.切换到管理员身份
source admin-openrc.sh 我保存的位置:/etc/keystone
6.创建glance用户
$ keystone user-create --name glance --pass 123456
7.为glance用户添加admin角色:
$ keystone user-role-add --user glance --tenant service --role admin
8.创建 glance 服务实体:
keystone service-create --name glance --type image --description "OpenStack Image Service"
9.创建Image Service API 端点:
keystone endpoint-create --service-id $(keystone service-list | awk '/ image / {print $2}') --publicurl http://controller:9292 --internalurl http://controller:9292 --adminurl http://controller:9292 --region regionOne
10. 安装包
# apt-get install glance python-glanceclient
11.编辑/etc/glance/glance-api.conf 加入下面的内容
[database]#connection = mysql://glance:GLANCE_DBPASS@controller/glance(不行)
connection = mysql://glance:GLANCE_DBPASS@10.0.0.11/glance...[keystone_authtoken]#Note:Comment out any auth_host, auth_port, and auth_protocol options because the identity_uri option replaces them.auth_uri = http://controller:5000/v2.0identity_uri = http://controller:35357admin_tenant_name = serviceadmin_user = glanceadmin_password = GLANCE_PASS...[paste_deploy]flavor = keystone...[glance_store]...default_store = filefilesystem_store_datadir = /var/lib/glance/images/[DEFAULT]...notification_driver = noop[DEFAULT]...verbose = True
在本文中GLANCEDBPASS和GLANCEPASS都为123456
12.编辑 /etc/glance/glance-registry.conf 加入下面的内容:
[database]...#connection = mysql://glance:GLANCE_DBPASS@controller/glance(不行)
connection = mysql://glance:GLANCE_DBPASS@10.0.0.11/glance[keystone_authtoken]...auth_uri = http://controller:5000/v2.0identity_uri = http://controller:35357admin_tenant_name = serviceadmin_user = glanceadmin_password = GLANCE_PASS[paste_deploy]...flavor = keystone[DEFAULT]...notification_driver = noopverbose = True
13.Restart the Image Service services:
# service glance-registry restart
# service glance-api restart
14.Create and change into a temporary local directory:
$ mkdir /tmp/images
15.Download the image to the temporary local directory:(注:手册上的镜像地址有变化)
wget -p /tmp/images http://download.cirros-cloud.net/0.3.3/cirros-0.3.3-x86_64-disk.img
16.Source the admin credentials to gain access to admin-only CLI commands:
$ source admin-openrc.sh
17.Upload the image to the Image Service:
glance image-create --name "cirros-0.3.3-x86_64" --file /tmp/images/cirros-0.3.3-x86_64-disk.img --disk-format qcow2 --container-format bare --is-public True --progress
注:
(如果在安装镜像服务(Image Service)时,在Verify the Image Service installation这一步,上传镜像到镜像服务时(Upload the image to the Image Service)提示如标题所示的错误:Request returned failure status. HTTPInternalServerError (HTTP 500).
解决方法:(参见16.Source the admin credentials to gain access to admin-only CLI commands:
$ source admin-openrc.sh)后重启glance-registry和glance-api两个服务,即在命令行输入 service glance-registry restart和service glance-api restart 运行,问题迎刃而解!原因是重启Linux(ubuntu),导致以上两个服务被关闭。其实这只是一个低级错误,有很多人也遇到过这个错误。)
18.查询映像以确认数据是否正确
$ glance image-list
19.删除临时目录
$ rm -r /tmp/images
查找文件位置:locate 文件名
例:locate cirros-0.3.3-x86_64-disk.img
阅读全文
1 0
- openstack镜像服务(glance)
- 探索 OpenStack 之(10):深入镜像服务Glance
- OpenStack 镜像服务Glance [三]
- OpenStack-M版(Mitaka)搭建基于(Centos7.2)+++四、Openstack镜像服务(glance)
- Openstack 命令行管理之glance镜像服务
- Openstack API管理之glance镜像服务
- OpenStack Newton版本部署 ---- 镜像服务(glance)
- OpenStack实践系列③镜像服务Glance
- openstack glance 上传镜像
- OpenStack-M版(Mitaka)搭建- – -镜像服务(Glance)篇
- OpenStack Ocata 安装(三)安装镜像(Glance)服务
- Openstack之glance镜像组件介绍
- Centos7手动部署Openstack Mitaka版安装配置--(四)安装镜像服务glance
- Glance镜像服务安装配置
- OpenStack入门以及一些资料之(五、Glance镜像)
- openstack安装部署4——Glance镜像安装(仅部署在控制节点)
- openstack Glance的镜像缓存机制介绍
- openstack学习笔记 --- glance 客户端管理镜像image
- 条件编译#define、#undef、#if、#elif、#elif defined、#elif !defined 、#endif用法
- 关于Unity图形渲染的性能优化
- Android View的事件分发机制和滑动冲突解决方案
- windows 8 安装oracle 12c dbca创建数据库报错创建服务出错
- 网络编程之socket
- openstack镜像服务(glance)
- keras系列︱迁移学习:利用InceptionV3进行fine-tuning及预测、完美案例(五)
- cocos 3.10 new 一个 listview 不能直接调用jumpToBottom
- Linux下安装任意版本的tensorflow命令
- 关于Android硬件加速技术分析
- 多叉树求最优解问题
- SQLGetInstalledDrivers 获取ODBC已经安装的驱动列表
- Ubuntu 安装 HomeBrew
- Redis及Sentinel配置详解