How to use manila in openstack ?

In this article, I am going to show you the usage of manila component which is tech preview feature added in RHEL OSP 7 (Kilo).

I am following the official Red Hat documentation but faced some error while creating the manila share I am working to fix that error.

My Setup Info :

One node gluster setup to provide the backend volume for share.

all-in-one openstack installation.

Step 1 : Verifying the initial status using below commands. We can see that manila service running.

[root@allinone instances(keystone_admin)]# neutron net-list
+————————————–+————————+——————————————————-+
| id                                   | name                   | subnets                                               |
+————————————–+————————+——————————————————-+
| 70d65601-c244-4d0e-8609-107d3c85a090 | external_network       | e81ba257-2b66-4656-b309-f5210a2fae4c 192.168.122.0/24 |
| a8d2e131-b917-4b71-888b-8e888ed66446 | private_network        | e74f32f8-eeb9-4d38-8ba2-680cfa2b3c06 10.10.1.0/24     |
| 11a42dc0-6ebe-4662-9cfa-09c678a1b343 | manila_service_network |                                                       |
+————————————–+————————+——————————————————-+

[root@allinone instances(keystone_admin)]# neutron subnet-list
+————————————–+—————-+——————+——————————————————+
| id                                   | name           | cidr             | allocation_pools                                     |
+————————————–+—————-+——————+——————————————————+
| e81ba257-2b66-4656-b309-f5210a2fae4c | public_subnet  | 192.168.122.0/24 | {“start”: “192.168.122.10”, “end”: “192.168.122.20”} |
| e74f32f8-eeb9-4d38-8ba2-680cfa2b3c06 | private_subnet | 10.10.1.0/24     | {“start”: “10.10.1.2”, “end”: “10.10.1.254”}         |
+————————————–+—————-+——————+——————————————————+

[root@allinone instances(keystone_admin)]# manila service-list
+—-+——————+——————+——+———+——-+—————————-+
| Id | Binary           | Host             | Zone | Status  | State | Updated_at                 |
+—-+——————+——————+——+———+——-+—————————-+
| 1  | manila-scheduler | allinone         | nova | enabled | up    | 2015-12-30T03:58:37.000000 |
| 2  | manila-share     | allinone@generic | nova | enabled | up    | None                       |
+—-+——————+——————+——+———+——-+—————————-+

[root@allinone instances(keystone_admin)]# manila share-network-list
+—-+——+
| id | name |
+—-+——+
+—-+——+

Step 2 : Created Manila share network.

[root@allinone instances(keystone_admin)]# manila share-network-create –neutron-net-id a8d2e131-b917-4b71-888b-8e888ed66446 –neutron-subnet-id e74f32f8-eeb9-4d38-8ba2-680cfa2b3c06 –name manila_share
+——————-+————————————–+
| Property          | Value                                |
+——————-+————————————–+
| name              | manila_share                         |
| segmentation_id   | None                                 |
| created_at        | 2015-12-30T04:01:39.155552           |
| neutron_subnet_id | e74f32f8-eeb9-4d38-8ba2-680cfa2b3c06 |
| updated_at        | None                                 |
| network_type      | None                                 |
| neutron_net_id    | a8d2e131-b917-4b71-888b-8e888ed66446 |
| ip_version        | None                                 |
| nova_net_id       | None                                 |
| cidr              | None                                 |
| project_id        | 725a03bd63944938bd775908854fb849     |
| id                | da1bf8ea-783c-4a94-87f8-e1bb3a40c4c2 |
| description       | None                                 |
+——————-+————————————–+

[root@allinone instances(keystone_admin)]# manila share-network-list
+————————————–+————–+
| id                                   | name         |
+————————————–+————–+
| da1bf8ea-783c-4a94-87f8-e1bb3a40c4c2 | manila_share |
+————————————–+————–+

Step 3 : On gluster node checking the status of volume and verifying that I am able to mount that volume manually on openstack node.

