创建对应的pool:

ceph osd pool create volumes 512
ceph osd pool create images 512
ceph osd pool create vms 512

安装各个节点需要的组件:

在Controller节点安装ceph管理接口:

sudo apt-get install python-ceph libvirt-bin

在Glance节点安装python-rbd:

sudo apt-get install python-rbd 

在Cinder-volume节点和Nova-compute节点安装ceph-common:

sudo apt-get install ceph-common

复制Ceph配置文件到各个节点

Glance节点、Cinder-volume节点和Nova-compute节点:

ssh (your-openstack-server-node) sudo tee /etc/ceph/ceph.conf </etc/ceph/ceph.conf

创建CephX认证授权用户:

ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms, allow rx pool=images'
ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images'

复制秘钥

把密钥环复制到Glance节点、Cinder-volume节点、Nova-compute节点以及Cinder-Backup节点并且授权:

ceph auth get-or-create client.glance | ssh {your-glance-api-server} sudo tee /etc/ceph/ceph.client.glance.keyring
ssh {your-glance-api-server} sudo chown glance:glance /etc/ceph/ceph.client.glance.keyring
ceph auth get-or-create client.cinder | ssh {your-volume-server} sudo tee /etc/ceph/ceph.client.cinder.keyring
ssh {your-cinder-volume-server} sudo chown cinder:cinder /etc/ceph/ceph.client.cinder.keyring
ceph auth get-or-create client.cinder | ssh {your-nova-compute-server} sudo tee /etc/ceph/ceph.client.cinder.keyring
#还得把 client.cinder 用户的密钥存进 libvirt,libvirt 进程从 Cinder 挂载块设备时要用它访问集群
ceph auth get-key client.cinder | ssh {your-compute-node} tee client.cinder.key

配置Glance节点

在glance-api配置文件中修改以下内容:

[glance_store]
default_store = rbd
show_image_direct_url = True
stores = rbd
rbd_store_pool = images
rbd_store_user =  glance
ceph_conf = /etc/ceph/ceph.conf
rbd_store_chunk_size = 8

配置cinder-volume节点

添加以下内容:

[DEFAULT]
enabled_backends = ceph
[ceph]
volume_driver = cinder.volume.drivers.rbd.RBDDriver
rbd_pool = volumes
rbd_ceph_conf = /etc/ceph/ceph.conf
rbd_flatten_volume_from_snapshot = false
rbd_max_clone_depth = 5
rbd_store_chunk_size = 4
rados_connect_timeout = -1
glance_api_version = 2
rbd_user = cinder
rbd_secret_uuid = 457eb676-33da-42ec-9a8c-9293d545c337

配置nova-compute节点

创建secret.xml并且把密钥注入到Libvirt里面:

cat > secret.xml <<EOF
<secret ephemeral='no' private='no'>
  <uuid>457eb676-33da-42ec-9a8c-9293d545c337</uuid>
  <usage type='ceph'>
    <name>client.cinder secret</name>
  </usage>
</secret>
EOF
sudo virsh secret-define --file secret.xml
sudo virsh secret-set-value --secret 457eb676-33da-42ec-9a8c-9293d545c337 --base64 $(cat client.cinder.key)
rm client.cinder.key secret.xml

编辑nova-compute配置文件

添加以下内容:

[libvirt]
images_type= rbd
images_rbd_pool= vms
images_rbd_ceph_conf= /etc/ceph/ceph.conf
rbd_user= cinder
rbd_secret_uuid= 457eb676-33da-42ec-9a8c-9293d545c337
inject_password = false
inject_key = false
inject_partition = -2
block_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_LIVE, VIR_MIGRATE_TUNNELLED, VIR_MIGRATE_NON_SHARED_INC, VIR_MIGRATE_PERSIST_DEST
live_migration_bandwidth = 0
live_migration_flag = VIR_MIGRATE_UNDEFINE_SOURCE, VIR_MIGRATE_PEER2PEER, VIR_MIGRATE_LIVE, VIR_MIGRATE_TUNNELLED, VIR_MIGRATE_PERSIST_DEST, VIR_MIGRATE_PERSIST_DEST
libvirt_live_migration_flag="VIR_MIGRATE_UNDEFINE_SOURCE,VIR_MIGRATE_PEER2PEER,VIR_MIGRATE_LIVE,VIR_MIGRATE_PERSIST_DEST"
live_migration_uri = qemu+tcp://%s/system
hw_disk_discard = unmap
disk_cachemodes = "network=writeback"
cpu_mode = host-passthrough

重启服务

sudo service glance-api restart
sudo service nova-compute restart
sudo service cinder-volume restart

