############ yum install lvm2 -y systemctl enable lvm2-lvmetad.service systemctl restart lvm2-lvmetad.service yes |pvcreate /dev/sdb yes |vgcreate vg_sdb /dev/sdb \cp -f /etc/lvm/lvm.conf{,.bak} ####如果系统是lvm分区 sda sed -i ‘/devices {/ a filter = [ "a/sda/","a/sdb/", "r/.*/"]‘ /etc/lvm/lvm.conf grep ‘devices {‘ -C 3 /etc/lvm/lvm.conf ## yum install openstack-cinder targetcli python-oslo-policy -y systemctl enable openstack-cinder-volume.service target.service systemctl restart openstack-cinder-volume.service target.service echo " [lvm] volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver volume_group = vg_sdb iscsi_protocol = iscsi iscsi_helper = lioadm volume_backend_name = lvm " >>/etc/cinder/cinder.conf tail /etc/cinder/cinder.conf [ $(grep -c ‘^enabled_backends‘ /etc/cinder/cinder.conf) -eq 0 ] && sed -i ‘s/\[DEFAULT\]/ a enabled_backends=lvm/g‘ /etc/cinder/cinder.conf || sed -i ‘s/^enabled_backends.*=/enabled_backends=lvm,/g‘ /etc/cinder/cinder.conf grep enabled_backends /etc/cinder/cinder.conf systemctl enable openstack-cinder-volume.service target.service
原文地址:https://www.cnblogs.com/blog-lhong/p/11765422.html
时间: 2024-11-12 19:12:26