美文网首页
基于kolla-ansible部署的openstack外接cep

基于kolla-ansible部署的openstack外接cep

作者: Dreams_13 | 来源:发表于2019-08-21 17:09 被阅读0次

    连接ceph

    openstack连接ceph主要是三个组件:glance,cinder,nova

    1 使用外接ceph意味着不需要通过kolla去部署ceph,因此需要在全局配置中关闭ceph组件;

    vi /etc/kolla/globals.yml
    
    enable_ceph: “no
    glance_backend_ceph: "yes"
    cinder_backend_ceph: "yes"
    nova_backend_ceph: "yes"
    

    2 创建ceph存储池并初始化

    ceph osd pool create volumes 128
    
    ceph osd pool create images 128
    
    ceph osd pool create compute 128
    
    #初始化
    rbd pool init volumes
    
    rbd pool init images
    
    rbd pool init compute
    

    3 创建ceph用户

    创建glance用户及权限

    ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=images' -o /etc/ceph/ceph.client.glance.keyring
    

    创建cinder用户及权限

    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' -o /etc/ceph/ceph.client.cinder.keyring
    

    创建nova用户及权限

    ceph auth get-or-create client.nova mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms ,allow rx pool=images' -o /etc/ceph/ceph.client.nova.keyring
    

    4 配置rbd后端

    在/etc/kolla下新建目录如下:

    /etc/kolla/config/glance

    /etc/kolla/config/cinder

    /etc/kolla/config/nova

    glance

    # 为glance-api.conf配置RBD后端
    vi /etc/kolla/config/glance/glance-api.conf
    
    [glance_store]
    stores = rbd
    default_store = rbd
    rbd_store_pool = images
    rbd_store_user = glance
    rbd_store_ceph_conf = /etc/ceph/ceph.conf
    

    cinder

    # 配置cinder-volume.conf
    vi /etc/kolla/config/cinder/cinder-volume.conf
    
    [DEFAULT]
    enabled_backends = ceph
    
    [ceph]
    rbd_ceph_conf = /etc/ceph/ceph.conf
    rbd_user = cinder
    rbd_pool = volumes
    volume_backend_name = ceph
    volume_driver = cinder.volume.drivers.rbd.RBDDriver
    rbd_secret_uuid = [96c625f8-9179-48fc-80b7-545aac434d10]
    glance_api_version = 2
    

    nova

    # 配置nova-compute.conf
    vi /etc/kolla/config/nova/nova-compute.conf
    
    [libvirt]
    images_rbd_pool = vms
    images_type = rbd
    images_rbd_ceph_conf = /etc/ceph/ceph.conf
    rbd_user = nova
    rbd_secret_uuid = [96c625f8-9179-48fc-80b7-545aac434d10]
    

    创建nova用户及权限

    ceph auth get-or-create client.nova mon 'allow r' osd 'allow class-read object_prefix rbd_children, allow rwx pool=volumes, allow rwx pool=vms ,allow rx pool=images' -o /etc/ceph/ceph.client.nova.keyring
    

    5 拷贝ceph的配置文件

    cp /etc/ceph/ceph.conf /etc/kolla/config/glance/
    
    cp /etc/ceph/ceph.conf /etc/kolla/config/cinder/
    
    cp /etc/ceph/ceph.conf /etc/kolla/config/nova/
    
    cp /etc/ceph/ceph.clinet.cinder.keyring /etc/kolla/config/nova/
    

    将cinder的keyring文件拷贝到容器内部

    docker cp /etc/ceph/ceph.client.admin.keyring  cinder_volume:/etc/ceph/
    

    6 重新执行部署

    kolla-ansible -i all-in-one deploy
    

    相关文章

      网友评论

          本文标题:基于kolla-ansible部署的openstack外接cep

          本文链接:https://www.haomeiwen.com/subject/obeisctx.html