[root@gluster1 ~]# gluster vol info manila-share-volume-1G-01

Volume Name: manila-share-volume-1G-01
Type: Distribute
Volume ID: 6c7400b0-8364-45c0-b637-5494f2505b9d
Status: Started
Number of Bricks: 1
Transport-type: tcp
Bricks:
Brick1: 192.168.122.116:/brick1/dir1
Options Reconfigured:
performance.readdir-ahead: on

glusterfs-fuse.x86_64

[root@allinone instances(keystone_admin)]#  mount -t glusterfs 192.168.122.116:manila-share-volume-1G-01 /gluster-vol/
[root@allinone instances(keystone_admin)]# df -Ph /gluster-vol/
Filesystem                                 Size  Used Avail Use% Mounted on
192.168.122.116:manila-share-volume-1G-01  3.0G   33M  3.0G   2% /gluster-vol

[root@allinone instances(keystone_admin)]# mount -t nfs -o vers=3 192.168.122.116:manila-share-volume-1G-01 /gluster-vol/
[root@allinone instances(keystone_admin)]# df -t nfs
Filesystem                                1K-blocks  Used Available Use% Mounted on
192.168.122.116:manila-share-volume-1G-01   3135488 32768   3102720   2% /gluster-vol

Step 4 : Create ssh key for user manila on openstack node and copy that key to root user on gluster node to establish a password-less connection.

[root@allinone instances(keystone_admin)]# scp -p /var/lib/manila/.ssh/id_rsa.pub root@192.168.122.116:/tmp
root@192.168.122.116’s password:
id_rsa.pub                                    100%  397     0.4KB/s   00:00

[root@allinone instances(keystone_admin)]# ssh root@192.168.122.116
root@192.168.122.116’s password:
Last login: Wed Dec 30 01:18:32 2015 from 192.168.122.50

[root@gluster1 ~]# cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys

[root@gluster1 ~]# cat !$
cat /root/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMEYMMcjQceHA03Jt3EVauKqgcVDd5xVhloasIfjUvTiwwWg8um+JHisSRn4/dWpD4HgUUZYfR5OSl3XWAm2tapQIMxsaLkEmI4W2vGj0+0Cvugq/qrBPTiBU6nHD+EG8ggsvCOyEkzvbMGh7ZoGIRAZb8mlxh3VrAQTUCCZR1Wfosavt9FYk/7uS8nV+FgVN5bSlYhSYev6NofMe2h0OO9r0+N9a/K2bPw21ZTnfT4DE1CVIkrBDLQl1Jn7RocMUrRbyQBl4QIRAl9fnF+OzYlIyx8zMtKYpS3rNnOu2HfBEVPsna0LHNBE9Q9A/YkdDnl0WtvjIex5vE7NYx6Hkz manila@allinone
[root@gluster1 ~]# logout
Connection to 192.168.122.116 closed.

Verify that password less connection is created successfully.

[root@allinone instances(keystone_admin)]# sudo -u manila /bin/bash
[manila@allinone instances(keystone_admin)]$ ssh root@192.168.122.116
The authenticity of host ‘192.168.122.116 (192.168.122.116)’ can’t be established.
RSA key fingerprint is a3:bc:25:f4:67:2d:f4:1e:43:67:b8:ca:50:53:bc:69.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.122.116’ (RSA) to the list of known hosts.
Last login: Wed Dec 30 01:20:07 2015 from 192.168.122.50
[root@gluster1 ~]# logout

Step 5 : Make the below changes to /etc/manila/manila.conf file before making any change please take the backup of the file.

Comparing the difference between modified and original backed up file.

