Ubuntu 22.04
Sponsored Link

OpenStack Bobcat : How to use Manila (Local Device)2023/10/09

 
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  |  |      Open vSwitch     |  |        Libvirt        |
|  Memcached  Nginx     |  |     Neutron Server    |  |      Nova Compute     |
|  Keystone   httpd     |  |      OVN-Northd       |  |      Open vSwitch     |
|  Glance     Nova API  |  |  Nginx  iSCSI Target  |  |   OVN Metadata Agent  |
| Cinder API Manila API |  |     Cinder Volume     |  |     OVN-Controller    |
|                       |  |     Manila Share      |  |                       |
+-----------------------+  +-----------------------+  +-----------------------+

[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
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                   | 6a097cc3-6718-4215-bc66-bce3a74539a0 |
| 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 |
+--------------------------------------+--------------------+------------+------------+--------------------------------------+----------------------+-------------+
| 6a097cc3-6718-4215-bc66-bce3a74539a0 | default_share_type | public     | True       | driver_handles_share_servers : False |                      | None        |
+--------------------------------------+--------------------+------------+------------+--------------------------------------+----------------------+-------------+
[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                                |
+---------------------------------------+--------------------------------------+
| access_rules_status                   | active                               |
| availability_zone                     | None                                 |
| create_share_from_snapshot_support    | False                                |
| created_at                            | 2023-10-09T00:52:55.135803           |
| description                           | None                                 |
| has_replicas                          | False                                |
| id                                    | 0e48eaab-65d8-497f-a5f9-9a1b511b725d |
| is_public                             | False                                |
| is_soft_deleted                       | False                                |
| metadata                              | {}                                   |
| mount_snapshot_support                | False                                |
| name                                  | share01                              |
| progress                              | None                                 |
| project_id                            | f30cd546632e484cb24414d83207694b     |
| replication_type                      | None                                 |
| revert_to_snapshot_support            | False                                |
| scheduled_to_be_deleted_at            | None                                 |
| share_group_id                        | None                                 |
| share_network_id                      | None                                 |
| share_proto                           | NFS                                  |
| share_type                            | 6a097cc3-6718-4215-bc66-bce3a74539a0 |
| share_type_name                       | default_share_type                   |
| size                                  | 10                                   |
| snapshot_id                           | None                                 |
| snapshot_support                      | False                                |
| source_backup_id                      | None                                 |
| source_share_group_snapshot_member_id | None                                 |
| status                                | creating                             |
| task_state                            | None                                 |
| user_id                               | 470c9323dad64bbea8fb5ecca6381f72     |
| volume_type                           | default_share_type                   |
+---------------------------------------+--------------------------------------+

# 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 |
+--------------------------------------+---------+------+-------------+-----------+-----------+--------------------+------+-------------------+
| 0e48eaab-65d8-497f-a5f9-9a1b511b725d | share01 |   10 | NFS         | available | False     | default_share_type |      | nova              |
+--------------------------------------+---------+------+-------------+-----------+-----------+--------------------+------+-------------------+
[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    |
+--------------------------------------+-------------+---------+------------------------------------+------------+-----------+
| 530698ed-413e-4bda-b02e-8f6f60380bd1 | Ubuntu-2204 | SHUTOFF | private=10.0.0.222, 192.168.100.79 | Ubuntu2204 | m1.medium |
+--------------------------------------+-------------+---------+------------------------------------+------------+-----------+

# set access permission first

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

+--------------+--------------------------------------+
| Field        | Value                                |
+--------------+--------------------------------------+
| id           | b0aaae1b-78a6-4af7-9ddc-383ce0219e2b |
| share_id     | 0e48eaab-65d8-497f-a5f9-9a1b511b725d |
| access_level | rw                                   |
| access_to    | 10.0.0.0/24                          |
| access_type  | ip                                   |
| state        | queued_to_apply                      |
| access_key   | None                                 |
| created_at   | 2023-10-09T00:57:30.187022           |
| 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                 |
+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+----------------------------+
| b0aaae1b-78a6-4af7-9ddc-383ce0219e2b | ip          | 10.0.0.0/24 | rw           | active | None       | 2023-10-09T00:57:30.187022 | 2023-10-09T00:57:31.191651 |
+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+----------------------------+

ubuntu@dlp ~(keystone)$
openstack server start Ubuntu-2204

# 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-b7631d20-91ef-43fe-a45a-d5bc521051d5

ubuntu@dlp ~(keystone)$
ssh ubuntu@10.0.0.222

Welcome to Ubuntu 22.04.3 LTS (GNU/Linux 5.15.0-84-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

.....
.....

# mount Manila shared storage

ubuntu@ubuntu-2204:~$
sudo mount -t nfs \
10.0.0.50:/var/lib/manila/mnt/share-b7631d20-91ef-43fe-a45a-d5bc521051d5 /mnt

ubuntu@ubuntu-2204:~$
df -hT

Filesystem                                                               Type   Size  Used Avail Use% Mounted on
tmpfs                                                                    tmpfs  392M  1.1M  391M   1% /run
/dev/vda1                                                                ext4   9.6G  1.5G  8.1G  16% /
tmpfs                                                                    tmpfs  2.0G     0  2.0G   0% /dev/shm
tmpfs                                                                    tmpfs  5.0M     0  5.0M   0% /run/lock
/dev/vda15                                                               vfat   105M  6.1M   99M   6% /boot/efi
tmpfs                                                                    tmpfs  392M  4.0K  392M   1% /run/user/1001
10.0.0.50:/var/lib/manila/mnt/share-b7631d20-91ef-43fe-a45a-d5bc521051d5 nfs4   9.8G     0  9.3G   0% /mnt
Matched Content