apt -y install cinder-volume python3-mysqldb python3-rtslib-fb
# 配置文件
mv /etc/cinder/cinder.conf /etc/cinder/cinder.conf.org # 备份官方
vi /etc/cinder/cinder.conf
# 修改如下
# create new
[DEFAULT]
debug = True # 打开调试功能
# admin project_id and user_id,根据自己的实际情况修改,作用为镜像缓存功能,提升性能
# openstack project list
cinder_internal_tenant_project_id = 9dd9ec3cf67b4e749fef7ad50ac8de39
# openstack user list
cinder_internal_tenant_user_id = 9dd9ec3cf67b4e749fef7ad50ac8de39
# define own IP address
my_ip = 192.168.222.25 # API IP
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
state_path = /var/lib/cinder
auth_strategy = keystone
# RabbitMQ connection info
transport_url = rabbit://openstack:password@192.168.222.29
enable_v3_api = True
# Glance connection info
glance_api_servers = http://192.168.220.29:9292 # 这里配置存储网的IP,下载镜像到本地
enabled_backends = lvm
# wipe data better method
volume_clear = zero
volume_clear_size = 100
#volume_clear_ionice = -c3
# MariaDB connection info
[database]
connection = mysql+pymysql://cinder:password@192.168.222.29/cinder
# Keystone auth info
[keystone_authtoken]
www_authenticate_uri = http://192.168.222.29:5000
auth_url = http://192.168.222.29:5000
memcached_servers = 192.168.222.29:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = servicepassword[oslo_concurrency]
lock_path = $state_path/tmp[lvm]
target_helper = tgtadm
target_protocol = iscsi
# IP address of Storage Node,include storage network
target_ip_address = 192.168.220.25 # 这里修改为存储网IP
# volume group name just created
volume_group = cinder-volumes
volume_backend_name = raid_sata
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir = $state_path/volumes
# add image-volume cache
image_volume_cache_enabled = True
image_volume_cache_max_size_gb = 100
image_volume_cache_max_count = 50# 修改文件权限
chmod 644 /etc/cinder/cinder.conf
chown root:cinder /etc/cinder/cinder.conf
# 重启服务
systemctl restart cinder-volume # 服务开机机自启动
# 编辑配置文件
/etc/lvm/lvm.conf
# 修改如下
filter = [ "a/sdc/", "a/sde/", "r/.*/"] # 过滤,,只用sdc磁盘
# 这里的sdc是用raid卡做的一块7TB的磁盘
pvcreate /dev/sdc /dev/sde # 加入物理磁盘
vgcreate cinder-volumes /dev/sdc /dev/sde # 创建cinder-volumes卷
apt -y install tgt thin-provisioning-tools # 带存储卷的精简功能
3、在控制节点上验证
openstack volume service list