本文主要是介绍12 龙芯平台openstack部署搭建-cinder部署,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
#storage node (没有存储节点,使用controller上的存储 )
#在选定磁盘上创建一个lvm的分区
fdisk /dev/sba
fdisk -l
#Disk /dev/sda
#设备 起点 末尾 扇区 大小 类型
#/dev/sda1 2048 3400000000 3399997953 1.6T Linux 文件系统
#/dev/sda2 3400001536 7812939742 4412938207 2.1T Linux LVM
yum install -y lvm2 device-mapper-persistent-data
systemctl enable lvm2-lvmetad.service
systemctl start lvm2-lvmetad.service
#Create the LVM physical volume /dev/sda2:
pvcreate /dev/sda2
#Create the LVM volume group cinder-volumes
vgcreate cinder-volumes /dev/sda2
#编辑文件/etc/lvm/lvm.conf
#in the devices section, add a filter that accepts the /dev/sda2 device and rejects all other devices:
devices {
…
filter = [ “a/sda2/”, “r/.*/”]
yum install -y openstack-cinder targetcli
mysql -uroot -ploongson -e ‘CREATE DATABASE cinder;’
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder’@‘localhost’ IDENTIFIED BY ‘loongson’;”
mysql -uroot -ploongson -e “GRANT ALL PRIVILEGES ON cinder.* TO ‘cinder’@‘%’ IDENTIFIED BY ‘loongson’;”
#创建一个 cinder 用户
openstack user create --domain default --password-prompt cinder
#添加 admin 角色到 cinder 用户上
openstack role add --project service --user cinder admin
#创建 cinderv2 和 cinderv3 服务实体:
openstack service create --name cinderv2 --description “OpenStack Block Storage” volumev2
openstack service create --name cinderv3 --description “OpenStack Block Storage” volumev3
#创建块设备存储服务的 API 入口点:
openstack endpoint create --region RegionOne volumev2 public http://controller:8776/v2/%(project_id)s
openstack endpoint create --region RegionOne volumev2 internal http://controller:8776/v2/%(project_id)s
openstack endpoint create --region RegionOne volumev2 admin http://controller:8776/v2/%(project_id)s
openstack endpoint create --region RegionOne volumev3 public http://controller:8776/v3/%(project_id)s
openstack endpoint create --region RegionOne volumev3 internal http://controller:8776/v3/%(project_id)s
openstack endpoint create --region RegionOne volumev3 admin http://controller:8776/v3/%(project_id)s
#配置/etc/cinder/cinder.conf
cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
openstack-config --set /etc/cinder/cinder.conf database connection mysql+pymysql://cinder:loongson@controller/cinder
openstack-config --set /etc/cinder/cinder.conf DEFAULT transport_url rabbit://guest:loongson@controller
openstack-config --set /etc/cinder/cinder.conf DEFAULT auth_strategy keystone
openstack-config --set /etc/cinder/cinder.conf DEFAULT my_ip 10.40.65.188
openstack-config --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm
openstack-config --set /etc/cinder/cinder.conf DEFAULT glance_api_servers http://controller:9292
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_name default
openstack-config --set /etc/cinder/cinder.conf keystone_authtoken user_domain_name 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 loongson
openstack-config --set /etc/cinder/cinder.conf oslo_concurrency lock_path /var/lib/cinder/tmp
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 target_protocol iscsi
openstack-config --set /etc/cinder/cinder.conf lvm target_helper lioadm
openstack-config --set /etc/cinder/cinder.conf lvm volume_backend_name LVM
#Populate the Block Storage database
su -s /bin/sh -c “cinder-manage db sync” cinder
#配置计算节点以使用块设备存储
openstack-config --set /etc/nova/nova.conf cinder os_region_name RegionOne
#重启计算API服务
systemctl restart openstack-nova-api.service
systemctl enable openstack-cinder-volume.service target.service openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl restart openstack-cinder-volume.service target.service openstack-cinder-api.service openstack-cinder-scheduler.service
systemctl status openstack-cinder-volume.service target.service openstack-cinder-api.service openstack-cinder-scheduler.service
#创建一个volume type并关联到volume_backend_name
cinder type-create LVM
cinder type-key LVM set volume_backend_name=LVM
cinder extra-specs-list
±-------------------------------------±------------±-------------------------------+
| ID | Name | extra_specs |
±-------------------------------------±------------±-------------------------------+
| 17fcfe8d-e863-4133-aa84-3f05ed031bb2 | DEFAULT | {} |
| ff4e854b-e17a-42e1-b202-4b15148dbc14 | LVM | {‘volume_backend_name’: ‘LVM’} |
±-------------------------------------±------------±-------------------------------+
参考链接:
官方文档
https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/cinder-controller-install.html
这篇关于12 龙芯平台openstack部署搭建-cinder部署的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!