###########################
##### controller node 설치 #####
##########################
[root@controller ~]# mysql -u root -p
MariaDB [(none)]> create database cinder;
Query OK, 1 row affected (0.01 sec)
MariaDB [(none)]> grant all privileges on cinder.* to cinder@'localhost' identified by 'cinder';
Query OK, 0 rows affected (0.14 sec)
MariaDB [(none)]> grant all privileges on cinder.* to cinder@'%' identified by 'cinder';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.01 sec)
[root@controller ~]# source ~/keystonerc
[root@controller ~]# yum -y install openstack-cinder
[root@controller ~]# openstack user create --domain default --project service --password-prompt cinder
User Password: cinder
Repeat User Password: cinder
[root@controller ~]# openstack role add --project service --user cinder admin
[root@controller ~]# openstack service create --name cinder --description "OpenStack Block Storage" volume
[root@controller ~]# openstack service create --name cinderv2 --description "OpenStack Block Storage" volumev2
[root@controller ~]# openstack service create --name cinderv3 --description "OpenStack Block Storage" volumev3
[root@controller ~]# openstack endpoint create --region RegionOne volume public http://192.168.100.110:8776/v1/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volume internal http://192.168.100.110:8776/v1/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volume admin http://192.168.100.110:8776/v1/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volumev2 public http://192.168.100.110:8776/v2/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volumev2 internal http://192.168.100.110:8776/v2/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volumev2 admin http://192.168.100.110:8776/v2/%\(tenant_id\)s
v3 설정없으면 cinder volume list 확인 시 not found 나옴
[root@controller ~]# openstack endpoint create --region RegionOne volumev3 public http://192.168.100.110:8776/v3/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volumev3 internal http://192.168.100.110:8776/v3/%\(tenant_id\)s
[root@controller ~]# openstack endpoint create --region RegionOne volumev3 admin http://192.168.100.110:8776/v3/%\(tenant_id\)s
[root@controller ~]# openstack user list
[root@controller ~]# openstack service list
[root@controller ~]# openstack endpoint list | grep cinder
[root@controller ~]# cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
[root@controller ~]# vi /etc/cinder/cinder.conf
[DEFAULT]
my_ip = 192.168.100.110
enable_v1_api = True
enable_v2_api = True
enable_v3_api = True
auth_strategy = keystone
transport_url = rabbit://openstack:password@192.168.100.110
[database]
connection = mysql+pymysql://cinder:cinder@192.168.100.110/cinder
[keystone_authtoken]
www_authenticate_uri = http://192.168.100.110:5000
auth_url = http://192.168.100.110:5000
memcached_servers = 192.168.100.110:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username =cinder
password = cinder
[oslo_concurrency]
lock_path = /var/lib/cinder/lock
[root@controller ~]# chmod 640 /etc/cinder/cinder.conf
[root@controller ~]# chgrp cinder /etc/cinder/cinder.conf
[root@controller ~]# su -s /bin/bash cinder -c "cinder-manage db sync"
[root@controller ~]# systemctl enable openstack-cinder-api openstack-cinder-scheduler
[root@controller ~]# systemctl start openstack-cinder-api openstack-cinder-scheduler
[root@controller ~]# systemctl status openstack-cinder-api
[root@controller ~]# lsof -i tcp:8776
[root@controller ~]# ls -l /var/log/cinder/
[root@controller ~]# openstack volume service list
################################
##### storage(network) node 설치 #####
################################
[root@network ~]# yum install openstack-cinder python2-crypto targetcli -y
[root@network ~]# cp /etc/cinder/cinder.conf /etc/cinder/cinder.conf.bak
[root@network ~]# vi /etc/cinder/cinder.conf
[DEFAULT]
my_ip = 192.168.100.112
enable_v1_api = True
enable_v2_api = True
enable_v3_api = True
auth_strategy = keystone
transport_url = rabbit://openstack:password@192.168.100.110
glance_api_servers = http://192.168.100.110:9292 //glance api로 사용할 서버
enabled_backends = lvm //백엔드에서 스토리지 사용할 이름
[database]
connection = mysql+pymysql://cinder:cinder@192.168.100.110/cinder
[keystone_authtoken]
www_authenticate_uri = http://192.168.100.110:5000
auth_url = http://192.168.100.110:5000
memcached_servers = 192.168.100.110:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = cinder
password = cinder
[oslo_concurrency]
lock_path = /var/lib/cinder/lock
[root@network ~]# chmod 640 /etc/cinder/cinder.conf
[root@network ~]# chgrp cinder /etc/cinder/cinder.conf
[root@network ~]# systemctl enable openstack-cinder-volume
[root@network ~]# systemctl start openstack-cinder-volume
[root@network ~]# source ~/keystonerc
[root@network ~]# cinder service-list
[root@network ~]# openstack volume service list //down은 볼륨이 안만들어져서 그렇다.
| cinder-scheduler | controller.park.com | nova | enabled | up | 2021-01-19T01:35:32.000000 |
| cinder-volume | network.park.com@lvm | nova | enabled | down | 2021-01-19T01:33:37.000000 |
--------------------------------
volumev3가 없으면 아래와 같은 error가 나옴 그래서 volumev3도 생성 필요.
[root@network ~]# source ~/keystonerc
[root@network ~]# cinder service-list
ERROR: publicURL endpoint for volumev3 service not found
[root@network ~]#
------------------------------------------------
인스턴스가 삭제 안되거나 볼륨이 삭제안될때
컨트롤러host와 네트워크 host 에서.. 데몬 재시작
[root@controller ~]# systemctl restart openstack-cinder-api openstack-cinder-scheduler
[root@network ~]# systemctl restart openstack-cinder-volume
-----------------------------------------
볼륨삭제 안될때 강제 삭제
status가 available일때만 삭제 가능 하지만 deleting또는 creating에서 멈춰있을때 삭제가 안됨
[root@controller ~]# openstack volume list
+--------------------------------------+-----------+----------+------+-------------+
| ID | Name | Status | Size | Attached to |
+--------------------------------------+-----------+----------+------+-------------+
| b1ad9f4e-2f49-4598-b538-0c1f68de90e5 | ceph-vol1 | deleting | 1 | |
+--------------------------------------+-----------+----------+------+-------------+
그래서 DB에서 적용해서 삭제해야함.
[root@controller ~]# mysql -u root -p
Enter password:
MariaDB [(none)]> use cinder;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [cinder]> update volumes set deleted=1,status=deleted,deleted_at=now(),updated_at=now() where deleted=0 and id='b1xxxx-2f49-4598-xxxx-xxxxxxxx';
Query OK, 1 row affected (0.03 sec)
Rows matched: 1 Changed: 1 Warnings: 0
MariaDB [cinder]> exit
Bye
[root@controller ~]# openstack volume list
[root@controller ~]#
'openstack' 카테고리의 다른 글
openstack - glance, instance, neutron provider network 생성 (0) | 2021.01.31 |
---|---|
openstack - swift 설치 (0) | 2021.01.19 |
openstack - neutron 설치 (0) | 2021.01.19 |
openstack- horizon 설치 (0) | 2021.01.18 |
openstack - nova 설치 (0) | 2021.01.18 |