涛子 - 简单就是美

成单纯魁增,永继振国兴,克复宗清政,广开家必升

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

* 参考
https://hub.fastgit.org/feralcoder/shared/wiki/IT%3A-HOWTO%3A-Install-Ceph

cinder-lvm后端

建立物理卷及卷组cinder-volumes
pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb
修改kolla-ansible全局配置
vi /etc/kola/globals.yml
......
enable_cinder: "yes"
enable_cinder_backend_iscsi: "yes"
enable_cinder_backend_lvm:: "yes"
cinder_volume_group: "cinder-volumes" #此处创建的vg名称
......
部署
kolla-ansible deploy -i multinode -t haproxy,cinder,iscsi,horizon

cinder-ceph后端

存储节点&计算节点安装ceph客户端软件
yum install -y ceph-common
建立ceph池
ceph osd pool create images 32 32
ceph osd pool create volumes 32 32
ceph osd pool create backups 32 32
ceph osd pool create vms 32 32
ceph osd pool ls
建立ceph用户分配权限
ceph auth list
ceph auth get client.admin

# glance
ceph auth get-or-create client.glance mon 'allow r' osd 'allow class-read object_prefix rdb_children, allow rwx pool=images' -o ~/ceph.client.glance.keyring
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.glance -o ~/ceph.client.glance.keyring

# cinder
ceph auth get-or-create client.cinder mon 'allow r' osd 'allow class-read object_prefix rdb_children, allow rwx pool=volumes' -o ~/ceph.client.cinder.keyring
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 -o ~/ceph.client.cinder.keyring

# cinder-backup
ceph auth get-or-create client.cinder-backup mon 'allow r' osd 'allow class-read object_prefix rdb_children, allow rwx pool=backups' -o ~/ceph.client.cinder-backup.keyring
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.cinder-backup -o ~/ceph.client.cinder-backup.keyring

# nova
ceph auth get-or-create client.nova mon 'allow r' osd 'allow class-read object_prefix rdb_children, allow rwx pool=vms' -o /etc/ceph/ceph.client.nova.keyring
ceph auth get-or-create client.nova 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.nova -o /etc/ceph/ceph.client.nova.keyring
修改kolla-ansible全局配置
vi /etc/kola/globals.yml
......
enable_ceph: "no"

enable_cinder: "yes"
enable_grafana: "yes"
 
glance_backend_ceph: "yes"
cinder_backend_ceph: "yes"
nova_backend_ceph: "yes"

ceph_nova_keyring: "ceph.client.nova.keyring"
......
deploy配置文件
mkdir -p /etc/kolla/config/{glance,cinder/cinder-volume,cinder/cinder-backup,nova}

# glance
cat > /etc/kolla/config/glance/glance-api.conf <<EOF
[glance_store]
stores = rbd
default_store = rbd
rbd_store_pool = images
rbd_store_user = glance
rbd_store_ceph_conf = /etc/ceph/ceph.conf

show_image_direct_url = True

[paste_deploy]
flavor = keystone
EOF

scp vm-201:/root/ceph.client.glance.keyring /etc/kolla/config/glance

# cinder
scp vm-201:/root/ceph.client.cinder-backup.keyring /etc/kolla/config/cinder/cinder-backup
scp vm-201:/root/ceph.client.cinder.keyring /etc/kolla/config/cinder/cinder-backup
scp vm-201:/root/ceph.client.cinder.keyring /etc/kolla/config/cinder/cinder-volume

cat > /etc/kolla/config/cinder/cinder-backup.conf <<EOF
[DEFAULT]
backup_ceph_conf=/etc/ceph/ceph.conf
backup_ceph_user=cinder-backup
backup_ceph_chunk_size = 134217728
backup_ceph_pool=backups
backup_driver = cinder.backup.drivers.ceph.CephBackupDriver
backup_ceph_stripe_unit = 0
backup_ceph_stripe_count = 0
restore_discard_excess_bytes = true
EOF

cat > /etc/kolla/config/cinder/cinder-volume.conf <<EOF
[DEFAULT]
enabled_backends=rbd-1

[rbd-1]
rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=cinder
backend_host=rbd:volumes
rbd_pool=volumes
volume_backend_name=rbd-1
volume_driver=cinder.volume.drivers.rbd.RBDDriver
rbd_secret_uuid = {{ cinder_rbd_secret_uuid }}
rados_connect_timeout = -1
EOF

# nova
scp vm-201:/root/ceph.client.cinder.keyring /etc/kolla/config/nova
scp vm-201:/root/ceph.client.nova.keyring /etc/kolla/config/nova

cat > /etc/kolla/config/nova/nova-compute.conf << EOF
[libvirt]
images_rbd_pool=vms
images_type=rbd
images_rbd_ceph_conf=/etc/ceph/ceph.conf
rbd_user=nova
EOF

# ceph
scp vm-201:/etc/ceph/ceph.conf /etc/kolla/config/glance
scp vm-201:/etc/ceph/ceph.conf /etc/kolla/config/cinder
scp vm-201:/etc/ceph/ceph.conf /etc/kolla/config/nova
EOF
部署
kolla-ansible -i multinode deploy 
查看

openstack volume service list

Binary Host Zone Status State Updated At
cinder-scheduler vm-211 nova enabled up 2021-10-08T09:29:51.000000
cinder-scheduler vm-212 nova enabled up 2021-10-08T09:29:50.000000
cinder-scheduler vm-213 nova enabled up 2021-10-08T09:29:51.000000
cinder-volume vm-218@lvm-1 nova enabled down 2021-10-08T08:15:36.000000
cinder-volume vm-219@lvm-1 nova enabled down 2021-10-08T08:15:43.000000
cinder-backup vm-219 nova enabled up 2021-10-08T09:29:56.000000
cinder-backup vm-218 nova enabled up 2021-10-08T09:29:55.000000
cinder-volume rbd:volumes@rbd-1 nova enabled up 2021-10-08T09:29:57.000000
posted on 2021-10-08 13:54  北京涛子  阅读(265)  评论(0编辑  收藏  举报