Cấu hình Cinder multiple backend LVM + NFS.
Introduction
Khi cấu hình multiple-storage backen, bạn có thể tạo nhiều giải pháp lưu trữ mà phục vụ cho cùng cấu hình Openstack Compute và có thể một cinder volume có thể được tạo cho mỗi backend storage hoặc backend storage pool.
Trong cấu hình multiple-storage backend, mỗi backend có một tên(volume_backend_name). Các backend có thể có tên giống nhau.
Tên của backend cũng được coi là thông số bổ sung cho loại volume. Khi volume được tạo, scheduler chọn backend để xử lý yêu cầu, dựa theo loại volume được thiết lập bởi người dùng.
Mô hình cài đặt theo bài Cài đặt Openstack Cinder - LVM backend.
Trong nội dung bài này mình tiến hành cài đặt thêm NFS storage backend.
Cấu hình multiple-storage backend trên Storage node
- Ở bài này, mình sẽ cài luôn NFS server trên cùng node với Cinder volume. Cài đặt NFS server:
yum install -y install nfs-utils mkdir /var/lib/nfs-share echo "/var/lib/nfs-share 192.168.30.0/24(rw,no_root_squash)" > /etc/exports systemctl restart rpcbind nfs-server systemctl enable rpcbind nfs-server
- Cấu hình firewalld:
firewall-cmd --add-service nfs --permanent firewall-cmd --reload
-
Cấu hình Cinder Volume sử dụng môi trường từ bài trước
- Tạo file /etc/cinder/nfs-shares:
echo 192.168.30.174:/var/lib/nfs-share > /etc/cinder/nfs_shares chown root:cinder /etc/cinder/nfs_shares chmod 0640 /etc/cinder/nfs_shares
- Sửa file cấu hình /etc/cinder/cinder.conf thành như sau: ``` [DEFAULT] transport_url = rabbit://openstack:osrabbitmq@192.168.30.171:5672 auth_strategy = keystone my_ip = 192.168.30.174 enabled_backends = lvmdriver1, nfsdriver1 glance_api_servers = http://192.168.30.171:9292
[database] connection = mysql+pymysql://cinder:oscindersql@192.168.30.171/cinder
[keystone_authtoken] www_authenticate_uri = http://192.168.30.171:5000 auth_url = http://192.168.30.171:5000 memcached_servers = 192.168.30.171:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = cinder password = oscinder
[oslo_concurrency] lock_path = /var/lib/cinder/tmp
[lvmdriver1] volume_backend_name = lvm1 volume_driver = cinder.volume.drivers.lvm.LVMVolumeDriver volume_group = cinder-volumes target_protocol = iscsi target_helper = lioadm
[nfsdriver1] volume_driver = cinder.volume.drivers.nfs.NfsDriver nfs_shares_config = /etc/cinder/nfs_shares volume_backend_name = nfs1 nfs_snapshot_support = True
- Khởi động lại dich vụ openstack-cinder-volume:
systemctl restart openstack-cinder-volume
## Cấu hình trên Controller node
- Kiểm tra các backend đang có trên hệ thống
- Khởi tạo volume type từ giá trị `volume_backend_name` vừa cấu hình cho mỗi backend:
openstack volume type create lvm-1 openstack volume type set lvm-1 –property volume_backend_name=lvm1
openstack volume type create nfs-1
openstack volume type set nfs-1 –property volume_backend_name=nfs1
- Tạo thử volume theo loại với tùy chọn `--type` trong câu lệnh `openstack volume create`, ví dụ tạo một volume với type ở đây là lvm-2:
openstack volume create –size 5 –type lvm-2 testlvm ```
Tài liệu nguồn:
- https://docs.openstack.org/cinder/train/admin/blockstorage-multi-backend.html