Openstack配置手册-Manila

snow chuai汇总、整理、撰写---2020/2/6


1. 拓扑
     ------------+---------------------------+---------------------------+------------
                 |                           |                           |
             eth0|192.168.10.11          eth0|192.168.10.12          eth0|192.168.10.13
     +-----------+-----------+   +-----------+-----------+   +-----------+-----------+
     |    [ Control Node ]   |   |    [ Compute Node ]   |   |   [ Storage Node ]    |
     |   [node1.1000cc.net]  |   |   [node2.1000cc.net]  |   |  [node3.1000cc.net]   |
     |  MariaDB    RabbitMQ  |   |         ibvirt        |   |      Open vSwitch     |
     |  Memcached  httpd     |   |       Nova Compute    |   |        L2 Agent       |
     |  Keystone   Glance    |   |       Open vSwitch    |   |        L3 Agent       |
     |  Nova API             |   |        L2 Agent       |   |     Metadata Agent    |
     |  Neutron Server       |   |                       |   |      Manila Share     |
     |  Metadata Agent       |   |                       |   |                       |
     |  Manila API           |   |                       |   |                       |
     +-----------------------+   +-----------------------+   +-----------------------+
2. 在控制节点设置Manila
2.1 设定keystone信息及endpoint
1) 创建服务及设定相关账户等信息
[root@node1 ~(keystone)]# openstack user create --domain default --project service --password servicepassword manila
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| default_project_id  | 1be75e85ec9445ab9ff7dd7ec2f02b71 |
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 21e7f54d3a1b4e5583ddda88f0f07fae |
| name                | manila                           |
| options             | {}                               |
| password_expires_at | None                             |
+---------------------+----------------------------------+
[root@node1 ~(keystone)]# openstack role add --project service --user manila admin
[root@node1 ~(keystone)]# openstack service create --name manila --description "OpenStack Shared Filesystem" share +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Shared Filesystem | | enabled | True | | id | 45cae52de70c493da5d21e1f7d158193 | | name | manila | | type | share | +-------------+----------------------------------+
[root@node1 ~(keystone)]# openstack service create --name manilav2 --description "OpenStack Shared Filesystem V2" sharev2 +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | OpenStack Shared Filesystem V2 | | enabled | True | | id | f1b0d591141d471499fa2b75e6b77538 | | name | manilav2 | | type | sharev2 | +-------------+----------------------------------+
2) 设定endpoint信息 [root@node1 ~(keystone)]# openstack endpoint create --region RegionOne share public http://192.168.10.11:8786/v1/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 10bacc81378747ac9071612e6604b04d | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 45cae52de70c493da5d21e1f7d158193 | | service_name | manila | | service_type | share | | url | http://192.168.10.11:8786/v1/%(tenant_id)s | +--------------+--------------------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne share internal http://192.168.10.11:8786/v1/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 759b7ea8b200406ebdfe1373ff38cb2f | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | 45cae52de70c493da5d21e1f7d158193 | | service_name | manila | | service_type | share | | url | http://192.168.10.11:8786/v1/%(tenant_id)s | +--------------+--------------------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne share admin http://192.168.10.11:8786/v1/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 172ad30a58b549a9b5abd52abc657650 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 45cae52de70c493da5d21e1f7d158193 | | service_name | manila | | service_type | share | | url | http://192.168.10.11:8786/v1/%(tenant_id)s | +--------------+--------------------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne sharev2 public http://192.168.10.11:8786/v2/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 59b3525e321c41bab9c174790fbf823a | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | f1b0d591141d471499fa2b75e6b77538 | | service_name | manilav2 | | service_type | sharev2 | | url | http://192.168.10.11:8786/v2/%(tenant_id)s | +--------------+--------------------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne sharev2 internal http://192.168.10.11:8786/v2/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | c261a0391b4b41a28c06d2b7b0fc5b5f | | interface | internal | | region | RegionOne | | region_id | RegionOne | | service_id | f1b0d591141d471499fa2b75e6b77538 | | service_name | manilav2 | | service_type | sharev2 | | url | http://192.168.10.11:8786/v2/%(tenant_id)s | +--------------+--------------------------------------------+
[root@node1 ~(keystone)]# openstack endpoint create --region RegionOne sharev2 admin http://192.168.10.11:8786/v2/%\(tenant_id\)s +--------------+--------------------------------------------+ | Field | Value | +--------------+--------------------------------------------+ | enabled | True | | id | 539de46401d74899802b968ee3798448 | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | f1b0d591141d471499fa2b75e6b77538 | | service_name | manilav2 | | service_type | sharev2 | | url | http://192.168.10.11:8786/v2/%(tenant_id)s | +--------------+--------------------------------------------+
2.2 设定数据库
[root@node1 ~(keystone)]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 461
Server version: 10.1.20-MariaDB MariaDB Server
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> create database manila; Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on manila.* to manila@'localhost' identified by 'password'; Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> grant all privileges on manila.* to manila@'%' identified by 'password'; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> exit Bye
2.3 安装Manila服务并配置及启动
1) 安装Manila服务
[root@node1 ~(keystone)]# yum --enablerepo=centos-openstack-queens,epel install openstack-manila python-manilaclient -y
2) 配置Manila服务 [root@node1 ~(keystone)]# mv /etc/manila/manila.conf /etc/manila/manila.conf.bak [root@node1 ~(keystone)]# vim /etc/manila/manila.conf [DEFAULT] # 设定本机地址 my_ip = 192.168.10.11 api_paste_config = /etc/manila/api-paste.ini rootwrap_config = /etc/manila/rootwrap.conf state_path = /var/lib/manila auth_strategy = keystone default_share_type = default_share_type share_name_template = share-%s
transport_url = rabbit://openstack:password@192.168.10.11
[database] connection = mysql+pymysql://manila:password@192.168.10.11/manila
[keystone_authtoken] www_authenticate_uri = http://192.168.10.11:5000 auth_url = http://192.168.10.11:5000 memcached_servers = 192.168.10.11:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = manila password = servicepassword
[oslo_concurrency] lock_path = $state_path/tmp

