To use Manila via OpenStack API

This document assumes you have Openstack and Manila clients installed on your machine.

Look here for more information: https://iujetstream.atlassian.net/wiki/spaces/JWT/pages/730234884

1. Create an instance

Detailed instructions on using the Openstack CLI are here:

https://iujetstream.atlassian.net/wiki/spaces/JWT/pages/35913730 and https://github.com/sanjanasudarshan/JetstreamAPITutorial_PEARC19

2. Add Manila network

To your running instance add the manila_testing network.

1 openstack server add network {server_UUID} manila_testing

openstack server show {server_UUID} will show the metadata for your server. Make a note of the manila_testing ip address added to the server.

3. Create a Manila share

manila type-list will list the share types that exist.

To create a share with the NFS shared file system protocol, run the following command.

1 manila create nfs 10 --name Share1 --description "Test Share" --share-type cephfsnfstype

The above command creates a 10 GB NFS share named Share1. You can see the metadata for your newly created share with manila show Share1.

4. Allow access to share

Configure user access to the new share. Add the IP address of the manila_testing network from above and add read-write access.

1 manila access-allow Share1 ip 10.255.0.30 --access-level rw

manila access-list Share1 will list the IP addresses that have access to Share1.

To determine the path required to mount the NFS share, run:

manila share-export-location-list Share1

5. Edit files on the virtual machine

CentOS

  • Create a file /etc/sysconfig/network-scripts/ifcfg-eth1 and add:

1 2 3 4 5 6 7 DEVICE="eth1" BOOTPROTO="dhcp" ONBOOT="yes" TYPE="Ethernet" PEERDNS="no" IPV6INIT="no" PERSISTENT_DHCLIENT="1"
  • Bring the interface up with sudo ifup eth1

Ubuntu

  • Install nfs-common if it isn’t installed - sudo apt-get install nfs-common

  • Create a file /etc/netplan/10-ens7.yaml and add the following text. Replace 10.255.0.51/16 with your manila_testing IP address and fa:16:3e:82:ad:ca with your MAC address.

1 2 3 4 5 6 7 8 9 network: version: 2 renderer: networkd ethernets: ens7: match: macaddress: fa:16:3e:82:ad:ca dhcp4: yes addresses: [10.255.0.51/16]
  • To find the MAC address of the ens7 adapter do ip addr and look for the link/ether value.

  • Bring the interface up with sudo ip link set ens7 up

  • sudo netplan apply

6. Create a mount point

1 sudo mkdir /ManilaShare

7. Mount the share onto a host

Use the path from the manila share-export-location-list in step 4.

1 sudo mount -v -t nfs 10.255.0.1:/volumes/_nogroup/197cd142-5c34-404e-bbc7-19e5f65f8300 /ManilaShare/

If mounted successfully, you should be able to see it with df -h

8. Permanently mounting the filesystem

The nfs filesystem mounted in the previous step will unmount if the instance is rebooted. To ensure your filesystem is mounted when unshelved or rebooted the following line needs to be added to etc/fstab

1 10.255.0.1:/volumes/_nogroup/197cd142-5c34-404e-bbc7-19e5f65f8300 /ManilaShare   nfs     defaults        0 0