[root@allinone ~(keystone_admin)]# diff /etc/manila/manila.conf /var/tmp/manila.conf
6,7d5
< enabled_share_backends=glusternfs
< enabled_share_protocols=NFS
1019,1025d1016
<
< [glusternfs]
< share_backend_name=GLUSTERNFS
< share_driver=manila.share.drivers.glusterfs.GlusterfsShareDriver
< glusterfs_target=root@192.168.122.116:/manila-share-volume-1G-01
< glusterfs_nfs_server_type=Gluster
< driver_handles_share_servers=False

Step 6 : Restart the manila service and verify that it’s started successfully.

[root@allinone ~(keystone_admin)]# openstack-service restart manila
[root@allinone ~(keystone_admin)]# openstack-service status manila
MainPID=593 Id=openstack-manila-api.service ActiveState=active
MainPID=595 Id=openstack-manila-scheduler.service ActiveState=active
MainPID=596 Id=openstack-manila-share.service ActiveState=active

Step 7 : Created the manila share type.

[root@allinone ~(keystone_admin)]# manila type-list
+—-+——+————+————+———————-+
| ID | Name | Visibility | is_default | required_extra_specs |
+—-+——+————+————+———————-+
+—-+——+————+————+———————-+
[root@allinone ~(keystone_admin)]# manila type-create glusterfs_nfs false
+————————————–+—————+————+————+————————————–+
| ID                                   | Name          | Visibility | is_default | required_extra_specs                 |
+————————————–+—————+————+————+————————————–+
| 616b54eb-f9ae-4c23-b022-6d57de730e61 | glusterfs_nfs | public     | –          | driver_handles_share_servers : False |
+————————————–+—————+————+————+————————————–+
[root@allinone ~(keystone_admin)]# manila type-key glusterfs_nfs set share_backend_name=’GLUSTERNFS’
[root@allinone ~(keystone_admin)]# manila type-list
+————————————–+—————+————+————+————————————–+
| ID                                   | Name          | Visibility | is_default | required_extra_specs                 |
+————————————–+—————+————+————+————————————–+
| 616b54eb-f9ae-4c23-b022-6d57de730e61 | glusterfs_nfs | public     | –          | driver_handles_share_servers : False |
+————————————–+—————+————+————+————————————–+

Step  8 : Downloaded the centos image and spawn the instance using that centos image.

[root@allinone ~(keystone_admin)]# wget cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud-1503.qcow2

[root@allinone ~(keystone_admin)]# glance image-create –name “centos” –is-public true –disk-format qcow2 –container-format bare –file ~/CentOS-7-x86_64-GenericCloud-1503.qcow2

[root@allinone ~(keystone_admin)]# nova keypair-add –pub_key ~/.ssh/id_rsa.pub admin_key

[root@allinone ~(keystone_admin)]# nova boot –image centos –key admin_key –flavor m1.small –nic net-id=a8d2e131-b917-4b71-888b-8e888ed66446 –poll centos-vm

Step 9 : Modified the security rules to allow ICMP and ssh traffic.

[root@allinone ~(keystone_admin)]# keystone tenant-list
/usr/lib/python2.7/site-packages/keystoneclient/shell.py:65: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
‘python-keystoneclient.’, DeprecationWarning)
+———————————-+———-+———+
|                id                |   name   | enabled |
+———————————-+———-+———+
| 725a03bd63944938bd775908854fb849 |  admin   |   True  |
| c55cd56302cf44ca9a8b81d033f54efa |   demo   |   True  |
| 8fb23fc33a0f4515915ef8dfca821758 | services |   True  |
+———————————-+———-+———+

[root@allinone ~(keystone_admin)]#  neutron security-group-show 8fb23fc33a0f4515915ef8dfca821758

[root@allinone ~(keystone_admin)]#  neutron security-group-rule-create –protocol tcp –port-range-min 22 –port-range-max 22 –direction ingress 8fb23fc33a0f4515915ef8dfca821758

[root@allinone ~(keystone_admin)]# neutron security-group-rule-create –protocol icmp –direction ingress 8fb23fc33a0f4515915ef8dfca821758

Step 10 : Attached the floating ip with instance and verify that you are able to access the instance from host machine using the floating ip.