[root@node1 ~(keystone)]# chmod 640 /etc/manila/manila.conf [root@node1 ~(keystone)]# chgrp manila /etc/manila/manila.conf [root@node1 ~(keystone)]# su -s /bin/bash manila -c "manila-manage db sync" [root@node1 ~(keystone)]# systemctl enable --now openstack-manila-api openstack-manila-scheduler [root@node1 ~(keystone)]# manila service-list +----+------------------+------------------+------+---------+-------+----------------------------+ | Id | Binary | Host | Zone | Status | State | Updated_at | +----+------------------+------------------+------+---------+-------+----------------------------+ | 1 | manila-scheduler | node1.1000cc.net | nova | enabled | up | 2020-02-06T00:50:48.000000 | +----+------------------+------------------+------+---------+-------+----------------------------+
3) 配置防火墙 [root@node1 ~(keystone)]# firewall-cmd --add-port=8786/tcp --permanent success [root@node1 ~(keystone)]# firewall-cmd --reload success
3. 在存储节点设置Manila
3.1 添加Manila Share到存储节点
[root@node3 ~]# yum --enablerepo=centos-openstack-queens,epel install openstack-manila-share python-manilaclient -y
3.2 配置Manila Share服务
[root@node3 ~]# mv /etc/manila/manila.conf /etc/manila/manila.conf.bak
[root@node3 ~]# vim /etc/manila/manila.conf
[DEFAULT]
my_ip = 192.168.10.13
api_paste_config = /etc/manila/api-paste.ini
rootwrap_config = /etc/manila/rootwrap.conf
state_path = /var/lib/manila
auth_strategy = keystone
default_share_type = default_share_type
enabled_share_protocols = NFS
transport_url = rabbit://openstack:password@192.168.10.11
[database] connection = mysql+pymysql://manila:password@192.168.10.11/manila
[keystone_authtoken] www_authenticate_uri = http://192.168.10.11:5000 auth_url = http://192.168.10.11:5000 memcached_servers = 192.168.10.11:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = manila password = servicepassword
[oslo_concurrency] lock_path = $state_path/tmp

