YUMSERV
Published 2021. 5. 13. 10:18
[Victoria] Cinder 설치 OpenStack
반응형
[Openstack 설치글]

[CLOUD/OpenStack] - Openstack-Victoria설치(사전작업)

[CLOUD/OpenStack] - [Victoria] Keystone 설치

[CLOUD/OpenStack] - [Victoria] Glance 설치

[CLOUD/OpenStack] - [Victoria] Nova 설치

[CLOUD/OpenStack] - [Victoria] Horizon 설치

[CLOUD/OpenStack] - [Victoria] Neutron 설치

[CLOUD/OpenStack] - [Victoria] Cinder 설치

 

 

 

1. Cinder 데이터베이스 생성

MariaDB [(none)]> CREATE DATABASE cinder;
Query OK, 1 row affected (0.000 sec)

MariaDB [(none)]> grant all privileges on cinder.* to 'cinder'@'localhost' identified by 'CINDER_DBPASS';
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> grant all privileges on cinder.* to 'cinder'@'%' identified by 'CINDER_DBPASS';
Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.001 sec)

 

 

2. 사용자, 서비스 등록

root@controller:~# openstack user create --domain default --password CINDER_PASS cinder 
+---------------------+----------------------------------+
| Field | Value | 
+---------------------+----------------------------------+ 
| domain_id | default | 
| enabled | True | 
| id | 617b9b510be94758a409124f4fd31f00 |
| name | cinder |
| options | {} | 
| password_expires_at | None |
+---------------------+----------------------------------+

root@controller:~# openstack role add --project service --user cinder admin

root@controller:~# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | ede04e2bea8945ebbff6e91bfdc2e729 |
| name | cinderv2 |
| type | volumev2 |
+-------------+----------------------------------+

root@controller:~# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | d330345b8bd8429d810607726f22a238 |
| name | cinderv3 |
| type | volumev3 |
+-------------+----------------------------------+

root@controller:~# openstack endpoint create --region Region01 volumev2 public http://controller:8776/v2/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id | 9d7a343888204f6bba1a157eb33d5f2a |
| interface | public |
| region | Region01 |
| region_id | Region01 |
| service_id | ede04e2bea8945ebbff6e91bfdc2e729 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(project_id)s |
+--------------+------------------------------------------+

root@controller:/var/log/nova# openstack endpoint create --region Region01 volumev2 internal http://controller:8776/v2/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id | 33f5893f0e17447e889156bbae76483c |
| interface | internal |
| region | Region01 |
| region_id | Region01 |
| service_id | ede04e2bea8945ebbff6e91bfdc2e729 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(project_id)s |
+--------------+------------------------------------------+

root@controller:~# openstack endpoint create --region Region01 volumev2 admin http://controller:8776/v2/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id | b2e111e473274256a30bb0824a756910 |
| interface | admin |
| region | Region01 |
| region_id | Region01 |
| service_id | ede04e2bea8945ebbff6e91bfdc2e729 |
| service_name | cinderv2 |
| service_type | volumev2 |
| url | http://controller:8776/v2/%(project_id)s |
+--------------+------------------------------------------+

root@controller:~# openstack endpoint create --region Region01 volumev3 public http://controller:8776/v3/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id | b7545a3927c747bd9dc9d33c00b94267 |
| interface | public |
| region | Region01 |
| region_id | Region01 |
| service_id | d330345b8bd8429d810607726f22a238 |
| service_name | cinderv3 |
| service_type | volumev3 |
| url | http://controller:8776/v3/%(project_id)s |
+--------------+------------------------------------------+

root@controller:~# openstack endpoint create --region Region01 volumev3 internal http://controller:8776/v3/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id | 38407359087a4530b291603964be7558 |
| interface | internal |
| region | Region01 |
| region_id | Region01 |
| service_id | d330345b8bd8429d810607726f22a238 |
| service_name | cinderv3 |
| service_type | volumev3 |
| url | http://controller:8776/v3/%(project_id)s |
+--------------+------------------------------------------+

root@controller:~# openstack endpoint create --region Region01 volumev3 admin http://controller:8776/v3/%\(project_id\)s
+--------------+------------------------------------------+
| Field | Value |
+--------------+------------------------------------------+
| enabled | True |
| id | 83fb4e4ecf6c402385d2b59775777e51 |
| interface | admin |
| region | Region01 |
| region_id | Region01 |
|service_id | d330345b8bd8429d810607726f22a238 |
| service_name | cinderv3 |
| service_type | volumev3 |
| url | http://controller:8776/v3/%(project_id)s |
+--------------+------------------------------------------+

 

 

