オプション 2 - share サーバーの管理機能ありでの共有の作成

オプション 2 - share サーバーの管理機能ありでの共有の作成

共有を作成できる状態にする前に、 DHSS モードが有効になった汎用ドライバーでは、少なくともイメージ、フレーバー、ネットワーク、 share サーバーを作成する際に使用する共有用ネットワークを定義する必要があります。 share サーバーは NFS/CIFS 共有を提供するインスタンスになります。

共有種別の作成

汎用ドライバーを使って共有を作成する前に DHSS を有効にします。

  1. 管理者クレデンシャルを読み込み、管理者専用 CLI コマンドへのアクセス権を取得します。

    $ . admin-openrc
    
  2. DHSS が有効になったデフォルトの共有種別を作成します。

    $ manila type-create generic_share_type True
    +----------------------+--------------------------------------+
    | Property             | Value                                |
    +----------------------+--------------------------------------+
    | required_extra_specs | driver_handles_share_servers : True  |
    | Name                 | generic_share_type                   |
    | Visibility           | public                               |
    | is_default           | -                                    |
    | ID                   | 3df065c8-6ca4-4b80-a5cb-e633c0439097 |
    | optional_extra_specs | snapshot_support : True              |
    +----------------------+--------------------------------------+
    

共有用ネットワークの作成

  1. demo クレデンシャルを読み込み、非管理プロジェクトとして以下の手順を実行します。

    $ . demo-openrc
    
  2. 利用可能なネットワークを一覧表示し、 selfservice ネットワークのネットワークとサブネットの ID を取得します。

    $ neutron net-list
    +--------------------------------------+-------------+-----------------------------------------------------+
    | id                                   | name        | subnets                                             |
    +--------------------------------------+-------------+-----------------------------------------------------+
    | b72d8561-aceb-4e79-938f-df3a45fdeaa3 | provider    | 072dd25f-e049-454c-9b11-359c910e6668 203.0.113.0/24 |
    | 4e963f5b-b5f3-4db1-a935-0d34c8629e7b | selfservice | 005bf8d1-798e-450f-9efe-72bc0c3be491 172.16.1.0/24  |
    +--------------------------------------+-------------+-----------------------------------------------------+
    
  3. selfservice ネットワークとサブネットの ID を使って共有用ネットワークを作成します。

    $ manila share-network-create --name selfservice-net-share1 \
      --neutron-net-id 4e963f5b-b5f3-4db1-a935-0d34c8629e7b \
      --neutron-subnet-id 005bf8d1-798e-450f-9efe-72bc0c3be491
    +-------------------+--------------------------------------+
    | Property          | Value                                |
    +-------------------+--------------------------------------+
    | name              | selfservice-net-share1               |
    | segmentation_id   | None                                 |
    | created_at        | 2016-03-31T13:25:39.052439           |
    | neutron_subnet_id | 005bf8d1-798e-450f-9efe-72bc0c3be491 |
    | updated_at        | None                                 |
    | network_type      | None                                 |
    | neutron_net_id    | 4e963f5b-b5f3-4db1-a935-0d34c8629e7b |
    | ip_version        | None                                 |
    | nova_net_id       | None                                 |
    | cidr              | None                                 |
    | project_id        | 3a46a53a377642a284e1d12efabb3b5a     |
    | id                | 997a1a0a-4f4d-4aa3-b7ae-8ae6d9aaa828 |
    | description       | None                                 |
    +-------------------+--------------------------------------+
    