[root@node3 ~]# chmod 640 /etc/manila/manila.conf [root@node3 ~]# chgrp manila /etc/manila/manila.conf [root@node3 ~]# mkdir /var/lib/manila [root@node3 ~]# chown manila. /var/lib/manila
# 防火墙设定 [root@node3 ~]# firewall-cmd --add-service=nfs --permanent success [root@node3 ~]# firewall-cmd --reload success
4. 在本地主机使用Manila
4.1 安装及配置Manila
1) 安装nfs相关工具
[root@node3 ~]# yum install nfs-utils nfs4-acl-tools -y
2) 创建vg [root@node3 ~]# pvcreate /dev/vdd1 Physical volume "/dev/vdd1" successfully created. [root@node3 ~]# vgcreate manila-volumes /dev/vdd1 Volume group "manila-volumes" successfully created
3) 配置manila [root@node3 ~]# vim /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 = 192.168.10.13
[root@node3 ~]# systemctl enable --now openstack-manila-share nfs-server
4.2 使用Manila
1) 创建Manila存储
[root@node1 ~(keystone)]# manila type-create default_share_type False
+----------------------+--------------------------------------+
| Property             | Value                                |
+----------------------+--------------------------------------+
| required_extra_specs | driver_handles_share_servers : False |
| Name                 | default_share_type                   |
| Visibility           | public                               |
| is_default           | -                                    |
| ID                   | 92f7fd22-693f-463d-942a-53cd3eab93fb |
| optional_extra_specs |                                      |
| Description          | None                                 |
+----------------------+--------------------------------------+
[root@node1 ~(keystone)]# manila type-list +--------+--------------------+------------+------------+----------------------+------------------- | ID | Name | visibility | is_default | required_extra_specs | optional_ex +------------------------------------------+------------+----------------------+-----------+------- | 92f7... | default_share_type | public | YES | driver_handles_share_servers : False | .. +---------+--------------------+--------+-----+--------------------------------------+-------------
[root@node1 ~(keystone)]# su - snow [snow@node1 ~(keystone)]$ manila create NFS 1 --name share1 +---------------------------------------+--------------------------------------+ | Property | Value | +---------------------------------------+--------------------------------------+ | status | creating | | share_type_name | default_share_type | | description | None | | availability_zone | None | | share_network_id | None | | share_group_id | None | | revert_to_snapshot_support | False | | access_rules_status | active | | snapshot_id | None | | create_share_from_snapshot_support | False | | is_public | False | | task_state | None | | snapshot_support | False | | id | d65d773c-4e04-4c2d-9f88-e65a33716fb2 | | size | 1 | | source_share_group_snapshot_member_id | None | | user_id | 54f3ece13d6147928303ef4112e1f0e9 | | name | share1 | | share_type | 92f7fd22-693f-463d-942a-53cd3eab93fb | | has_replicas | False | | replication_type | None | | created_at | 2020-02-06T01:23:40.000000 | | share_proto | NFS | | mount_snapshot_support | False | | project_id | 7146a34d5b744320b2ed45af5b2e761b | | metadata | {} | +---------------------------------------+--------------------------------------+
[snow@node1 ~(keystone)]$ manila list +--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+------+-------------------+ | ID | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone | +--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+------+-------------------+ | d835e614-da76-46d8-a5c5-101fa7543044 | share1 | 1 | NFS | available | False | default_share_type | | nova | +--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+------+-------------------+
2) 设定Manila存储 [snow@node1 ~(keystone)]$ openstack server list +--------------------------------------+------+--------+---------------------------------------+-------+----------+ | ID | Name | Status | Networks | Image | Flavor | +--------------------------------------+------+--------+---------------------------------------+-------+----------+ | 1bc4c9dd-ec97-44ca-aac8-8ed9b95778b8 | c7 | ACTIVE | int_net=192.168.188.5, 192.168.10.223 | c77 | m1.small | +--------------------------------------+------+--------+---------------------------------------+-------+----------+
# 设置访问权限及读写权限 [snow@node1 ~(keystone)]$ manila access-allow share1 ip 192.168.10.0/24 --access-level rw +--------------+--------------------------------------+ | Property | Value | +--------------+--------------------------------------+ | access_key | None | | share_id | d835e614-da76-46d8-a5c5-101fa7543044 | | created_at | 2020-02-06T15:35:45.000000 | | updated_at | None | | access_type | ip | | access_to | 192.168.10.0/24 | | access_level | rw | | state | queued_to_apply | | id | 979e4ab3-de30-4720-8451-a3c1004b250f | +--------------+--------------------------------------+
[snow@node1 ~(keystone)]$ manila access-list share1 +-------+--------------+-----------------+--------------+--------+------------+------------------ | id | access_type | access_to | access_level | state | access_key | ...... +--------+-------------+-----------------+--------------+--------+------------+------------------- | 979e.. | ip | 192.168.10.0/24 | rw | active | None | ...... +--------+-------------+-----------------+--------------+--------+------------+--------------------
3) 将存储连接至实例 # 获取访问路径 [snow@node1 ~(keystone)]$ manila show share1 | grep path | cut -d'|' -f3 path = 192.168.10.13:/var/lib/manila/mnt/share-9a851ded-9e36-4882-b785-3fdbd09f2306
# 获取访问路径 [snow@node1 ~(keystone)]$ ssh centos@192.168.10.223 [centos@c7 ~]$ sudo yum install nfs-utils -y [centos@c7 ~]$ sudo mount -t nfs 192.168.10.13:/var/lib/manila/mnt/share-9a851ded-9e36-4882-b785-3fdbd09f2306 /mnt [centos@c7 ~]$ df -Th | grep /mnt 192.168.10.13:/var/lib/manila/mnt/share-...... nfs4 976M 2.5M 907M 1% /mnt
5. 使用Manila(实例)
5.1 配置存储节点
1) 先完成Cinder节点的配置,配置好任何一个存储类型即可(LVM/NFS)并启动服务。
2) 编写Manila配置文件 [root@node3 ~]# vim /etc/manila/manila.conf ...... ...... ...... ...... ...... ......
# 于[DEFAULT] 添加如下信息 enabled_share_backends = lvm,generic # 或 enabled_share_backends = generic
...... ...... ...... ...... ...... ......
# 于最近最后添加如下信息 [neutron] url = http://192.168.10.11:9696 auth_url = http://192.168.10.11:5000 memcached_servers = 192.168.10.11:11211 # 注销[DEFAULT]区段的auth_strategy,在此下面添加这个信息 auth_strategy = keystone auth_type = password project_domain_name = default user_domain_name = default region_name = RegionOne project_name = service username = neutron password = servicepassword
[nova] auth_url = http://192.168.10.11:5000 memcached_servers = 192.168.10.11:11211 auth_type = password project_domain_name = default user_domain_name = default region_name = RegionOne project_name = service username = nova password = servicepassword
[cinder] auth_url = http://192.168.10.11:5000 memcached_servers = 192.168.10.11:11211 auth_type = password project_domain_name = default user_domain_name = default region_name = RegionOne project_name = service username = cinder password = servicepassword
[generic] share_backend_name = backend01 share_driver = manila.share.drivers.generic.GenericShareDriver driver_handles_share_servers = True service_instance_flavor_id = 0 service_instance_security_group = manila-service service_image_name = manila-service-image service_instance_user = manila service_instance_password = manila interface_driver = manila.network.linux.interface.OVSInterfaceDriver