3. 패키지 설치 및 환경설정

root@controller:~# apt install cinder-api cinder-scheduler

root@controller:~# cat /etc/cinder/cinder.conf
[DEFAULT]
transport_url = rabbit://openstack:RABBIT_PASS@controller
auth_strategy = keystone
my_ip = 192.168.198.100

[database]
connection = mysql+pymysql://cinder:CINDERDB_PASS@controller/cinder

[keystone_authtoken]
www_authenticate_url = 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

[oslo_concurrency]
lock_path = /var/lib/cinder/tmp


root@controller:~# su -s /bin/sh -c "cinder-manage db sync" cinder

root@controller:~# cat /etc/nova/nova.conf
아래 내용 추가
[cinder]
os_region_name = Region01

root@controller:~# service nova-api restart
root@controller:~# service cinder-scheduler restart
root@controller:~# service apache2 restart

 

 

4. Storage 서버 설정 - 패키시 설치 및 환경설정

root@storage:~# apt install lvm2 thin-provisioning-tools
root@storage:~# pvcreate /dev/vdb
Physical volume "/dev/vdb" successfully created.

root@storage:~# vgcreate cinder-volumes /dev/vdb
Volume group "cinder-volumes" successfully created

root@storage:~# pvdisplay
--- Physical volume ---
PV Name /dev/vdb
VG Name cinder-volumes
PV Size 100.00 GiB / not usable 4.00 MiB
Allocatable yes
PE Size 4.00 MiB
Total PE 25599
Free PE 25599
Allocated PE 0
PV UUID ap2GDJ-KtOe-nUFE-h9OQ-Vbof-Kc6a-3YsdvQ

root@storage:~# vgdisplay
--- Volume group ---
VG Name cinder-volumes
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 1
Act PV 1
VG Size <100.00 GiB
PE Size 4.00 MiB
Total PE 25599
Alloc PE / Size 0 / 0
Free PE / Size 25599 / <100.00 GiB
VG UUID ie29Ig-ujMZ-8p6M-Km4L-SNfS-C92n-ytohRf

root@storage:~# vi /etc/lvm/lvm.conf
filter = [ "a/vdb/", "r/.*/" ]

root@storage:~# apt install cinder-volume

root@storage:/var/log/cinder# cat /etc/cinder/cinder.conf
[DEFAULT]
rootwrap_config = /etc/cinder/rootwrap.conf
api_paste_confg = /etc/cinder/api-paste.ini
iscsi_helper = tgtadm
volume_name_template = volume-%s
volume_group = cinder-volumes
verbose = True
auth_strategy = keystone
state_path = /var/lib/cinder
lock_path = /var/lock/cinder
volumes_dir = /var/lib/cinder/volumes
enabled_backends = lvm
transport_url = rabbit://openstack:RABBIT_PASS@controller
my_ip = CINDER_IP
glance_api_servers = http://controller:9292

[oslo_concurrency]
lock_path = /var/lib/cinder/tmp
[database]
connection = mysql+pymysql://cinder:CINDERDB_PASS@controller/cinder

[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 = tgtadm

root@storage:/var/log/cinder# systemctl restart cinder-volume
root@storage:/var/log/cinder# systemctl restart tgt

 

 

5. 서비스 확인

root@controller:~# openstack volume service list
+------------------+-------------+------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated At |
+------------------+-------------+------+---------+-------+----------------------------+
| cinder-scheduler | controller | nova | enabled | up | 2021-05-19T11:18:20.000000 |
| cinder-volume | storage@lvm | nova | enabled | up | 2021-05-19T11:18:27.000000 |
+------------------+-------------+------+---------+-------+----------------------------+
반응형

'OpenStack' 카테고리의 다른 글

[Victoria] Octavia dashboard  (0) 2021.05.23
[Victoria] Octavia 설치  (0) 2021.05.23
[정리] Cinder 이론  (0) 2021.05.13
[Victoria] Neutron 설치  (0) 2021.04.20
ovs-vsctl annot load glue library: libibverbs.so.1 에러메시지  (0) 2021.02.11
profile

YUMSERV

@lena04301

포스팅이 좋았다면 "좋아요❤️" 또는 "구독👍🏻" 해주세요!