Manila: How to get it running in DevStack

Greg Loughmiller
Manila: How to get it running in DevStack

In our previous blog (Overview of Manila at Atlanta OpenStack Summit), Bob Callaway spoke about the Atlanta summit and the new OpenStack File Share Service project called Manila. This is a follow up with some information that will assist you getting Manila installed within a DevStack environment. We will show you some of the steps and links that are available that will provide information about the installation, and get you started with Manila - think of this as a Manila 101 :)

The test infrastructure being used is a VM with the following details:

  • Ubuntu 14.04 LTS as the OS
  • Three interfaces:
    • Management Interface
    • Interface used for the Bridge Network
    • Interface for my Storage Network
  • Devstack (the master branch)
  • Manila (the master branch) from Stackforge

Important Point about the Host OS version:

  • Ubuntu 14.04 was required due to blueprints that provided upstream changes in Neutron that required a minimum version of dnsmasq to be 2.63. Ubuntu 12.04 (Precise) has version 2.59.

Now, let’s walk thru the steps to get devstack and Manila setup on your host (almost all of the steps will be via the command line, with one confirmation of viewing shares via Horizon):

1. Clone the master branch of devstack:

stack@greg:~$ git clone -b master https://github.com/openstack-dev/devstack.git
Cloning into 'devstack'...
remote: Counting objects: 19577, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 19577 (delta 11), reused 3 (delta 0)
Receiving objects: 100% (19577/19577), 5.51 MiB | 663.00 KiB/s, done.
Resolving deltas: 100% (13436/13436), done.
Checking connectivity... done.

2. Clone the master branch of Manila from Stackforge:

stack@greg:~/devstack$ git clone -b master https://github.com/openstack/manila.git
Cloning into 'manila'...
remote: Counting objects: 5538, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 5538 (delta 39), reused 15 (delta 10)
Receiving objects: 100% (5538/5538), 2.64 MiB | 0 bytes/s, done.
Resolving deltas: 100% (3633/3633), done.
Checking connectivity... done.

3. Copy Manila-specific files into the devstack environment:

stack@greg:~$ cp ./manila/contrib/devstack/lib/manila ./devstack/lib
stack@greg:~$ cp ./manila/contrib/devstack/extras.d/70-manila.sh ./devstack/extras.d/

4. Create your local.conf file with the appropriate values. More importantly, there are specific things for Manila required prior to running of stack.sh. Below is a sample local.conf with the items required for Neutron and Manila denoted with the comment #MANILA-SPECIFIC-STUFF-BELOW.

# Credentials
DATABASE_PASSWORD=devstack
ADMIN_PASSWORD=devstack
SERVICE_PASSWORD=devstack
SERVICE_TOKEN=devstack
RABBIT_PASSWORD=devstack
GUEST_PASSWORD=devstack
MYSQL_HOST=127.0.0.1
MYSQL_USER=root
MYSQL_PASSWORD=devstack
RABBIT_HOST=127.0.0.1
LIBVIRT_TYPE=qemu
GLANCE_HOSTPORT=127.0.0.1:9292
SERVICE_PASSWORD=devstack
ENABLED_SERVICES=key,n-api,n-crt,n-obj,n-cpu,n-net,n-cond,n-sch,n-novnc,n-xvnc,n-cauth
#glance
ENABLED_SERVICES+=,g-api,g-reg
#cinder
ENABLED_SERVICES+=,cinder,c-sch,c-api,c-vol,c-bak
#trove
ENABLED_SERVICES+=,trove,tr-api,tr-tmgr,tr-cond
#manila
ENABLED_SERVICES+=,manila,m-api,m-sch,m-shr
#others
ENABLED_SERVICES+=,horizon,rabbit,mysql,tempest
#neutron needs for manila
disable_service n-net
enable_service q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron
#
LOGDAYS=1
LOGFILE=$DEST/devstack.log
SCREEN_LOGDIR=$DEST/logs/screen
RECLONE=yes
API_RATE_LIMIT=False
#MANILA-SPECIFIC-STUFF-BELOW
HORIZON_REPO=https://github.com/NetApp/horizon.git
HORIZON_BRANCH=manila_juno

Q_PLUGIN=ml2
ENABLE_TENANT_VLANS=True
ML2_VLAN_RANGES=physnet1:100:4000
PHYSICAL_NETWORK=physnet1
OVS_PHYSICAL_BRIDGE=br-eth1
Q_ML2_PLUGIN_MECHANISM_DRIVERS=openvswitch
Q_ML2_PLUGIN_TYPE_DRIVERS=vlan,vxlan
SHARE_BACKING_FILE_SIZE=8G
FLAT_INTERFACE=eth1

