在已有OpenStack集羣中部署Manila(五):部署Manila Share節點之模式二(driver_handles_share_servers=True)

1、部署準備

1.1、準備flavor

爲share server準備flavor,使用自定義flavor k8s

# nova flavor-list
+--------------------------------------+-----------+------------+------+-----------+------+-------+-------------+-----------+-------------+
| ID                                   | Name      | Memory_MiB | Disk | Ephemeral | Swap | VCPUs | RXTX_Factor | Is_Public | Description |
+--------------------------------------+-----------+------------+------+-----------+------+-------+-------------+-----------+-------------+
| 1                                    | m1.tiny   | 512        | 1    | 0         | 0    | 1     | 1.0         | True      | -           |
| 2                                    | m1.small  | 2048       | 20   | 0         | 0    | 1     | 1.0         | True      | -           |
| 3                                    | m1.medium | 4096       | 40   | 0         | 0    | 2     | 1.0         | True      | -           |
| 4                                    | m1.large  | 8192       | 80   | 0         | 0    | 4     | 1.0         | True      | -           |
| 5                                    | m1.xlarge | 16384      | 160  | 0         | 0    | 8     | 1.0         | True      | -           |
| cb8238fa-a5cf-4ec9-bd1c-9677d1238d5f | k8s       | 8192       | 0    | 0         | 0    | 4     | 1.0         | True      | -           |
+--------------------------------------+-----------+------------+------+-----------+------+-------+-------------+-----------+-------------+
# openstack project list
+----------------------------------+----------+
| ID                               | Name     |
+----------------------------------+----------+
| 23a40789342d4de6bc06d0b0bef7069c | admin    |
| 99671b33717d4be5a6ee2227c39da017 | services |
+----------------------------------+----------+

# openstack domain list
+----------------------------------+---------+---------+--------------------+
| ID                               | Name    | Enabled | Description        |
+----------------------------------+---------+---------+--------------------+
| 7367afbcfbba475fafd8bfe5fda971ef | magnum  | True    |                    |
| default                          | Default | True    | The default domain |
| ee51c230767846cf8a489b25eba049b8 | heat    | True    |                    |
+----------------------------------+---------+---------+--------------------+

openstack region list
+-----------+---------------+-------------+
| Region    | Parent Region | Description |
+-----------+---------------+-------------+
| RegionOne | None          |             |
+-----------+---------------+-------------+

1.2、準備鏡像

鏡像下載

# wget https://tarballs.opendev.org/openstack/manila-image-elements/images/manila-service-image-master.qcow2 .

創建鏡像,鏡像名設置爲manila-service-image

# glance image-create --name "manila-service-image" --disk-format qcow2 --container-format bare --visibility public --progress --file manila-service-image-master.qcow2
[=============================>] 100%
+------------------+----------------------------------------------------------------------------------+
| Property         | Value                                                                            |
+------------------+----------------------------------------------------------------------------------+
| checksum         | 3267992e41cb2c149ebf29407a6be13e                                                 |
| container_format | bare                                                                             |
| created_at       | 2020-05-18T16:52:01Z                                                             |
| disk_format      | qcow2                                                                            |
| id               | cd2a1950-fe56-4230-82b0-7e8978fd30fa                                             |
| min_disk         | 0                                                                                |
| min_ram          | 0                                                                                |
| name             | manila-service-image                                                             |
| os_hash_algo     | sha512                                                                           |
| os_hash_value    | 840b96626fda8c92028e72a784a970f856d72b57c71420d14b12da91699615231fca852f5f4dd6b1 |
|                  | ed91873c54c04ca06549bf92679d58cd18ffc868d9eed5a8                                 |
| os_hidden        | False                                                                            |
| owner            | 23a40789342d4de6bc06d0b0bef7069c                                                 |
| protected        | False                                                                            |
| size             | 468058112                                                                        |
| status           | active                                                                           |
| tags             | []                                                                               |
| updated_at       | 2020-05-18T16:52:04Z                                                             |
| virtual_size     | Not available                                                                    |
| visibility       | public                                                                           |
+------------------+----------------------------------------------------------------------------------+

# glance image-list
+--------------------------------------+----------------------+
| ID                                   | Name                 |
+--------------------------------------+----------------------+
| 4d935bff-9166-47df-b2b5-fc119fd74bd5 | caas-cgsl            |
| 7e3fd7e1-b220-419e-b6cf-37ed0623e06c | caas0304             |
| 60f49cc3-0454-4f40-bbb7-bddc2961356b | centos7.7            |
| cd2a1950-fe56-4230-82b0-7e8978fd30fa | manila-service-image |
+--------------------------------------+----------------------+

2、編輯配置文件

同時支持lvm和generic存儲後端

# vi /etc/manila/manila.conf
[DEFAULT]
enabled_share_backends = lvm,generic

[generic]
share_backend_name = GENERIC
share_driver = manila.share.drivers.generic.GenericShareDriver
driver_handles_share_servers = True
service_instance_user = manila
service_instance_password = manila
interface_driver = manila.network.linux.interface.OVSInterfaceDriver
service_instance_flavor_id = cb8238fa-a5cf-4ec9-bd1c-9677d1238d5f
service_image_name = manila-service-image


