目次
全編目次
- 概要
- 必須編
- part01 - Environment
- part02 - Security
- part03 - Host networking
- part04 - Network Time Protocol (NTP)
- part05 - OpenStack packages
- part06 - SQL database
- part07 - Message queue
- part08 - Memcached
- part09 - Etcd
- part10 - Install OpenStack services
- part11 - Identity service (Keystone)
- part12 - Image service (Glance)
- part13 - Placement service (Placement)
- part14 - Compute service (Nova) - controller node
- part15 - Compute service (Nova) - compute node
- part16 - Networking service (Neutron) - controller node
- part17 - Networking service (Neutron) - compute node
- part18 - Launch an instance - Network Option 1
- part19 - Dashboard (Horizon)
- 応用編
- part20 - Networking service (Neutron) - controller node
- part21 - Networking service (Neutron) - compute node
- part22 - Launch an instance - Network Option 2
- part23 - Block Storage service (Cinder) - LVM backend ◀here now
- part24 - Block Storage service (Cinder) - NFS backend
- part25 - Launch an instance - Block Storage
Install and configure controller node / Install and configure a storage nodes
コントローラノードにストレージノードを共存させる構成とする。
両ノードを分離させる構成にしたい場合は、公式ドキュメントを参照のこと。
Prerequisites
コントローラノード要件の設定。
mysql -u root -p ROOT_DBPASS CREATE DATABASE cinder; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'localhost' IDENTIFIED BY 'CINDER_DBPASS'; GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'%' IDENTIFIED BY 'CINDER_DBPASS'; exit
. admin-openrc
openstack user create --domain default --password CINDER_PASS cinder openstack role add --project service --user cinder admin openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2 openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
openstack endpoint create --region RegionOne volumev2 public http://ctr01:8776/v2/%\(project_id\)s openstack endpoint create --region RegionOne volumev2 internal http://ctr01:8776/v2/%\(project_id\)s openstack endpoint create --region RegionOne volumev2 admin http://ctr01:8776/v2/%\(project_id\)s openstack endpoint create --region RegionOne volumev3 public http://ctr01:8776/v3/%\(project_id\)s openstack endpoint create --region RegionOne volumev3 internal http://ctr01:8776/v3/%\(project_id\)s openstack endpoint create --region RegionOne volumev3 admin http://ctr01:8776/v3/%\(project_id\)s
ストレージノード要件の設定。
dnf -y install lvm2 device-mapper-persistent-data
systemctl enable --now lvm2-lvmetad.service
→サービスが存在しない。しかし続行しても支障なかった。
pvcreate /dev/sdb vgcreate cinder-volumes /dev/sdb
cp -p /etc/lvm/lvm.conf{,_org} ls -l /etc/lvm/lvm.conf*
sed -i -e "158i filter = [ "a/sdb/", "r/.*/"]" /etc/lvm/lvm.conf sed -i -e "158s/^/\t/" /etc/lvm/lvm.conf
diff /etc/lvm/lvm.conf{,_org}
Install and configure components
コントローラノード、ストレージノード要件の設定。 dnf -y install openstack-cinder
ストレージノード要件の設定。
dnf -y install targetcli python3-keystone
※すでにインストール済みかもしれない
コントローラノード、ストレージノード要件をマージしてコンフィグを作成する。
cp -p /etc/cinder/cinder.conf{,_org} ls -l /etc/cinder/cinder.conf{,_org}
cat << EOF > /etc/cinder/cinder.conf [DEFAULT] transport_url = rabbit://openstack:RABBIT_PASS@ctr01 auth_strategy = keystone my_ip = 172.16.0.206 glance_api_servers = http://ctr01:9292 enabled_backends = lvm backup_driver = cinder.backup.drivers.swift.SwiftBackupDriver backup_swift_url = SWIFT_URL [database] connection = mysql+pymysql://cinder:CINDER_DBPASS@ctr01/cinder [keystone_authtoken] www_authenticate_uri = http://ctr01:5000 auth_url = http://ctr01:5000 memcached_servers = ctr01: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 [lvm] volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver volume_group = cinder-volumes target_protocol = iscsi target_helper = lioadm EOF
cat /etc/cinder/cinder.conf
su -s /bin/sh -c "cinder-manage db sync" cinder
Configure Compute to use Block Storage
cp -p /etc/nova/nova.conf{,_add_cinder} ls -l /etc/nova/nova.conf*
cat << EOF >> /etc/nova/nova.conf [cinder] os_region_name = RegionOne EOF
diff /etc/nova/nova.conf{,_add_cinder} cat /etc/nova/nova.conf
Finalize installation
コントローラノード要件の設定。
systemctl restart openstack-nova-api.service systemctl enable --now openstack-cinder-api.service openstack-cinder-scheduler.service systemctl is-active openstack-cinder-api.service openstack-cinder-scheduler.service systemctl is-enabled openstack-cinder-api.service openstack-cinder-scheduler.service
コントローラノードでCinderのバックアップサービス(オプション)を利用する場合の設定。
systemctl enable --now openstack-cinder-backup.service systemctl is-active openstack-cinder-backup.service systemctl is-enabled openstack-cinder-backup.service
ストレージノード要件の設定。
systemctl enable --now openstack-cinder-volume.service target.service systemctl is-active openstack-cinder-volume.service target.service systemctl is-enabled openstack-cinder-volume.service target.service
Verify Cinder operation
. admin-openrc openstack volume service list