Important Note for local.conf and Manila:

  • Your network configuration may be different than our example. Configure Neutron according to your network and VLAN ranges
  • Ensure that you add vxlan to the Q_ML2_PLUGIN_TYPE_DRIVERS parameter. This was a change to upstream Icehouse.
  • Note the changes for version of Horizon for the integration with Manila and Shares

5. Let’s make sure we have the necessary dependencies

sudo apt-get update && \
sudo apt-get -y install git vim-gtk libxml2-dev libxslt1-dev libpq-dev python-pip libsqlite3-dev && \
sudo apt-get -y build-dep python-mysqldb && sudo pip install git-review tox

6. Run stack.sh as you normally would after you have configured the local.conf for the manila components as well as any items specific for your environment.

7. Once stack.sh has completed, you should have the Manila service(s) running with a default install. Use the manila service-list command to ensure you are running.

stack@greg:~/devstack$ manila service-list
+------------------+---------------+------+---------+-------+----------------------------+
|      Binary      |      Host     | Zone |  Status | State |         Updated_at         |
+------------------+---------------+------+---------+-------+----------------------------+
| manila-scheduler |      greg     | nova | enabled |   up  | 2014-08-08T17:48:32.000000 |
|   manila-share   | greg@backend1 | nova | enabled |   up  | 2014-08-08T17:48:40.000000 |
+------------------+---------------+------+---------+-------+----------------------------+
stack@greg:~/devstack$

8. Check Horizon to validate the Manila plugins are available. We don’t have any shares defined yet; but we need to confirm that the Manila plugins for Horizon are available.

Horizon Screenshot

9. List your Neutron networks and subnets available for your devstack installation. Take a note of each listed prior to creating your Manila share:

stack@greg:~$ neutron net-list
+--------------------------------------+------------------------+----------------------------------------------------+
| id                                   | name                   | subnets                                            |
+--------------------------------------+------------------------+----------------------------------------------------+
| 003cdc18-cd83-4d8c-880d-73abef80ca4c | public                 | 9f0ff94d-0c17-4e68-88c4-92da33df8448 172.24.4.0/24 |
| 83b9d824-1186-4aed-82df-da84adca39b1 | private                | 5d70ffc6-e26a-4189-a522-7fb9b1c2eb23 10.0.0.0/24   |
| e18fa903-183b-4de6-b4ad-a08e52faa9c8 | manila_service_network |                                                    |
+--------------------------------------+------------------------+----------------------------------------------------+
stack@greg:~$ neutron subnet-list
+--------------------------------------+----------------+---------------+------------------------------------------------+
| id                                   | name           | cidr          | allocation_pools                               |
+--------------------------------------+----------------+---------------+------------------------------------------------+
| 5d70ffc6-e26a-4189-a522-7fb9b1c2eb23 | private-subnet | 10.0.0.0/24   | {"start": "10.0.0.2", "end": "10.0.0.254"}     |
| 9f0ff94d-0c17-4e68-88c4-92da33df8448 | public-subnet  | 172.24.4.0/24 | {"start": "172.24.4.2", "end": "172.24.4.254"} |
+--------------------------------------+----------------+---------------+------------------------------------------------+

10. Create a share network using the Neutron private network and subnet for your environment. We used the generic private network/subnet for this example.

stack@greg:~/devstack$ manila share-network-create --neutron-net-id 83b9d824-1186-4aed-82df-da84adca39b1 --neutron-subnet-id 5d70ffc6-e26a-4189-a522-7fb9b1c2eb23 --name manila_share
+-------------------+--------------------------------------+
|      Property     |                Value                 |
+-------------------+--------------------------------------+
|        cidr       |                 None                 |
|     created_at    |      2014-08-11T19:30:34.698596      |
|    description    |                 None                 |
|         id        | 438032da-1147-4cc4-864a-cf691953def9 |
|     ip_version    |                 None                 |
|        name       |             manila_share             |
|    network_type   |                 None                 |
|   neutron_net_id  | 83b9d824-1186-4aed-82df-da84adca39b1 |
| neutron_subnet_id | 5d70ffc6-e26a-4189-a522-7fb9b1c2eb23 |
|     project_id    |   ede0edb1c1e54e3eabc6e6c98b17d862   |
|  segmentation_id  |                 None                 |
|       status      |                 None                 |
|     updated_at    |                 None                 |
+-------------------+--------------------------------------+
stack@greg:~/devstack$ manila share-network-list
+--------------------------------------+---------------+--------+
|                  id                  |      name     | status |
+--------------------------------------+---------------+--------+
| 438032da-1147-4cc4-864a-cf691953def9 |  manila_share |  None  |
| b098a3cd-3b4b-4d7e-b51d-a7476dc761cc | manila_share1 |  None  |
+--------------------------------------+---------------+--------+

