본문 바로가기
서버/Cloud

오픈스택 클라우드 서버 구축(Stein)(11)-Block Storage(Cinder) 설정(LVM)

by WYYOON 2023. 2. 2.
728x90
반응형
SMALL

#Storage Node 설정

1) Create a volume group for Cinder on Storage Node.

더보기

[root@storage ~]# pvcreate /dev/sdb1
Physical volume "/dev/sdb1" successfully created
[root@storage ~]# vgcreate -s 32M vg_volume01 /dev/sdb1
Volume group "vg_volume01" successfully created

2) Configure Cinder Volume on Storage Node.

더보기

[root@storage ~]# vi /etc/cinder/cinder.conf
# add follows into [DEFAULT] section
enabled_backends = lvm

# add follows to the end
[lvm]
target_helper = lioadm
target_protocol = iscsi
# IP address of Storage Node
target_ip_address = 10.0.0.50
# volume group name just created
volume_group = vg_volume01
volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver
volumes_dir = $state_path/volumes

[root@storage ~]# systemctl restart openstack-cinder-volume

3) 방화벽 포트 설정

더보기

[root@storage ~]# firewall-cmd --add-service=iscsi-target --permanent
success
[root@storage ~]# firewall-cmd --reload
success

# Compute Node 설정

1) Configure Nova on Compute Node.

더보기

[root@computer ~]# vi /etc/nova/nova.conf
# add to the end
[cinder]
os_region_name = RegionOne


[root@computer ~]# systemctl restart openstack-nova-compute

#Controller Node 설정

1) 볼륨 생성

더보기

[root@controller ~(keystone)]# echo "export OS_VOLUME_API_VERSION=3" >> ~/keystonerc
[root@controller ~(keystone)]# source ~/keystonerc
[root@controller ~(keystone)]# openstack volume create --size 10 disk01
+---------------------+--------------------------------------+
| Field               | Value                                |
+---------------------+--------------------------------------+
| attachments         | []                                   |
| availability_zone   | nova                                 |
| bootable            | false                                |
| consistencygroup_id | None                                 |
| created_at          | 2019-05-16T07:51:12.000000           |
| description         | None                                 |
| encrypted           | False                                |
| id                  | dbe0494b-ba37-4bc0-9a93-75510864b151 |
| multiattach         | False                                |
| name                | disk01                               |
| properties          |                                      |
| replication_status  | None                                 |
| size                | 10                                   |
| snapshot_id         | None                                 |
| source_volid        | None                                 |
| status              | creating                             |
| type                | None                                 |
| updated_at          | None                                 |
| user_id             | b5dd128c2fd744c892ad7d1fb39d21a0     |
+---------------------+--------------------------------------+

[root@controller ~(keystone)]# openstack volume list
+--------------------------------------+--------+-----------+------+-------------+
| ID                                   | Name   | Status    | Size | Attached to |
+--------------------------------------+--------+-----------+------+-------------+
| dbe0494b-ba37-4bc0-9a93-75510864b151 | disk01 | available |   10 |             |
+--------------------------------------+--------+-----------+------+-------------+

2) Attach the virtual disk to an Instance.

더보기

[root@controller ~(keystone)]# openstack server list
+--------------------------------------+----------+---------+------------------------------------+---------+----------+
| ID                                   | Name     | Status  | Networks                           | Image   | Flavor   |
+--------------------------------------+----------+---------+------------------------------------+---------+----------+
| aced428a-2d16-4679-9798-50e69c7aaf1d | CentOS_7 | SHUTOFF | int_net=192.168.100.59, 10.0.0.240 | CentOS7 | m1.small |
+--------------------------------------+----------+---------+------------------------------------+---------+----------+

[root@controller ~(keystone)]# openstack server add volume CentOS_7 disk01
# the status of attached disk turns [in-use] like follows
[root@controller ~(keystone)]# openstack volume list
+--------------------------------------+--------+--------+------+-----------------------------------+
| ID                                   | Name   | Status | Size | Attached to                       |
+--------------------------------------+--------+--------+------+-----------------------------------+
| dbe0494b-ba37-4bc0-9a93-75510864b151 | disk01 | in-use |   10 | Attached to CentOS_7 on /dev/vdb  |
+--------------------------------------+--------+--------+------+-----------------------------------+

# detach the disk
[root@controller ~(keystone)]# openstack server remove volume CentOS_7 disk01

728x90
반응형
SMALL