[root@allinone ~(keystone_admin)]# neutron port-list | grep 10.10.1.11
| 3455dd14-02c2-4845-9f50-895621a19f29 |      | fa:16:3e:b6:94:85 | {“subnet_id”: “e74f32f8-eeb9-4d38-8ba2-680cfa2b3c06”, “ip_address”: “10.10.1.11”}     |
[root@allinone ~(keystone_admin)]# neutron floatingip-associate 4e6b37bd-8a51-4b55-9da9-aec2e08aa77d 3455dd14-02c2-4845-9f50-895621a19f29
Associated floating IP 4e6b37bd-8a51-4b55-9da9-aec2e08aa77d
[root@allinone ~(keystone_admin)]# nova list
+————————————–+———–+——–+————+————-+——————————————–+
| ID                                   | Name      | Status | Task State | Power State | Networks                                   |
+————————————–+———–+——–+————+————-+——————————————–+
| 3e4cf871-5033-4cd8-9f2d-f631fcf81f8e | centos-vm | ACTIVE | –          | Running     | private_network=10.10.1.11, 192.168.122.11 |
+————————————–+———–+——–+————+————-+——————————————–+

Step 11 : Creating manila share is ending with ERROR.

[root@allinone ~(keystone_admin)]# manila list
+—-+——+——+————-+——–+———–+————+—————–+——+
| ID | Name | Size | Share Proto | Status | Is Public | Share Type | Export location | Host |
+—-+——+——+————-+——–+———–+————+—————–+——+
+—-+——+——+————-+——–+———–+————+—————–+——+

[root@allinone ~(keystone_admin)]# manila create –share-type glusterfs_nfs –name share-00 nfs 1
+——————-+————————————–+
| Property          | Value                                |
+——————-+————————————–+
| status            | creating                             |
| description       | None                                 |
| availability_zone | nova                                 |
| share_network_id  | None                                 |
| export_locations  | []                                   |
| share_server_id   | None                                 |
| host              | None                                 |
| snapshot_id       | None                                 |
| is_public         | False                                |
| id                | b0204633-6a34-4c4e-af46-8b9271ccb29b |
| size              | 1                                    |
| name              | share-00                             |
| share_type        | 616b54eb-f9ae-4c23-b022-6d57de730e61 |
| created_at        | 2015-12-30T08:43:29.839855           |
| export_location   | None                                 |
| share_proto       | NFS                                  |
| project_id        | 725a03bd63944938bd775908854fb849     |
| metadata          | {}                                   |
+——————-+————————————–+

[root@allinone ~(keystone_admin)]# manila list
+————————————–+———-+——+————-+——–+———–+—————+—————–+——+
| ID                                   | Name     | Size | Share Proto | Status | Is Public | Share Type    | Export location | Host |
+————————————–+———-+——+————-+——–+———–+—————+—————–+——+
| b0204633-6a34-4c4e-af46-8b9271ccb29b | share-00 | 1    | NFS         | error  | False     | glusterfs_nfs | None            | None |
+————————————–+———-+——+————-+——–+———–+—————+—————–+——+

In the log file (/var/log/manila/scheduler.log) I have seen below chunk of message.

2015-12-30 05:35:14.779 1138 WARNING manila.context [-] Arguments dropped when creating context: {u’user’: u’d99efb85eae34c49b46366525190d873′, u’tenant’: u’725a03bd63944938bd775908854fb849′}
2015-12-30 05:35:14.783 1138 WARNING manila.scheduler.host_manager [req-33920721-276a-4312-b599-050bd297ac30 ] Share service is down. (host: allinone@generic)
2015-12-30 05:35:14.783 1138 INFO manila.openstack.common.scheduler.base_filter [req-33920721-276a-4312-b599-050bd297ac30 None] Filter AvailabilityZoneFilter returned 0 host(s)
2015-12-30 05:35:14.784 1138 WARNING manila.scheduler.manager [req-33920721-276a-4312-b599-050bd297ac30 ] Failed to schedule_create_share: No valid host was found. .

