Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and deployment of cinder Block Storage Service

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Brief introduction

Cinder block storage is an essential component of virtual infrastructure and the basis for storing virtual machine mirror files and data used by virtual machines. Cinder provides management support for block storage and presents back-end connectivity to the computing layer (Nova) by using iSCSI, fibre Channel or NFS protocols, as well as several proprietary protocols.

The Cinder interface provides standard features that allow you to create and attach block devices to virtual machines, such as "create volumes", "delete volumes" and "attach volumes". There are more advanced features that support the ability to expand capacity, snapshots and create virtual machine mirror clones.

Cinder is added to the existing openstack environment as a hook.

The cinder block storage service requires at least one additional storage node that provides volumes for the instance.

In this experiment, we set up a special storage node and use a blank disk (/ dev/sdb) on it to provide a data disk to the instance in the form of a volume.

Install the centos system of the storage node, configure IP and hostname, edit the hosts file to join the host parsing and so on.

The ip address of the storage node's management network is 192.168.10.44 and the hostname is b1.

Install and configure the controller node

Create a database

Mysql-u root-p

Create a cinder database

MariaDB [(none)] > CREATE DATABASE cinder

Grant appropriate access to the cinder database

MariaDB [(none)] > GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY' CINDER_DBPASS'

MariaDB [(none)] > GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY' CINDER_DBPASS'

MariaDB [(none)] > exit

Create service credential

. Admin-openrc

Create a cinder user

Openstack user create-domain default-password CINDER_PASS cinder

Add admin roles to cinder users

Openstack role add-project service-user cinder admin

Create cinderv2 and cinderv3 service entities

Openstack service create-name cinderv2-description "OpenStack Block Storage" volumev2

Openstack service create-name cinderv3-description "OpenStack Block Storage" volumev3

Create a block storage service API endpoint

Openstack endpoint create-- region RegionOne volumev2 public http://ct:8776/v2/%(project_id)s

Openstack endpoint create-- region RegionOne volumev2 internal http://ct:8776/v2/%(project_id)s

Openstack endpoint create-- region RegionOne volumev2 admin http://ct:8776/v2/%(project_id)s

Openstack endpoint create-- region RegionOne volumev3 public http://ct:8776/v3/%(project_id)s

Openstack endpoint create-- region RegionOne volumev3 internal http://ct:8776/v3/%(project_id)s

Openstack endpoint create-- region RegionOne volumev3 admin http://ct:8776/v3/%(project_id)s

Install the package

Yum install openstack-cinder

Cp / etc/cinder/cinder.conf / etc/cinder/cinder.conf.bak

Grep-Ev'# | ^ $'/ etc/cinder/cinder.conf.bak > / etc/cinder/cinder.conf

Vim / etc/cinder/cinder.conf

[database]

Connection = mysql+pymysql://cinder:CINDER_DBPASS@ct/cinder

[DEFAULT]

Transport_url = rabbit://openstack:RABBIT_PASS@ct

Auth_strategy = keystone

My_ip = 192.168.10.41

[keystone_authtoken]

Www_authenticate_uri = http://ct:5000

Auth_url = http://ct:5000

Memcached_servers = ct:11211

Auth_type = password

Project_domain_name = default

User_domain_name = default

Project_name = service

Username = cinder

Password = CINDER_PASS

[oslo_concurrency]

Lock_path = / var/lib/cinder/tmp

Fill block storage database

Su-s / bin/sh-c "cinder-manage db sync" cinder

Configure calculations to use block storage

Vim / etc/nova/nova.conf

[oslo_concurrency]

Os_region_name = RegionOne

Restart the Compute API service

Systemctl restart openstack-nova-api.service

Start the block storage service and configure it to start when the system starts

Systemctl enable openstack-cinder-api.service openstack-cinder-scheduler.service

Systemctl start openstack-cinder-api.service openstack-cinder-scheduler.service

Install and configure storage nodes

The ip address of the storage node's management network is 192.168.10.44

Install the LVM package

Yum install lvm2 device-mapper-persistent-data

Start the LVM metadata service and configure it to start at system boot

Systemctl enable lvm2-lvmetad.service

Systemctl start lvm2-lvmetad.service

Create LVM physical volume / dev/sdb

Pvcreate / dev/sdb

Create LVM volume group cinder-volumes

Vgcreate cinder-volumes / dev/sdb

Reconfigure LVM to scan only devices that contain cinder-volumes volume groups

Vim / etc/lvm/lvm.conf

In the devices section, add a filter that accepts / dev/sdb devices and rejects all other devices:

Devices {

Filter = ["a/sdb/", "rswap. Steps /"]

An is used to accept, r is used to reject.

Install the package

Yum install centos-release-openstack-train-y

Yum upgrade-y

Yum install python-openstackclient-y

Yum install openstack-selinux-y

Yum install openstack-cinder targetcli python-keystone-y

Modify the configuration file

Cp / etc/cinder/cinder.conf / etc/cinder/cinder.conf.bak

Grep-Ev'# | ^ $'/ etc/cinder/cinder.conf.bak > / etc/cinder/cinder.conf

Vim / etc/cinder/cinder.conf

[database]

Connection = mysql+pymysql://cinder:CINDER_DBPASS@ct/cinder

[DEFAULT]

Transport_url = rabbit://openstack:RABBIT_PASS@ct

Auth_strategy = keystone

My_ip = 192.168.10.44

Enabled_backends = lvm

Glance_api_servers = http://ct:9292

[keystone_authtoken]

Www_authenticate_uri = http://ct:5000

Auth_url = http://ct:5000

Memcached_servers = ct: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

[oslo_concurrency]

Lock_path = / var/lib/cinder/tmp

Start the Block Storage Volume service and its associated, and configure it to start when the system starts:

Systemctl enable openstack-cinder-volume.service target.service

Systemctl start openstack-cinder-volume.service target.service

Verify the cinder block storage service

. Admin-openrc

Openstack volume service list

Provide a data disk to an instance using block storage service

Create a volume (volume)

. Ygj-openrc

Create a volume of 10 GB:

Openstack volume create-size 10 volume1

After a short period of time, the volume status should go from creating to available

Openstack volume list

Attach a volume to an instance

Openstack server add volume INSTANCE_NAME VOLUME_NAME

Attach the volume1 volume to the centos7-instance1 instance:

Openstack server add volume centos7-instance1 volume1

Openstack volume list

Use SSH to access the instance and use the following fdisk command to verify that the volume is a / dev/vdb block storage device:

Sudo fdisk-l

Partition and format the newly added / dev/vdb

Fdisk / dev/vdb

Mk2fs.ext4 / dev/vdb1

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report