LVM as cinder's drivers

安装配置LVM为cinder的driver(后端储存).

  • 使用lvm作为cinder driver,假设磁盘为/dev/sdb;

1.1 安装

# Install the LVM packages
yum install lvm2 device-mapper-persistent-data
systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service
pvcreate /dev/sdb
# Create the cinder-volumes
vgcreate cinder-volumes /dev/sdb

1.2 配置

让它只扫描包含cinder-volume卷组的设备,防止cinder和系统相互干扰:

vim /etc/lvm/lvm.conf
# 在devices部分添加一个过滤器,只接受``/dev/sdb``设备,拒绝其他所有设备
devices {
...
filter = [ "a/sdb/", "r/.*/"]

yum install openstack-cinder targetcli python-keystone

openstack-config --set /etc/cinder/cinder.conf DEFAULT glance_api_servers http://controller:9292
openstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT transport_url rabbit://openstack:RABBIT_PASS@controller
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
# Comment out or remove any other options in the [keystone_authtoken] section
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken www_authenticate_uri http://controller:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_url http://controller:5000
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken memcached_servers controller:11211
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken auth_type password
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_domain_id default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_id default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken project_name service
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken username cinder
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken password CINDER_PASS
# management network ip on storage node
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 172.17.2.201
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp
# 针对lvm backend进行配置
openstack-config --set /etc/cinder/cinder.conf lvm volume_driver cinder.volume.drivers.lvm.LVMVolumeDriver
openstack-config --set /etc/cinder/cinder.conf lvm volume_group cinder-volumes
openstack-config --set /etc/cinder/cinder.conf lvm iscsi_protocol iscsi
openstack-config --set /etc/cinder/cinder.conf lvm iscsi_helper lioadm
openstack-config --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm

systemctl enable openstack-cinder-volume.service target.service
systemctl restart openstack-cinder-volume.service target.service

在控制节点上执行:

. admin-openrc
# 列出服务组件以验证是否每个进程都成功启动
cinder service-list
  • virtualization/openstack/cinder/cinder_lvm.txt
  • 最后更改: 2019/04/16 18:31
  • (外部编辑)