11. Create an NFS share, using the share network that you just created. Here we are creating the share “devstack_share” using the share network we created in the previous step.

stack@greg:~/devstack$ manila create --name devstack_share --share-network 438032da-1147-4cc4-864a-cf691953def9 NFS 1
+----------+---------------------------------------------------------------------------------------------------------------------------+
| Property |     Value                                                                                                                 |
+----------+---------------------------------------------------------------------------------------------------------------------------+
|    id    | e9b92837-ea2b-4acd-ab65-65c98199e78b                                                                                      |
|  links   | [{u'href': u'http://10.63.168.135:8786/v1/ede0edb1c1e54e3eabc6e6c98b17d862/shares/e9b92837-ea2b-4acd-ab65-65c98199e78b',  |
|          |   u'rel': u'self'},                                                                                                       |
|          |  {u'href': u'http://10.63.168.135:8786/ede0edb1c1e54e3eabc6e6c98b17d862/shares/e9b92837-ea2b-4acd-ab65-65c98199e78b',     |
|          |   u'rel': u'bookmark'}]                                                                                                   |
|   name   | devstack_share                                                                                                            |
+----------+---------------------------------------------------------------------------------------------------------------------------+
stack@greg:~/devstack$ manila list
+--------------------------------------+----------------+------+-------------+-----------+---------------------------------------------------------------+
|                  ID                  |      Name      | Size | Share Proto |   Status  |                        Export location                        |
+--------------------------------------+----------------+------+-------------+-----------+---------------------------------------------------------------+
| 4ed16b64-59ee-4123-b6f0-f42148280a99 |    myshare     |  1   |     NFS     | available | 10.254.0.3:/shares/share-4ed16b64-59ee-4123-b6f0-f42148280a99 |
| e9b92837-ea2b-4acd-ab65-65c98199e78b | devstack_share |  1   |     NFS     |  creating |                              None                             |
+--------------------------------------+----------------+------+-------------+-----------+---------------------------------------------------------------+

12. Now that this share that has been created, let's take a quick look at the shares. We have two shares, myshare and devstack_share. Each uses the NFS protocol and the export paths for each share are listed in the 'export location' column.

stack@greg:~/devstack$ manila list
+--------------------------------------+----------------+------+-------------+-----------+---------------------------------------------------------------+
|                  ID                  |      Name      | Size | Share Proto |   Status  |                        Export location                        |
+--------------------------------------+----------------+------+-------------+-----------+---------------------------------------------------------------+
| 4ed16b64-59ee-4123-b6f0-f42148280a99 |    myshare     |  1   |     NFS     | available | 10.254.0.3:/shares/share-4ed16b64-59ee-4123-b6f0-f42148280a99 |
| e9b92837-ea2b-4acd-ab65-65c98199e78b | devstack_share |  1   |     NFS     | available | 10.254.0.5:/shares/share-e9b92837-ea2b-4acd-ab65-65c98199e78b |
+--------------------------------------+----------------+------+-------------+-----------+---------------------------------------------------------------+
stack@greg:~/devstack$

13. The export location is part of the Manila shared server configuration. There are two shared servers in this example because we created two different shares on two different share networks. Take a moment within your environment to follow the relationships between your share and share network.

14. Earlier we asked that you check out the lists of Neutron subnets. You should now have an additional entry that will route the subnet used for the NFS exports to your private subnet used to build the share network via Manila.

stack@greg:~/devstack$ neutron subnet-list
+--------------------------------------+------------------------------------------------+---------------+------------------------------------------------+
| id                                   | name                                           | cidr          | allocation_pools                               |
+--------------------------------------+------------------------------------------------+---------------+------------------------------------------------+
| 0d75e8af-ea21-4668-b0c1-351937bee35a | routed_to_5d70ffc6-e26a-4189-a522-7fb9b1c2eb23 | 10.254.0.0/28 | {"start": "10.254.0.2", "end": "10.254.0.14"}  |
| 5d70ffc6-e26a-4189-a522-7fb9b1c2eb23 | private-subnet                                 | 10.0.0.0/24   | {"start": "10.0.0.2", "end": "10.0.0.254"}     |
| 9f0ff94d-0c17-4e68-88c4-92da33df8448 | public-subnet                                  | 172.24.4.0/24 | {"start": "172.24.4.2", "end": "172.24.4.254"} |
+--------------------------------------+------------------------------------------------+---------------+------------------------------------------------+

