Set up Shared Filesystems service with generic driver¶
This section provides the necessary steps to prepare your environment for working with the MOSK Shared Filesystems service (OpenStack Manila), create a share network, configure share file systems, and grant access to clients. By following these instructions, you will ensure that your system is properly set up to manage and mount shared resources using Manila with the generic driver.
Prepare an environment to work with Manila¶
Create a share network:
openstack share network create --name <share-network-name> \ --neutron-net-id <neutron-net-id> \ --neutron-subnet-id <neutron-subnet-id>
For example, use the command below to create the
demo_share_net
share network with the followingneutron-net-id
andneutron-subnet-id
:2a23fceb-eeed-439c-8506-ef489362d1ee
is the ID of thedemo_net
network which the virtual machine is connected to479b27e4-0b73-4f8d-a838-d330d72578ea
is the ID of thedemo_subnet
subnet of thedemo_net
network, which is connected to a public router
openstack share network create --name demo_share_net \ --neutron-net-id 2a23fceb-eeed-439c-8506-ef489362d1ee \ --neutron-subnet-id 479b27e4-0b73-4f8d-a838-d330d72578ea
Example of a positive system response:
+---------------------------------+----------------------------------------------------------+ | Field | Value | +---------------------------------+----------------------------------------------------------+ | created_at | 2022-11-23T15:24:16.291622 | | description | None | | id | 52438b02-7a06-4dfc-a0a9-cbc773bd4389 | | name | demo_share_net | | project_id | 6a1e7dfe64164fb884e146634a84b204 | | security_service_update_support | True | | share_network_subnets | | | | id = bfa7e38f-2132-4c13-85d4-bf51085f6360 | | | availability_zone = None | | | created_at = 2022-11-23T15:24:16.336306 | | | updated_at = None | | | segmentation_id = None | | | neutron_net_id = 2a23fceb-eeed-439c-8506-ef489362d1ee | | | neutron_subnet_id = 479b27e4-0b73-4f8d-a838-d330d72578ea | | | ip_version = None | | | cidr = None | | | network_type = None | | | mtu = None | | | gateway = None | | status | active | | updated_at | None | +---------------------------------+----------------------------------------------------------+
Verify that the share network has been successfully created:
openstack share network list
Example of a positive system response:
+--------------------------------------+----------------+ | ID | Name | +--------------------------------------+----------------+ | 52438b02-7a06-4dfc-a0a9-cbc773bd4389 | demo_share_net | +--------------------------------------+----------------+
Create a share file system and grant access to it¶
Create a 1 GB NFS share:
openstack share create --name <share-name> NFS 1 \ --share-network <share-network-name>
For example, to create the
demo_share
share:openstack share create --name demo_share NFS 1 --share-network demo_share_net
Example of a positive system response:
+---------------------------------------+--------------------------------------+ | Field | Value | +---------------------------------------+--------------------------------------+ | access_rules_status | active | | availability_zone | None | | create_share_from_snapshot_support | False | | created_at | 2022-11-23T15:34:28.604430 | | description | None | | has_replicas | False | | host | | | id | 9e864fc8-c3f6-464e-a91f-3aad236b1c8d | | is_public | False | | is_soft_deleted | False | | metadata | {} | | mount_snapshot_support | False | | name | demo_share | | progress | None | | project_id | 6a1e7dfe64164fb884e146634a84b204 | | replication_type | None | | revert_to_snapshot_support | False | | scheduled_to_be_deleted_at | None | | share_group_id | None | | share_network_id | 52438b02-7a06-4dfc-a0a9-cbc773bd4389 | | share_proto | NFS | | share_server_id | None | | share_type | dbbca99c-268e-490a-b4de-b420d407e4d7 | | share_type_name | default | | size | 1 | | snapshot_id | None | | snapshot_support | False | | source_share_group_snapshot_member_id | None | | status | creating | | task_state | None | | user_id | c2a226097e1f442dbbd065534e61c20a | | volume_type | default | +---------------------------------------+--------------------------------------+
Verify that the share creation has been finalized:
openstack share list
Example of a positive system response:
+--------------------------------------+------------+------+-------------+-----------+-----------+-----------------+-----------------------------------------------------------------------+-------------------+ | ID | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone | +--------------------------------------+------------+------+-------------+-----------+-----------+-----------------+-----------------------------------------------------------------------+-------------------+ | 9e864fc8-c3f6-464e-a91f-3aad236b1c8d | demo_share | 1 | NFS | available | False | default | ok-rs-vwiza7ejeugp-1-swk6jtqte3gp-server-ovr6zpdtas6y@generic#GENERIC | nova | +--------------------------------------+------------+------+-------------+-----------+-----------+-----------------+-----------------------------------------------------------------------+-------------------+
Grant the
rw
access to the virtual machine:openstack share access create <share-name> ip <VM-IP> --access-level rw
For example:
openstack share access create demo_share ip 192.0.2.59 --access-level rw
Example of a positive system response:
+--------------+--------------------------------------+ | Field | Value | +--------------+--------------------------------------+ | id | b356fdd2-b019-4fef-95da-93bc7a6e407d | | share_id | 9e864fc8-c3f6-464e-a91f-3aad236b1c8d | | access_level | rw | | access_to | 192.0.2.59 | | access_type | ip | | state | queued_to_apply | | access_key | None | | created_at | 2022-11-23T15:40:42.540847 | | updated_at | None | | properties | | +--------------+--------------------------------------+
List grants for the share you created:
openstack share access list <share-name>
For example, to list the grants for the
demo_share
share:openstack share access list demo_share +--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+ | ID | Access Type | Access To | Access Level | State | Access Key | Created At | Updated At | +--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+ | b356fdd2-b019-4fef-95da-93bc7a6e407d | ip | 192.0.2.59 | rw | active | None | 2022-11-23T15:40:42.540847 | None | +--------------------------------------+-------------+-------------+--------------+--------+------------+----------------------------+------------+
Connect the share to the virtual machine¶
Obtain the share URL:
openstack share show <share-name> -c export_locations -f value
For example, to obtain the
demo_share
URL:openstack share show demo_share -c export_locations -f value
Example of a positive system response where the URL is
10.254.0.68:/shares/share-04c212a4-a547-4f06-b8eb-3b5006878c6e
:id = 29b59502-6165-4ec5-b174-76553490510c path = 10.254.0.68:/shares/share-04c212a4-a547-4f06-b8eb-3b5006878c6e preferred = False share_instance_id = 04c212a4-a547-4f06-b8eb-3b5006878c6e is_admin_only = False id = a6fb11a1-d015-4de3-8b30-98e0d2027c02 path = 10.254.0.68:/shares/share-04c212a4-a547-4f06-b8eb-3b5006878c6e preferred = False share_instance_id = 04c212a4-a547-4f06-b8eb-3b5006878c6e is_admin_only = True
Log in to the virtual machine using the share URL obtained in the previous step and run as root:
mount -t nfs <share-URL> /mnt/
Verify that the share is mounted and has a property size:
df -h /mnt
Example of a positive system response:
Filesystem Size Used Avail Use% Mounted on 10.254.0.68:/shares/share-04c212a4-a547-4f06-b8eb-3b5006878c6e 974M 0 907M 0% /mnt