OpenStack 存储服务 Cinder存储节点部署LVM (十四)

部署在block(10.0.0.103)主机

一)配置lvm

1、安装lvm2软件包

yum install lvm2 -y

2、启动LVM的metadata服务并且设置该服务随系统启动

systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service

3、vmware增加一块20G硬盘,用于云主机硬盘

4.创建LVM 物理卷 /dev/sdb

pvcreate /dev/sdb

5.创建 LVM 卷组 cinder-volumes

vgcreate cinder-volumes /dev/sdb

6.编辑``/etc/lvm/lvm.conf``文件并完成下面的操作:

在devices部分,添加一个过滤器,只接受/dev/sdb设备,拒绝其他所有设备

devices {
filter = [ "a/sdb/", "r/.*/"]

  提示:每个过滤器组中的元素都以 a 开头,即为 accept,或以 r 开头,即为**reject**,并且包括一个设备名称的正则表达式规则。过滤器组必须以 r/.*/ 结束,过滤所有保留设备。

二).配置ciner

2.1 安装软件包

yum install openstack-cinder targetcli python-keystone -y

2.2 配置cinder.conf文件

vim /etc/cinder/cinder.conf

[DEFAULT]
transport_url = rabbit://openstack:redhat@controller
auth_strategy = keystone
my_ip = 10.0.0.103
enabled_backends = lvm
glance_api_servers = http://controller:9292
[database]
connection = mysql+pymysql://cinder:redhat@controller/cinder
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = Default
user_domain_name = Default
project_name = service
username = cinder
password = redhat
[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
iscsi_protocol = iscsi
iscsi_helper = lioadm

2.3 启动块存储卷服务及其依赖的服务,并将其配置为随系统启动

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

2.4 验证块设备存储服务的操作

# source  admin-openrc
# cinder service-list

2.5  创建云硬盘

 

原文地址:https://www.cnblogs.com/jimmy-xuli/p/8858240.html