[root@node3 ~]# systemctl enable --now openstack-manila-share
5.2 在控制节点建立Manila Share及设定相关信息
1) 下载manila镜像
[root@node1 ~(keystone)]# curl -O http://tarballs.openstack.org/manila-image-elements/images/manila-service-image-master.qcow2
2) 将manila镜像注册到glance中 [root@node1 ~(keystone)]# openstack image create "manila-service-image" --file manila-service-image-master.qcow2 --disk-format qcow2 --container-format bare --public +------------------+------------------------------------------------------+ | Field | Value | +------------------+------------------------------------------------------+ | checksum | f8a6cbff57ee1f91e05e576d88057dbe | | container_format | bare | | created_at | 2020-02-06T16:23:48Z | | disk_format | qcow2 | | file | /v2/images/17bec041-f596-49e2-b8f9-ba039d45b5c4/file | | id | 17bec041-f596-49e2-b8f9-ba039d45b5c4 | | min_disk | 0 | | min_ram | 0 | | name | manila-service-image | | owner | 6f83afcc475b440bb9816ea20ba26c5f | | protected | False | | schema | /v2/schemas/image | | size | 441342976 | | status | active | | tags | | | updated_at | 2020-02-06T16:23:52Z | | virtual_size | None | | visibility | public | +------------------+------------------------------------------------------+
3) 设定Manila安全组 [root@node1 ~(keystone)]# openstack security group create manila-service +-----------------+----------------------------------------+ | Field | Value | +-----------------+----------------------------------------+ | created_at | 2020-02-06T16:25:24Z | | description | manila-service | | id | c87cc750-c338-4d4a-801a-c1384805c244 | | name | manila-service | | project_id | 6f83afcc475b440bb9816ea20ba26c5f | | revision_number | 2 | | rules | created_at='2020-02-06T16:25:24Z',... | | | created_at='2020-02-06T16:25:24Z', ... | | updated_at | 2020-02-06T16:25:24Z | +-----------------+----------------------------------------+
root@node1 ~(keystone)# openstack security group rule create --protocol icmp --ingress manila-service root@node1 ~(keystone)# openstack security group rule create --protocol tcp --dst-port 22:22 manila-service root@node1 ~(keystone)# openstack security group rule create --protocol tcp --dst-port 2049:2049 manila-service
4) 创建Manila类型 # 删除原有的共享磁盘和类型 [root@node1 ~(keystone)]# manila type-create default_share_type True +----------------------+--------------------------------------+ | Property | Value | +----------------------+--------------------------------------+ | required_extra_specs | driver_handles_share_servers : True | | Name | default_share_type | | Visibility | public | | is_default | - | | ID | 5bf4e06a-2f26-44d3-9bf5-eaa70e3d9812 | | optional_extra_specs | | | Description | None | +----------------------+--------------------------------------+
[root@node1 ~(keystone)]# manila type-list +-----------+--------------------+------------+------------+-------------------------------------+- | ID | Name | visibility | is_default | required_extra_specs | +-----------+--------------------+------------+------------+-------------------------------------+- | d7dfe7a0- | default_share_type | public | YES | driver_handles_share_servers : True | +-----------+--------------------+------------+------------+-------------------------------------+-
5) 创建Manila网络 [root@node1 ~(keystone)]# su - snow [snow@node1 ~(keystone)]$ openstack network list +--------------------------------------+---------+--------------------------------------+ | ID | Name | Subnets | +--------------------------------------+---------+--------------------------------------+ | 939def15-81bb-4ad1-babc-f95bbd93d306 | ext_net | 1fe4b0c8-4e38-44e6-a518-c978cbeb65d4 | | cb730b51-1289-40af-bb6d-dfb86fa91e63 | int_net | 6bc229eb-e0bd-4336-a84e-597888da1ed4 | +--------------------------------------+---------+--------------------------------------+
[snow@node1 ~(keystone)]$ openstack subnet list +--------------------------------------+---------+--------------------------------------+------------------+ | ID | Name | Network | Subnet | +--------------------------------------+---------+--------------------------------------+------------------+ | 6bc229eb-e0bd-4336-a84e-597888da1ed4 | subnet1 | cb730b51-1289-40af-bb6d-dfb86fa91e63 | 192.168.188.0/24 | +--------------------------------------+---------+--------------------------------------+------------------+
[snow@node1 ~(keystone)]$ INT_NET=$(openstack network list | grep 'int_net' | awk '{print $2}') [snow@node1 ~(keystone)]$ INT_SUBNET=$(openstack subnet list | grep 'subnet1' | awk '{print $2}')
[snow@node1 ~(keystone)]$ manila share-network-create --neutron-net-id $INT_NET \ --neutron-subnet-id $INT_SUBNET --name manila_share +-------------------+--------------------------------------+ | Property | Value | +-------------------+--------------------------------------+ | network_type | None | | name | manila_share | | segmentation_id | None | | created_at | 2020-02-06T16:35:36.082411 | | neutron_subnet_id | 6bc229eb-e0bd-4336-a84e-597888da1ed4 | | updated_at | None | | mtu | None | | gateway | None | | neutron_net_id | cb730b51-1289-40af-bb6d-dfb86fa91e63 | | ip_version | None | | cidr | None | | project_id | 7146a34d5b744320b2ed45af5b2e761b | | id | 2528ad70-c662-46e8-9829-90e558d7d191 | | description | None | +-------------------+--------------------------------------+
[snow@node1 ~(keystone)]$ manila share-network-list +--------------------------------------+--------------+ | id | name | +--------------------------------------+--------------+ | 2528ad70-c662-46e8-9829-90e558d7d191 | manila_share | +--------------------------------------+--------------+
6) 使用Manila [snow@node1 ~(keystone)]$ manila create NFS 1 --name share01 --share-network manila_share +---------------------------------------+--------------------------------------+ | Property | Value | +---------------------------------------+--------------------------------------+ | status | creating | | share_type_name | default_share_type | | description | None | | availability_zone | None | | share_network_id | 2528ad70-c662-46e8-9829-90e558d7d191 | | share_group_id | None | | revert_to_snapshot_support | False | | access_rules_status | active | | snapshot_id | None | | create_share_from_snapshot_support | False | | is_public | False | | task_state | None | | snapshot_support | False | | id | 8e9909a5-24d8-460f-8c97-3e986bac0c4d | | size | 1 | | source_share_group_snapshot_member_id | None | | user_id | 54f3ece13d6147928303ef4112e1f0e9 | | name | share1 | | share_type | 5bf4e06a-2f26-44d3-9bf5-eaa70e3d9812 | | has_replicas | False | | replication_type | None | | created_at | 2020-02-06T16:38:52.000000 | | share_proto | NFS | | mount_snapshot_support | False | | project_id | 7146a34d5b744320b2ed45af5b2e761b | | metadata | {} | +---------------------------------------+--------------------------------------+
[cent@node1 ~(keystone)]$ anila list +---------+---------+------+-------------+-----------+-----------+--------------------+------+---------+ | ID | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Avai... | +---------+---------+------+-------------+-----------+-----------+--------------------+------+---------+ | 3616... | share01 | 1 | NFS | available | False | default_share_type | | nova | +---------+---------+------+-------------+-----------+-----------+--------------------+------+---------+
7) Manila在存储节点建立了一个10.254.0.0/28的网络段 [root@node3 ~]# ip addr ..... ..... 15: tap9f031cc4-41: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000 link/ether fa:16:3e:e0:00:05 brd ff:ff:ff:ff:ff:ff inet 10.254.0.3/28 brd 10.254.0.15 scope global tap9f031cc4-41 valid_lft forever preferred_lft forever inet6 fe80::f816:3eff:fee0:5/64 scope link valid_lft forever preferred_lft forever
8) Manila连接实例 (1) 确认实例 [snow@node1 ~(keystone)]$ openstack server list +-----------+------+---------+---------------------------------------+---------+----------+ | ID | Name | Status | Networks | Image | Flavor | +-----------+------+---------+---------------------------------------+---------+----------+ | 1bc4c9dd- | c7 | SHUTOFF | int_net=192.168.188.5, 192.168.10.223 | c77 | m1.small | +-----------+------+---------+---------------------------------------+---------+----------+
(2) 允许192.168.10.0/24网络段访问存储 [snow@node1 ~(keystone)]$ manila access-allow share01 ip 192.168.188.0/24 --access-level rw +--------------+--------------------------------------+ | Property | Value | +--------------+--------------------------------------+ | access_key | None | | share_id | 36165396-54d0-44f4-b32c-ebd06d52b3ea | | created_at | 2020-02-06T18:40:52.000000 | | updated_at | None | | access_type | ip | | access_to | 192.168.188.0/24 | | access_level | rw | | state | queued_to_apply | | id | 179c90e7-c080-4e1b-a117-aca45c4d8d30 | +--------------+--------------------------------------+
# 确认权限 [snow@node1 ~(keystone)]$ manila access-list share01
# 启动实例 [snow@node1 ~(keystone)]$ openstack server start c7
9) 挂载Manila存储 # 查看访问路径 [snow@node1 ~(keystone)]$ manila show share01 | grep path | cut -d'|' -f3
[snow@node1 ~(keystone)]$ ssh centos@192.168.10.223 [centos@c7 ~]$ sudo mount -t nfs 10.254.0.3:/shares/share-6290c4d9-9ae9-4be9-bd59-4ce8ca2e06f5 /mnt
[centos@c7 ~]$ df -Th | grep /mnt 10.254.0.3:/shares/share-6290c4d9-9ae9-4be9-bd59-4ce8ca2e06f5 nfs4 976M 1.3M 908M 1% /mnt

 

如对您有帮助,请随缘打个赏。^-^

gold