Friday, December 5, 2025

OpenStack Epoxy : How to use Manila (Local Device)

 

OpenStack Epoxy : How to use Manila (Local Device)2

 

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.
Therefore, it needs there is a free block device on Storage Node.

------------+--------------------------+--------------------------+------------
            |                          |                          |
        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 last line

[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
root@network:~# 
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                   | 40c46367-f006-4d83-9f10-d2fc98d8a9af |
| 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 |
+----------+----------+------------+------------+----------------------+----------------------+-------------+
| 40c46367 | default_ | public     | True       | driver_handles_share |                      | None        |
| -f006-   | share_ty |            |            | _servers : False     |                      |             |
| 4d83-    | pe       |            |            |                      |                      |             |
| 9f10-    |          |            |            |                      |                      |             |
| d2fc98d8 |          |            |            |                      |                      |             |
| a9af     |          |            |            |                      |                      |             |
+----------+----------+------------+------------+----------------------+----------------------+-------------+
[3]Login as a common user to create Manila NFS Share.
debian@dlp ~(keystone)$ 
openstack share create NFS 10 --name share01 --share-type default_share_type

+---------------------------------------+--------------------------------------+
| Field                                 | Value                                |
+---------------------------------------+--------------------------------------+
| id                                    | 4d4c9ead-c572-453e-88d7-dac2863ffca2 |
| size                                  | 10                                   |
| availability_zone                     | None                                 |
| created_at                            | 2025-09-01T03:41:50.992450           |
| status                                | creating                             |
| name                                  | share01                              |
| description                           | None                                 |
| project_id                            | ecfa98ba82de421e8f16c3d862b5ab04     |
| snapshot_id                           | None                                 |
| share_network_id                      | None                                 |
| share_proto                           | NFS                                  |
| metadata                              | {}                                   |
| share_type                            | 40c46367-f006-4d83-9f10-d2fc98d8a9af |
| 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                               | da64c3c335434563b66eb2e8af260392     |
| 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

debian@dlp ~(keystone)$ 
openstack share list

+----------+---------+------+-------------+----------+-----------+-----------------+------+-------------------+
| ID       | Name    | Size | Share Proto | Status   | Is Public | Share Type Name | Host | Availability Zone |
+----------+---------+------+-------------+----------+-----------+-----------------+------+-------------------+
| 4d4c9ead | share01 |   10 | NFS         | availabl | False     | default_share_t |      | nova              |
| -c572-   |         |      |             | e        |           | ype             |      |                   |
| 453e-    |         |      |             |          |           |                 |      |                   |
| 88d7-    |         |      |             |          |           |                 |      |                   |
| dac2863f |         |      |             |          |           |                 |      |                   |
| fca2     |         |      |             |          |           |                 |      |                   |
+----------+---------+------+-------------+----------+-----------+-----------------+------+-------------------+
[4]That's OK, you can use Manila Shared filesystem on your own instances like follows.
debian@dlp ~(keystone)$ 
openstack server list

+----------------+-----------+---------+-----------------+----------+----------+
| ID             | Name      | Status  | Networks        | Image    | Flavor   |
+----------------+-----------+---------+-----------------+----------+----------+
| 2deabceb-e220- | Debian-13 | SHUTOFF | private=10.0.0. | Debian13 | m1.small |
| 4e5c-b8dd-     |           |         | 249,            |          |          |
| 320683d0bf0b   |           |         | 192.168.100.39  |          |          |
+----------------+-----------+---------+-----------------+----------+----------+

# set access permission first

debian@dlp ~(keystone)$ 
openstack share access create share01 ip 10.0.0.0/24 --access-level rw

+--------------+--------------------------------------+
| Field        | Value                                |
+--------------+--------------------------------------+
| id           | 008385b5-4fec-4bdb-8aab-363ebd332f98 |
| share_id     | 4d4c9ead-c572-453e-88d7-dac2863ffca2 |
| access_level | rw                                   |
| access_to    | 10.0.0.0/24                          |
| access_type  | ip                                   |
| state        | queued_to_apply                      |
| access_key   | None                                 |
| created_at   | 2025-09-01T03:42:52.647938           |
| updated_at   | None                                 |
| properties   |                                      |
+--------------+--------------------------------------+

# OK if State turns to [active]

debian@dlp ~(keystone)$ 
openstack share access list share01

+----------+-------------+-----------+--------------+--------+------------+------------+------------+
| ID       | Access Type | Access To | Access Level | State  | Access Key | Created At | Updated At |
+----------+-------------+-----------+--------------+--------+------------+------------+------------+
| 008385b5 | ip          | 10.0.0.0/ | rw           | active | None       | 2025-09-   | 2025-09-   |
| -4fec-   |             | 24        |              |        |            | 01T03:42:5 | 01T03:42:5 |
| 4bdb-    |             |           |              |        |            | 2.647938   | 4.588911   |
| 8aab-    |             |           |              |        |            |            |            |
| 363ebd33 |             |           |              |        |            |            |            |
| 2f98     |             |           |              |        |            |            |            |
+----------+-------------+-----------+--------------+--------+------------+------------+------------+

debian@dlp ~(keystone)$ 
openstack server start Debian-13

# confirm access Path

debian@dlp ~(keystone)$ 
openstack share show share01 | grep path | cut -d'|' -f3

 path = 10.0.0.50:/var/lib/manila/mnt/share-a89304d5-426b-4d9c-b1a6-a4bd62c044d0

debian@dlp ~(keystone)$ 
ssh debian@10.0.0.249

Linux debian-13 6.12.41+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.41-1 (2025-08-12) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Fri Aug 29 04:29:29 2025 from 10.0.0.30
debian@debian-13:~$

# mount Manila shared storage

debian@debian-13:~$ 
sudo mount -t nfs \
10.0.0.50:/var/lib/manila/mnt/share-a89304d5-426b-4d9c-b1a6-a4bd62c044d0 /mnt

debian@debian-13:~$ 
df -hT

Filesystem                                                               Type      Size  Used Avail Use% Mounted on
udev                                                                     devtmpfs  1.9G     0  1.9G   0% /dev
tmpfs                                                                    tmpfs     392M  600K  392M   1% /run
/dev/vda1                                                                ext4      9.7G  931M  8.3G  10% /
tmpfs                                                                    tmpfs     2.0G     0  2.0G   0% /dev/shm
tmpfs                                                                    tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs                                                                    tmpfs     2.0G     0  2.0G   0% /tmp
tmpfs                                                                    tmpfs     1.0M     0  1.0M   0% /run/credentials/systemd-journald.service
tmpfs                                                                    tmpfs     1.0M     0  1.0M   0% /run/credentials/systemd-resolved.service
tmpfs                                                                    tmpfs     1.0M     0  1.0M   0% /run/credentials/systemd-networkd.service
/dev/vda15                                                               vfat      124M  8.7M  116M   8% /boot/efi
tmpfs                                                                    tmpfs     1.0M     0  1.0M   0% /run/credentials/getty@tty1.service
tmpfs                                                                    tmpfs     1.0M     0  1.0M   0% /run/credentials/serial-getty@ttyS0.service
tmpfs                                                                    tmpfs     392M  4.0K  392M   1% /run/user/1000
10.0.0.50:/var/lib/manila/mnt/share-a89304d5-426b-4d9c-b1a6-a4bd62c044d0 nfs4      9.8G  2.0M  9.3G   1% /mnt
Matched Content

No comments:

Post a Comment