Google search didn’t give anything concrete. I found one bug which is filed to remove the “WARNING” message with “ERROR” message.

https://bugs.launchpad.net/manila/+bug/1481745

I do see one Bug with same error but it was for Netapp.

https://bugs.launchpad.net/manila/+bug/1430434

Step 12 : I commented the below line in /etc/manila/manila.conf file and restarted the manila service.

#enabled_share_backends=generic

After that I was able to create the manila share successfully.

[root@allinone ~(keystone_admin)]# manila list
+————————————–+———-+——+————-+———–+———–+—————+——————————————————————————————–+——————————–+
| ID                                   | Name     | Size | Share Proto | Status    | Is Public | Share Type    | Export location                                                                            | Host                           |
+————————————–+———-+——+————-+———–+———–+—————+——————————————————————————————–+——————————–+
| 528403ad-2561-4b9a-bc81-17c79078b068 | share-00 | 1    | NFS         | available | False     | glusterfs_nfs | root@192.168.122.116:/manila-share-volume-1G-01/share-528403ad-2561-4b9a-bc81-17c79078b068 | allinone@glusternfs#GLUSTERNFS |
+————————————–+———-+——+————-+———–+———–+—————+——————————————————————————————–+——————————–+

Step 13 : Currently no access is present to the share.

[root@allinone ~(keystone_admin)]# manila access-list 528403ad-2561-4b9a-bc81-17c79078b068
+—-+————-+———–+————–+——-+
| id | access type | access to | access level | state |
+—-+————-+———–+————–+——-+
+—-+————-+———–+————–+——-+

Step 14 : Lets provide the access to instance.

[root@allinone ~(keystone_admin)]# manila access-allow 528403ad-2561-4b9a-bc81-17c79078b068 ip 192.168.122.11
+————–+————————————–+
| Property     | Value                                |
+————–+————————————–+
| share_id     | 528403ad-2561-4b9a-bc81-17c79078b068 |
| deleted      | False                                |
| created_at   | 2015-12-30T11:17:08.626518           |
| updated_at   | None                                 |
| access_type  | ip                                   |
| access_to    | 192.168.122.11                       |
| access_level | rw                                   |
| state        | new                                  |
| deleted_at   | None                                 |
| id           | c297c268-1df2-4ce9-8952-4d6feeab09ec |
+————–+————————————–+
[root@allinone ~(keystone_admin)]# manila access-list 528403ad-2561-4b9a-bc81-17c79078b068
+————————————–+————-+—————-+————–+——–+
| id                                   | access type | access to      | access level | state  |
+————————————–+————-+—————-+————–+——–+
| c297c268-1df2-4ce9-8952-4d6feeab09ec | ip          | 192.168.122.11 | rw           | active |
+————————————–+————-+—————-+————–+——–+
[root@allinone ~(keystone_admin)]#

Step 15 : Time to mount the share inside the centos  instance.

[centos@centos-vm ~]$ sudo mount -t nfs -o vers=3 192.168.122.116:/manila-share-volume-1G-01/share-528403ad-2561-4b9a-bc81-17c79078b068 /mnt

[centos@centos-vm ~]$ df -h /mnt
Filesystem                                                                             Size  Used Avail Use% Mounted on
192.168.122.116:/manila-share-volume-1G-01/share-528403ad-2561-4b9a-bc81-17c79078b068  1.0G     0  1.0G   0% /mnt

I am able to create file on the mounted share.

[centos@centos-vm ~]$ sudo touch !$
sudo touch /mnt/file1
[centos@centos-vm ~]$ ll /mnt/file1
-rw-r–r–. 1 root root 0 Dec 30  2015 /mnt/file1

Advertisements

2 thoughts on “How to use manila in openstack ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s