Ubuntu 22.04
Sponsored Link

OpenStack Antelope : Manila का उपयोग कैसे करें2023/09/11

 
OpenStack साझा फ़ाइल सिस्टम (Manila) का उपयोग कैसे करें यह इस प्रकार है।
यह उदाहरण निम्न प्रकार से पर्यावरण पर आधारित है।
उदाहरण के लिए, स्टोरेज नोड पर एक साझा स्टोरेज के रूप में एक स्थानीय ब्लॉक डिवाइस को कॉन्फ़िगर करें और इसे इंस्टेंस पर उपयोग करें।
इसलिए, इसके लिए स्टोरेज नोड पर एक निःशुल्क ब्लॉक डिवाइस की आवश्यकता है।
------------+--------------------------+--------------------------+------------
            |                          |                          |
        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] संग्रहण नोड कॉन्फ़िगर करें।
root@network:~#
apt -y install lvm2 nfs-kernel-server
# निःशुल्क ब्लॉक डिवाइस पर Manila के लिए एक वॉल्यूम बनाएं

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
# [DEFAULT] अनुभाग में अनुसरण जोड़ें

enabled_share_backends = lvm
# अंत में जोड़ें

[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] एक डिफ़ॉल्ट शेयर प्रकार बनाएँ. किसी भी नोड पर काम करना ठीक है. (नीचे उदाहरण नियंत्रण नोड पर है)
root@dlp ~(keystone)#
manila type-create default_share_type False

+----------------------+--------------------------------------+
| Property             | Value                                |
+----------------------+--------------------------------------+
| ID                   | ec011e20-0eba-48cc-81d2-31ec2f86b232 |
| Name                 | default_share_type                   |
| Visibility           | public                               |
| is_default           | YES                                  |
| required_extra_specs | driver_handles_share_servers : False |
| optional_extra_specs |                                      |
| Description          | None                                 |
+----------------------+--------------------------------------+

root@dlp ~(keystone)#
manila type-list

+--------------------------------------+--------------------+------------+------------+--------------------------------------+----------------------+-------------+
| ID                                   | Name               | visibility | is_default | required_extra_specs                 | optional_extra_specs | Description |
+--------------------------------------+--------------------+------------+------------+--------------------------------------+----------------------+-------------+
| ec011e20-0eba-48cc-81d2-31ec2f86b232 | default_share_type | public     | YES        | driver_handles_share_servers : False |                      | None        |
+--------------------------------------+--------------------+------------+------------+--------------------------------------+----------------------+-------------+
[3] Manila NFS शेयर बनाने के लिए एक सामान्य उपयोगकर्ता के रूप में लॉगिन करें।
ubuntu@dlp ~(keystone)$
manila create NFS 10 --name share01 --share-type default_share_type

+---------------------------------------+--------------------------------------+
| Property                              | Value                                |
+---------------------------------------+--------------------------------------+
| id                                    | d78ad753-2bbe-4079-a91e-9c5ba2f9592a |
| size                                  | 10                                   |
| availability_zone                     | None                                 |
| created_at                            | 2023-03-28T00:52:10.747828           |
| status                                | creating                             |
| name                                  | share01                              |
| description                           | None                                 |
| project_id                            | e294bd7c00314facacdb46c36fb54ee9     |
| snapshot_id                           | None                                 |
| share_network_id                      | None                                 |
| share_proto                           | NFS                                  |
| metadata                              | {}                                   |
| share_type                            | ec011e20-0eba-48cc-81d2-31ec2f86b232 |
| 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                               | 85236576a97e492791abe70c217c8898     |
| 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                                 |
+---------------------------------------+--------------------------------------+

# ठीक है यदि स्थिति कुछ मिनटों के बाद [available] में बदल जाती है

ubuntu@dlp ~(keystone)$
manila list

+--------------------------------------+---------+------+-------------+-----------+-----------+--------------------+------+-------------------+
| ID                                   | Name    | Size | Share Proto | Status    | Is Public | Share Type Name    | Host | Availability Zone |
+--------------------------------------+---------+------+-------------+-----------+-----------+--------------------+------+-------------------+
| d78ad753-2bbe-4079-a91e-9c5ba2f9592a | share01 | 10   | NFS         | available | False     | default_share_type |      | nova              |
+--------------------------------------+---------+------+-------------+-----------+-----------+--------------------+------+-------------------+
[4] यह ठीक है, आप निम्न प्रकार से अपने उदाहरणों पर Manila साझा फ़ाइल सिस्टम का उपयोग कर सकते हैं।
ubuntu@dlp ~(keystone)$
openstack server list

+--------------------------------------+-------------+---------+-------------------------------------+------------+-----------+
| ID                                   | Name        | Status  | Networks                            | Image      | Flavor    |
+--------------------------------------+-------------+---------+-------------------------------------+------------+-----------+
| 11987eec-fb38-4de1-a386-3d1d6001bbd3 | Ubuntu-2204 | SHUTOFF | private=10.0.0.252, 192.168.100.100 | Ubuntu2204 | m1.medium |
+--------------------------------------+-------------+---------+-------------------------------------+------------+-----------+

# पहले एक्सेस अनुमति सेट करें

ubuntu@dlp ~(keystone)$
manila access-allow share01 ip 10.0.0.0/24 --access-level rw

+--------------+--------------------------------------+
| Property     | Value                                |
+--------------+--------------------------------------+
| id           | 74f53ec9-02dc-46d6-acbd-c54be5bc2bfa |
| share_id     | d78ad753-2bbe-4079-a91e-9c5ba2f9592a |
| access_level | rw                                   |
| access_to    | 10.0.0.0/24                          |
| access_type  | ip                                   |
| state        | queued_to_apply                      |
| access_key   | None                                 |
| created_at   | 2023-03-28T00:54:02.053323           |
| updated_at   | None                                 |
| metadata     | {}                                   |
+--------------+--------------------------------------+

# यदि राज्य [active] में बदल जाए तो ठीक है

ubuntu@dlp ~(keystone)$
manila access-list share01

+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+
| id                                   | access_type | access_to   | access_level | state  | access_key | created_at                 | updated_at |
+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+
| 74f53ec9-02dc-46d6-acbd-c54be5bc2bfa | ip          | 10.0.0.0/24 | rw           | active | None       | 2023-03-28T00:54:02.053323 | None       |
+--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+

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

# पहुंच पथ की पुष्टि करें

ubuntu@dlp ~(keystone)$
manila show share01 | grep path | cut -d'|' -f3

 path = 10.0.0.50:/var/lib/manila/mnt/share-37de3e89-629a-4aa2-9a23-2dedba027e05

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

Welcome to Ubuntu 22.04.2 LTS (GNU/Linux 5.15.0-67-generic x86_64)

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

.....
.....

# माउंट Manila साझा भंडारण

ubuntu@ubuntu-2204:~$
sudo mount -t nfs \
10.0.0.50:/var/lib/manila/mnt/share-37de3e89-629a-4aa2-9a23-2dedba027e05 /mnt

ubuntu@ubuntu-2204:~$
df -hT

Filesystem                                                               Type   Size  Used Avail Use% Mounted on
tmpfs                                                                    tmpfs  393M  1.1M  392M   1% /run
/dev/vda1                                                                ext4   9.6G  1.7G  7.9G  18% /
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  393M  4.0K  393M   1% /run/user/1000
10.0.0.50:/var/lib/manila/mnt/share-37de3e89-629a-4aa2-9a23-2dedba027e05 nfs4    76G  8.3G   64G  12% /mnt
मिलान सामग्री