15. Let's quickly check on the share and find where the backing Cinder volume was created. In my environment, I’m using a NetApp Cinder back end in this example. The backing Cinder volume for my Manila shares can be seen via a df –hk on the single-node devstack host.

stack@greg:~/devstack$ df -kh
Filesystem                                    Size  Used Avail Use% Mounted on
/dev/sda1                                      34G  5.7G   26G  18% /
none                                          4.0K     0  4.0K   0% /sys/fs/cgroup
udev                                          7.9G  4.0K  7.9G   1% /dev
tmpfs                                         1.6G  840K  1.6G   1% /run
none                                          5.0M     0  5.0M   0% /run/lock
none                                          7.9G  4.0K  7.9G   1% /run/shm
none                                          100M     0  100M   0% /run/user
172.16.22.230:/v_devstack_mirror               15G   50M   15G   1% /opt/stack/data/nova/mnt/3edfeba0731309866b6773b9828448eb
172.16.22.230:/v_devstack_comp                9.5G  9.5M  9.5G   1% /opt/stack/data/nova/mnt/57975883130c2c9c4aab078fe8f72404

16. Now you've created a Manila NFS share! But what next? We need to allow access to this share for some hosts. In this example, I will provide access to the share devstack_share to two different hosts in my test environment. From here – we would mount the NFS shares on the NFS client specific by the IP address of the access-allow command.

stack@greg:~/devstack$ manila access-list e9b92837-ea2b-4acd-ab65-65c98199e78b
+----+-------------+-----------+-------+
| id | access type | access to | state |
+----+-------------+-----------+-------+
+----+-------------+-----------+-------+
stack@greg:~/devstack$ manila access-allow e9b92837-ea2b-4acd-ab65-65c98199e78b ip 10.63.168.135
+-------------+--------------------------------------+
|   Property  |                Value                 |
+-------------+--------------------------------------+
|  access_to  |            10.63.168.135             |
| access_type |                  ip                  |
|  created_at |      2014-08-12T12:44:28.112086      |
|   deleted   |                False                 |
|  deleted_at |                 None                 |
|      id     | 104a8ce8-bb2e-47a7-84a0-06e7b7dc148a |
|   share_id  | e9b92837-ea2b-4acd-ab65-65c98199e78b |
|    state    |                 new                  |
|  updated_at |                 None                 |
+-------------+--------------------------------------+
stack@greg:~/devstack$ manila access-allow e9b92837-ea2b-4acd-ab65-65c98199e78b ip 10.0.0.6
+-------------+--------------------------------------+
|   Property  |                Value                 |
+-------------+--------------------------------------+
|  access_to  |               10.0.0.6               |
| access_type |                  ip                  |
|  created_at |      2014-08-12T12:44:36.326327      |
|   deleted   |                False                 |
|  deleted_at |                 None                 |
|      id     | ec398f37-cbf4-4cd2-bc28-7a92fcbe0167 |
|   share_id  | e9b92837-ea2b-4acd-ab65-65c98199e78b |
|    state    |                 new                  |
|  updated_at |                 None                 |
+-------------+--------------------------------------+
stack@greg:~/devstack$ manila access-list e9b92837-ea2b-4acd-ab65-65c98199e78b
+--------------------------------------+-------------+---------------+--------+
|                  id                  | access type |   access to   | state  |
+--------------------------------------+-------------+---------------+--------+
| 104a8ce8-bb2e-47a7-84a0-06e7b7dc148a |      ip     | 10.63.168.135 | active |
| ec398f37-cbf4-4cd2-bc28-7a92fcbe0167 |      ip     |    10.0.0.6   | active |
+--------------------------------------+-------------+---------------+--------+
stack@greg:~/devstack$

Here's the recording of the demo presented in Atlanta which includes a scenario very similar to what we have described in this post:

That's all for now; we will follow up with more on Manila in later blog posts, including a discussion of the integration with the NetApp clustered Data ONTAP driver for Manila. To learn more about Manila, check out our wiki page at http://wiki.openstack.org/wiki/Manila. Or, come join us on IRC at #openstack-manila and #openstack-netapp on freenode.

August 15, 2014 |
Tags : manila

Comments Section

Feel free to comment on the post but keep it clean and on topic.

comments powered by Disqus

OpenStack @ NetApp Blog