共有の作成

  1. demo クレデンシャルを読み込み、非管理プロジェクトとして以下の手順を実行します。

    $ . demo-openrc
    
  2. 共有用ネットワークを使って NFS 共有を作成します。

    $ manila create NFS 1 --name share2 \
      --share-network selfservice-net-share1 \
      --share-type generic_share_type
    +-----------------------------+--------------------------------------+
    | Property                    | Value                                |
    +-----------------------------+--------------------------------------+
    | status                      | creating                             |
    | share_type_name             | generic_share_type                   |
    | description                 | None                                 |
    | availability_zone           | None                                 |
    | share_network_id            | 997a1a0a-4f4d-4aa3-b7ae-8ae6d9aaa828 |
    | host                        |                                      |
    | access_rules_status         | active                               |
    | snapshot_id                 | None                                 |
    | is_public                   | False                                |
    | task_state                  | None                                 |
    | snapshot_support            | True                                 |
    | id                          | 6a711b95-9e03-4547-8769-74e34676cb3e |
    | size                        | 1                                    |
    | name                        | share2                               |
    | share_type                  | 8698ed92-2a1c-4c9f-aab4-a35dccd88c8f |
    | has_replicas                | False                                |
    | replication_type            | None                                 |
    | created_at                  | 2016-03-31T13:45:18.000000           |
    | share_proto                 | NFS                                  |
    | consistency_group_id        | None                                 |
    | source_cgsnapshot_member_id | None                                 |
    | project_id                  | 3a46a53a377642a284e1d12efabb3b5a     |
    | metadata                    | {}                                   |
    +-----------------------------+--------------------------------------+
    
  3. 少し経つと、共有のステータスが creating から available に変わるはずです。

    $ manila list
    +--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+-----------------------------+-------------------+
    | ID                                   | Name   | Size | Share Proto | Status    | Is Public | Share Type Name    | Host                        | Availability Zone |
    +--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+-----------------------------+-------------------+
    | 5f8a0574-a95e-40ff-b898-09fd8d6a1fac | share2 | 1    | NFS         | available | False     | default_share_type | storage@generic#GENERIC     | nova              |
    +--------------------------------------+--------+------+-------------+-----------+-----------+--------------------+-----------------------------+-------------------+
    
  4. その共有の公開 IP アドレスを確認します。

    $ manila show share2
    +-----------------------------+------------------------------------------------------------------------------------+
    | Property                    | Value                                                                              |
    +-----------------------------+------------------------------------------------------------------------------------+
    | status                      | available                                                                          |
    | share_type_name             | generic_share_type                                                                 |
    | description                 | None                                                                               |
    | availability_zone           | nova                                                                               |
    | share_network_id            | None                                                                               |
    | export_locations            |                                                                                    |
    |                             | path = 10.254.0.6:/shares/share-0bfd69a1-27f0-4ef5-af17-7cd50bce6550               |
    |                             | id = 3c8d0ada-cadf-48dd-85b8-d4e8c3b1e204                                          |
    |                             | preferred = False                                                                  |
    | host                        | storage@generic#GENERIC                                                            |
    | access_rules_status         | active                                                                             |
    | snapshot_id                 | None                                                                               |
    | is_public                   | False                                                                              |
    | task_state                  | None                                                                               |
    | snapshot_support            | True                                                                               |
    | id                          | 5f8a0574-a95e-40ff-b898-09fd8d6a1fac                                               |
    | size                        | 1                                                                                  |
    | name                        | share2                                                                             |
    | share_type                  | 8a35da28-0f74-490d-afff-23664ecd4f01                                               |
    | has_replicas                | False                                                                              |
    | replication_type            | None                                                                               |
    | created_at                  | 2016-03-30T19:10:33.000000                                                         |
    | share_proto                 | NFS                                                                                |
    | consistency_group_id        | None                                                                               |
    | source_cgsnapshot_member_id | None                                                                               |
    | project_id                  | 3a46a53a377642a284e1d12efabb3b5a                                                   |
    | metadata                    | {}                                                                                 |
    +-----------------------------+------------------------------------------------------------------------------------+
    
  5. ネットワーク経由で共有をマウントする前に、新しい共有にユーザーアクセス権を設定します。

    $ manila access-allow share2 ip INSTANCE_IP_ADDRESS
    +--------------+--------------------------------------+
    | Property     | Value                                |
    +--------------+--------------------------------------+
    | share_id     | 55c401b3-3112-4294-aa9f-3cc355a4e361 |
    | access_type  | ip                                   |
    | access_to    | 172.16.1.5                           |
    | access_level | rw                                   |
    | state        | new                                  |
    | id           | f88eab01-7197-44bf-ad0f-d6ca6f99fc96 |
    +--------------+--------------------------------------+
    

    INSTANCE_IP_ADDRESS はインスタンスの IP アドレスで置き換えます。

    注釈

    インスタンスは selfservice ネットワークを使用しなければいけません。

インスタンスからの共有のマウント

  1. マウントを配置するフォルダーを作成します。

    $ mkdir ~/test_folder
    
  2. 共有の公開場所を指定して、インスタンス内で NFS 共有をマウントします。

    # mount -t nfs 10.254.0.6:/shares/share-0bfd69a1-27f0-4ef5-af17-7cd50bce6550 ~/test_folder
    

共有の管理方法の詳細は、 OpenStack エンドユーザーガイドの 共有の管理 を参照してください。

インスタンスの起動 に戻ります。

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.