ceph 接入OpenStack的更多相关文章

  1. “CEPH浅析”系列之六——CEPH与OPENSTACK

    在 <"Ceph浅析"系列之二--Ceph概况>中即已提到,关注Ceph的原因之一,就是OpenStack社区对于Ceph的重视.因此,本文将对Ceph在OpenSta ...

  2. Ceph在OpenStack中的地位

    对Ceph在OpenStack中的价值进行简要介绍,并且对Ceph和Swift进行对比. 对于一个IaaS系统,涉及到存储的部分主要是块存储服务模块.对象存储服务模块.镜像管理模块和计算服务模块.具体 ...

  3. Ceph与OpenStack整合(仅为云主机提供云盘功能)

    1. Ceph与OpenStack整合(仅为云主机提供云盘功能) 创建: linhaifeng,最新修改: 大约1分钟以前 ceph ceph osd pool create volumes 128 ...

  4. ceph对接openstack环境(4)

    ceph对接openstack环境 环境准备: 保证openstack节点的hosts文件里有ceph集群的各个主机名,也要保证ceph集群节点有openstack节点的各个主机名 一.使用rbd方式 ...

  5. VMware 接入 Openstack — 使用 Openstack 创建 vCenter 虚拟机

    目录 目录 软件环境 前言 Openstack 接口驱动 使用 KVM 在 Compute Node 上创建虚拟机的流程 使用 VCDirver 在 vCenter 上创建虚拟机的流程 配置 vCen ...

  6. The Dos and Don'ts for Ceph for OpenStack

    Ceph和OpenStack是一个非常有用和非常受欢迎的组合. 不过,部署Ceph / OpenStack经常会有一些容易避免的缺点 - 我们将帮助你解决它们 使用 show_image_direct ...

  7. ceph与openstack对接

    对接分为三种,也就是存储为openstack提供的三类功能1.云盘,就好比我们新加的硬盘2.原本的镜像也放在ceph里,但是我没有选择这种方式,原因是因为后期有要求,但是我会把这个也写出来,大家自己对 ...

  8. Ceph与OpenStack的Nova相结合

    https://ervikrant06.wordpress.com/2015/10/24/how-to-configure-ceph-as-nova-compute-backend/ 在Ceph的ad ...

  9. Ceph与OpenStack的Glance相结合

    http://docs.ceph.com/docs/master/rbd/rbd-openstack/?highlight=nova#kilo 在Ceoh的admin-node上进行如下操作: 1. ...

随机推荐

  1. Spring Boot-IntelliJ IDEA搭建SpringBoot

    点击create new project 点击next 这里基本都已经自动生成了,简单介绍下: Name:项目名称 Type:我们是Maven构建的,那么选择第一个Maven Project Pack ...

  2. golang testing 无法获取覆盖率问题

    https://segmentfault.com/q/1010000021142202

  3. 【SpringBoot】SpringBoot快速入门(一)

    SpringBoot介绍 Spring Boot使创建可运行的独立,生产级基于Spring的应用程序变得容易.对Spring平台和第三方库整合,这样就可以以最小的麻烦开始使用.大多数Spring Bo ...

  4. 查询、下载GWAS目录数据的R包(gwasrapidd)

    目前GWAS方向发了很多文献,但是并没有一个很完善的R包对这些文献的数据进行汇总. 接下来推荐的这个是最新发表的GWAS数据汇总R包​.看了一下功能齐全,但是数据不是收录的很齐全​. 下面具体讲一下. ...

  5. LeetCode_441. Arranging Coins

    441. Arranging Coins Easy You have a total of n coins that you want to form in a staircase shape, wh ...

  6. vue+element-ui+ajax实现一个表格的实例

    <!DOCTYPE html> <html> <head> <script src="js/jquery-3.2.1.js">< ...

  7. [LeetCode] 100. Same Tree 相同树

    Given two binary trees, write a function to check if they are the same or not. Two binary trees are ...

  8. 多线程、线程池、线程创建、Thread

    转载自https://www.cnblogs.com/jmsjh/p/7762034.html 多线程 1.1 多线程介绍 学习多线程之前,我们先要了解几个关于多线程有关的概念. 进程:进程指正在运行 ...

  9. IDEA下同时使用Git和svn

    使用Git时将文件改成Git,Svn时改成svn 修改项目下.idea目录的vcs.xml配置文件. <?xml version="1.0" encoding="U ...

  10. SpringBoot系列教程web篇之Freemaker环境搭建

    现在的开发现状比较流行前后端分离,使用springboot搭建一个提供rest接口的后端服务特别简单,引入spring-boot-starter-web依赖即可.那么在不分离的场景下,比如要开发一个后 ...