1、安装LVM软件并启动服务
yum install lvm2 device-mapper-persistent-data -y
systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service
2、增加一块硬盘(资源原因我只新增了一个10G的硬盘)
在VMware workstation右键点击虚拟机--点击设置
添加之后需要刷新一下磁盘,先看一下当前的磁盘情况
执行刷新命令:
echo ‘- - -‘ > /sys/class/scsi_host/host0/scan #如果刷新完看不到新增的磁盘就多刷新几次
3、创建物理卷和卷组
pvcreate /dev/sdb
vgcreate cinder-volumes /dev/sdb
4、修改配置文件/etc/lvm/lvm.conf:
devices {
...
filter = [ "a/sdb/", "r/.*/"] #将130行修改为131行所示内容
5、安装配置组件
yum install openstack-cinder targetcli python-keystone -y
修改配置文件 /etc/cinder/cinder.conf:
[database]
# ...
connection = mysql+pymysql://cinder:CINDER_DBPASS@controller/cinder
[DEFAULT]
# ...
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
my_ip = 10.150.165.102
enabled_backends = lvm
glance_api_servers = http://controller:9292
[keystone_authtoken]
# ...
www_authenticate_uri = http://controller:5000
auth_url = http://controller:5000
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = CINDER_PASS
[lvm]
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volume_group = cinder-volumes
target_protocol = iscsi
target_helper = lioadm
volume_backend_name = volume1
[oslo_concurrency]
# ...
lock_path = /var/lib/cinder/tmp
6、启动服务并设置开机自启动
systemctl enable openstack-cinder-volume.service target.service
systemctl start openstack-cinder-volume.service target.service
7、验证
cinder service-list #控制节点执行
看一下当前的控制台页面
刷新页面重新登陆,多出了卷的相关信息:
8、创建卷并给实例提供使用
在存储节点(计算节点)查看一下:
连接实例:
进入personal-server1这个实例看一下
格式化、挂载并使用:
OpenStack Train版操作笔记(13) --- 安装cinder块存储服务(存储节点)
原文:https://blog.51cto.com/11954248/2502595