OpenStack Epoxy : How to use Manila (Local Device)2025/04/24 |
|
This is How to use OpenStack Shared File System (Manila). This example is based on the environment like follows.
For example, Configure a local block device as shared storage on Storage Node and use it on Instances.
------------+--------------------------+--------------------------+------------
| | |
eth0|10.0.0.30 eth0|10.0.0.50 eth0|10.0.0.51
+-----------+-----------+ +-----------+-----------+ +-----------+-----------+
| [ dlp.srv.world ] | | [ network.srv.world ] | | [ node01.srv.world ] |
| (Control Node) | | (Network Node) | | (Compute Node) |
| | | | | |
| MariaDB RabbitMQ | | Neutron L2/L3 Agent | | Libvirt |
| Memcached Nginx | | Neutron Metadata | | Nova Compute |
| Keystone httpd | | Open vSwitch | | Neutron L2 Agent |
| Glance Nova API | | iSCSI Target | | Open vSwitch |
| Neutron Server | | Cinder Volume | | |
| Neutron Metadata | | Manila Share | | |
| Cinder API Manila API | | | | |
+-----------------------+ +-----------------------+ +-----------------------+
|
| [1] | Configure Storage Node. |
|
root@network:~#
apt -y install lvm2 nfs-kernel-server # create a volume for Manila on free block device root@network:~# pvcreate /dev/sdc1 Physical volume "/dev/sdc1" successfully created root@network:~# vgcreate manila-volumes /dev/sdc1 Volume group "manila-volumes" successfully created
root@network:~#
vi /etc/manila/manila.conf # add follows into [DEFAULT] section
enabled_share_backends = lvm
# add to the end [lvm] share_backend_name = LVM share_driver = manila.share.drivers.lvm.LVMShareDriver driver_handles_share_servers = False lvm_share_volume_group = manila-volumes lvm_share_export_ips = $my_ip systemctl restart manila-share nfs-server root@network:~# systemctl enable manila-share nfs-server
|
| [2] | Create a default share type. It's OK to work on any node. (example below is on Control Node) |
|
root@dlp ~(keystone)# openstack share type create default_share_type False +----------------------+--------------------------------------+ | Field | Value | +----------------------+--------------------------------------+ | id | 5a0456bb-6c00-42ba-9c27-c95e6cf3ba2a | | name | default_share_type | | visibility | public | | is_default | True | | required_extra_specs | driver_handles_share_servers : False | | optional_extra_specs | | | description | None | +----------------------+--------------------------------------+root@dlp ~(keystone)# openstack share type list +----------+----------+------------+------------+----------------------+----------------------+-------------+ | ID | Name | Visibility | Is Default | Required Extra Specs | Optional Extra Specs | Description | +----------+----------+------------+------------+----------------------+----------------------+-------------+ | 5a0456bb | default_ | public | True | driver_handles_share | | None | | -6c00- | share_ty | | | _servers : False | | | | 42ba- | pe | | | | | | | 9c27- | | | | | | | | c95e6cf3 | | | | | | | | ba2a | | | | | | | +----------+----------+------------+------------+----------------------+----------------------+-------------+ |
| [3] | Login as a common user to create Manila NFS Share. |
|
ubuntu@dlp ~(keystone)$ openstack share create NFS 10 --name share01 --share-type default_share_type
+---------------------------------------+--------------------------------------+
| Field | Value |
+---------------------------------------+--------------------------------------+
| id | 19709f48-c49a-48f4-90e1-87716d16fb1f |
| size | 10 |
| availability_zone | None |
| created_at | 2025-04-24T01:20:10.434983 |
| status | creating |
| name | share01 |
| description | None |
| project_id | 407400ec8d16434e9badf4ceb9d71f1e |
| snapshot_id | None |
| share_network_id | None |
| share_proto | NFS |
| metadata | {} |
| share_type | 5a0456bb-6c00-42ba-9c27-c95e6cf3ba2a |
| volume_type | default_share_type |
| is_public | False |
| snapshot_support | False |
| task_state | None |
| share_type_name | default_share_type |
| access_rules_status | active |
| replication_type | None |
| has_replicas | False |
| user_id | a30763bf79b944f59efcfd59d4899e5b |
| create_share_from_snapshot_support | False |
| revert_to_snapshot_support | False |
| share_group_id | None |
| source_share_group_snapshot_member_id | None |
| mount_snapshot_support | False |
| progress | None |
| is_soft_deleted | False |
| scheduled_to_be_deleted_at | None |
| source_backup_id | None |
+---------------------------------------+--------------------------------------+
# OK if the Status turns to [available] after a few minutes ubuntu@dlp ~(keystone)$ openstack share list +----------+---------+------+-------------+----------+-----------+-----------------+------+-------------------+ | ID | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone | +----------+---------+------+-------------+----------+-----------+-----------------+------+-------------------+ | 19709f48 | share01 | 10 | NFS | availabl | False | default_share_t | | nova | | -c49a- | | | | e | | ype | | | | 48f4- | | | | | | | | | | 90e1- | | | | | | | | | | 87716d16 | | | | | | | | | | fb1f | | | | | | | | | +----------+---------+------+-------------+----------+-----------+-----------------+------+-------------------+ |
| [4] | That's OK, you can use Manila Shared filesystem on your own instances like follows. |
|
ubuntu@dlp ~(keystone)$ openstack server list +--------------+-------------+---------+--------------+------------+----------+ | ID | Name | Status | Networks | Image | Flavor | +--------------+-------------+---------+--------------+------------+----------+ | fc2ffdc7- | Ubuntu-2404 | SHUTOFF | private=10.0 | Ubuntu2404 | m1.small | | d1e2-4bbf- | | | .0.217, 192. | | | | 9abc- | | | 168.100.107 | | | | 7cbf5e1deb9e | | | | | | +--------------+-------------+---------+--------------+------------+----------+ # set access permission first ubuntu@dlp ~(keystone)$ openstack share access create share01 ip 10.0.0.0/24 --access-level rw +--------------+--------------------------------------+ | Field | Value | +--------------+--------------------------------------+ | id | a227edf1-0b78-4a2d-86a9-4c59b0463d94 | | share_id | 19709f48-c49a-48f4-90e1-87716d16fb1f | | access_level | rw | | access_to | 10.0.0.0/24 | | access_type | ip | | state | queued_to_apply | | access_key | None | | created_at | 2025-04-24T01:21:30.934739 | | updated_at | None | | properties | | +--------------+--------------------------------------+ # OK if State turns to [active] ubuntu@dlp ~(keystone)$ openstack share access list share01 +----------+-------------+-----------+--------------+--------+------------+------------+------------+ | ID | Access Type | Access To | Access Level | State | Access Key | Created At | Updated At | +----------+-------------+-----------+--------------+--------+------------+------------+------------+ | a227edf1 | ip | 10.0.0.0/ | rw | active | None | 2025-04- | 2025-04- | | -0b78- | | 24 | | | | 24T01:21:3 | 24T01:21:3 | | 4a2d- | | | | | | 0.934739 | 2.190867 | | 86a9- | | | | | | | | | 4c59b046 | | | | | | | | | 3d94 | | | | | | | | +----------+-------------+-----------+--------------+--------+------------+------------+------------+
ubuntu@dlp ~(keystone)$
openstack server start Ubuntu-2404 # confirm access Path ubuntu@dlp ~(keystone)$ openstack share show share01 | grep path | cut -d'|' -f3 path = 10.0.0.50:/var/lib/manila/mnt/share-ed0fefbd-6fc0-43d7-9992-42bff9eedbb0ubuntu@dlp ~(keystone)$ ssh ubuntu@10.0.0.217 Welcome to Ubuntu 24.04.2 LTS (GNU/Linux 6.8.0-57-generic x86_64) * Documentation: https://help.ubuntu.com * Management: https://landscape.canonical.com * Support: https://ubuntu.com/pro ..... ..... # mount Manila shared storage ubuntu@ubuntu-2404:~$ sudo mount -t nfs \ 10.0.0.50:/var/lib/manila/mnt/share-ed0fefbd-6fc0-43d7-9992-42bff9eedbb0 /mnt ubuntu@ubuntu-2404:~$ df -hT Filesystem Type Size Used Avail Use% Mounted on tmpfs tmpfs 392M 1.1M 391M 1% /run /dev/vda1 ext4 8.7G 1.9G 6.9G 21% / tmpfs tmpfs 2.0G 0 2.0G 0% /dev/shm tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock /dev/vda16 ext4 881M 61M 758M 8% /boot /dev/vda15 vfat 105M 6.1M 99M 6% /boot/efi tmpfs tmpfs 392M 12K 392M 1% /run/user/1000 10.0.0.50:/var/lib/manila/mnt/share-ed0fefbd-6fc0-43d7-9992-42bff9eedbb0 nfs4 9.8G 0 9.3G 0% /mnt |
| Sponsored Link |
|
|