[neutron]
url = http://192.168.166.180:9696
www_authenticate_uri = http://192.168.166.180:5000
auth_url = http://192.168.166.180:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = services
username = neutron
password = neutron

[nova]
www_authenticate_uri = http://192.168.166.180:5000
auth_url = http://192.168.166.180:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = services
username = nova
password = nova

[cinder]
www_authenticate_uri = http://192.168.166.180:5000
auth_url = http://192.168.166.180:5000
auth_type = password
project_domain_name = Default
user_domain_name = Default
region_name = RegionOne
project_name = services
username = cinder
password = cinder

3、重啓服務

# systemctl restart openstack-manila-share
# systemctl status openstack-manila-share
● openstack-manila-share.service - OpenStack Manila Share Service
   Loaded: loaded (/usr/lib/systemd/system/openstack-manila-share.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2020-05-18 13:08:44 EDT; 9s ago
 Main PID: 111547 (manila-share)
    Tasks: 3
   Memory: 172.0M
   CGroup: /system.slice/openstack-manila-share.service
           ├─111547 /usr/bin/python2 /usr/bin/manila-share --config-file /etc/manila/manila.conf --logfile /var/log/manila/share.log
           ├─111558 /usr/bin/python2 /usr/bin/manila-share --config-file /etc/manila/manila.conf --logfile /var/log/manila/share.log
           └─111605 /usr/bin/python2 /usr/bin/manila-share --config-file /etc/manila/manila.conf --logfile /var/log/manila/share.log

May 18 13:08:44 openstack4k8s systemd[1]: Started OpenStack Manila Share Service.
May 18 13:08:46 openstack4k8s sudo[111571]:   manila : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/manila-rootwrap /etc/manila/rootwrap.con... -o name
May 18 13:08:46 openstack4k8s sudo[111584]:   manila : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/bin/manila-rootwrap /etc/manila/rootwrap.con...-units g
Hint: Some lines were ellipsized, use -l to show in full.

因爲同時存在兩種存儲後端,所以起了三個manila-share進程

# ps -elf |grep manila-share
4 S manila   111547      1  2  80   0 - 87035 poll_s 13:08 ?        00:00:02 /usr/bin/python2 /usr/bin/manila-share --config-file /etc/manila/manila.conf --logfile /var/log/manila/share.log
1 S manila   111558 111547  2  80   0 - 95022 ep_pol 13:08 ?        00:00:02 /usr/bin/python2 /usr/bin/manila-share --config-file /etc/manila/manila.conf --logfile /var/log/manila/share.log
1 R manila   112037 111547  0  80   0 - 94162 -      13:10 ?        00:00:00 /usr/bin/python2 /usr/bin/manila-share --config-file /etc/manila/manila.conf --logfile /var/log/manila/share.log

查看日誌,已經完成了對LVMShareDriver@openstack4k8s@lvm後端和GenericShareDriver@openstack4k8s@generic的初始化

# tail -f /var/log/manila/share.log
2020-05-18 14:39:36.973 128182 INFO manila.service [-] Starting manila-share node (version 9.1.1)
2020-05-18 14:39:36.985 128106 WARNING oslo_config.cfg [req-8fe700ae-508d-4c34-8989-08b70ba611aa - - - - -] Deprecated: Option "auth_strategy" from group "DEFAULT" is deprecated. Use option "auth_strategy" from group "neutron".
2020-05-18 14:39:37.721 128181 INFO alembic.runtime.migration [req-8773080f-3f2e-4317-bb32-2fdc3a06cd3c - - - - -] Context impl MySQLImpl.
2020-05-18 14:39:37.722 128181 INFO alembic.runtime.migration [req-8773080f-3f2e-4317-bb32-2fdc3a06cd3c - - - - -] Will assume non-transactional DDL.
2020-05-18 14:39:37.724 128181 INFO manila.share.manager [req-8773080f-3f2e-4317-bb32-2fdc3a06cd3c - - - - -] Updating share status
2020-05-18 14:39:37.977 128181 INFO manila.share.manager [req-8773080f-3f2e-4317-bb32-2fdc3a06cd3c - - - - -] Finished initialization of driver: 'LVMShareDriver@openstack4k8s@lvm'
2020-05-18 14:39:38.308 128182 INFO manila.network.linux.interface [req-7c4ae438-21c5-46d4-9882-bc6cb30140eb - - - - -] Device tap512369b0-c9 does not exist - creating ....
2020-05-18 14:39:39.193 128182 INFO manila.network.linux.interface [req-7c4ae438-21c5-46d4-9882-bc6cb30140eb - - - - -] Device tap512369b0-c9 already exists.
2020-05-18 14:39:39.514 128182 INFO manila.share.manager [req-7c4ae438-21c5-46d4-9882-bc6cb30140eb - - - - -] Updating share status
2020-05-18 14:39:39.555 128182 INFO manila.share.manager [req-7c4ae438-21c5-46d4-9882-bc6cb30140eb - - - - -] Finished initialization of driver: 'GenericShareDriver@openstack4k8s@generic'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章