ceph对接openstack

Openstack对接环境准备
使用packstack一键部署openstack

在icmp-host-prohibited前添加两条规则
-A INPUT -p tcp -m multiport –dports 6789 -j ACCEPT
-A INPUT -p tcp -m multiport –dports 6789:6800 -j ACCEPT

创建4个pool并初始化

Ceph osd pool create volumes 16 16
Ceph osd pool create images 16 16
Ceph osd pool create vms 16 16
Ceph osd pool create backups 16 16
Rbd pool init volumes
Rbd pool init images
Rbd pool init backups
Rbd pool init vms

在其他节点安装python-rbd和ceph-common
创建账号

Ceph auth get-or-create client.glance mon ‘profile rbd’ osd ‘profile rbd pool=images’ mgr ‘profile rbd pool=images’
Ceph auth get-or-create client.cinder mon ‘profile rbd’ osd ‘profile rbd pool=volumes,profile rbd pool=vms,profile rbd-read-only pool=images’ mgr ‘profile rbd pool=volumes,profile rbd pool=vms’
Ceph auth get-or-create client.cinder-backup mon ‘profile rbd’ osd ‘profile rbd pool=backups’ mgr ‘profile rbd pool=backups’

生成配置文件,拷贝到对应的节点

Ceph auth get-or-create client.glance|tee /etc/ceph/ceph.client.glance.keyring
Ceph auth get-or-create client.cinder|tee /etc/ceph/ceph.client.cinder.keyring
Ceph auth get-or-create client.cinder-backup|tee /etc/ceph/ceph.client. cinder-backup.keyring

生成cinder的key
Vim secret.xml,使用uuid生成
在这里插入图片描述

Virsh secret-define –file secret.xml
Virsh secret-list
Ceph auth list 查看cinder key
Virsh secret-set-value –secret b60….64e –base64 <cinder key> //设定secrete
Virsh secret-get-value b60…64e

Ceph对接glance

Vi /etc/glance/glance-api.conf
[glance_store]
Stores = file,http,swift,rbd
Default_store = rbd
Rbd_store_pool = images
Rb_store_user = glance
Rbd_store_ceph_conf = /etc/ceph/ceph.conf
Rbd_store_chunk_size = 8
Show_image_url = True
#filesystem_store_datadir=/var/lib/glance/images
重启openstack-glance-api.service
Source keystonerc_admin
Cd /var/lib/glance/images
Glance image-create –name ceph-test –disk-format raw –container-format bare –file /var/lib/glance/images/d227…d72 –progress //上传镜像
Glance image list
Rbd -p images ls
Rbd snap list images/914..c1e

Ceph对接cinder

Vi /etc/cinder/cinder.conf
Enabled_backend=ceph
Glance_api_version = 2

在这里插入图片描述

启动openstack-cinder-volume

Cinder type-create ceph
Cinder type-key 8a…f3 set volume_backend_name=ceph

创建云硬盘,快照
Ceph与cinder-backup对接
Vi /etc/cinder/cinder.conf
添加配置,重启openstack-cinder-backup
在这里插入图片描述

Cinder list
Cinder backup-create 2c…e2 –name backup-demo //创建备份
Cinder backup-list
Cinder backup-show id 

Ceph对接nova

Vi /etc/nova/nova.conf
Virt_type=kvm

在这里插入图片描述

重启openstack-nova-compute

wget http://download.cirros-cloud.net/0.5.1/cirros-0.5.1-x86_64-disk.img
qemu-img convert -f qcow2 -O raw cirros-0.5.1-x86_64-disk.img cirros-0.5.1-x86_64-disk.img.raw
glance image-create --name image-test --disk-format raw --container-format bare --file /root/ cirros-0.5.1-x86_64-disk.img.raw —progress
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值