[openstack-dev] [stable-havana][cinder] [scheduler] Found a potential bug while setting up multiple cinder-volume instances on single cinder node

gans developer gans.developer at gmail.com
Fri Nov 8 06:26:06 UTC 2013


Hi All,

I was trying to setup multiple cinder-volume instances on a single node
setup.I edited the cinder.conf file as per the instructions given in the
openstack docs for multi-backend cinder.

http://docs.openstack.org/admin-guide-cloud/content//multi_backend.html

I setup two backends and was able to see both the backend hosts in cinder
service-list.

PART 1 :
I tried to create a volume using the volume-type(configures for the
backends), but it failed saying "No valid host was found". I tried to debug
the code and got the point where the process was stalling.

*cinder/openstack/common/scheduler/filter.py : get_filtered_objects :*

*for filter_cls in filter_classes:*
*            objs = filter_cls().filter_all(objs, filter_properties)*
*return list(objs)*

In these lines of code, the objs will contain the list of hosts as per the
filter classes.
In my case , the code was able to find the list of host for one of the
classes in the first iteration only and in second and third iteration the
list was empty.As the return is after the loop is over , it was always
sending the empty list and hence the error : "No valid host found"

I changed the code to this and it was then returning the list of hosts.
Changed code :
*for filter_cls in filter_classes:*
*            objs = filter_cls().filter_all(objs, filter_properties)*
*            if objs:*
*                return list(objs)*
*return list(objs)*

PART 2 :
After making the above changes , i tried to create the volume using one of
the volume-type and got success. Then i tried to use the other volume-type
to create the volume , but it used the other host and not the host
associated with this volume-type.

I went through the logs and found that it was discovering both the hosts in
the file
*cinder/cinder/scheduler : filter_scheduler.py : _get_weighted_candidates :
line 222*

after getting the hosts list it was choosing the first host in the list in
file
*cinder/cinder/scheduler : filter_scheduler.py : _schedule : line 239*

My doubts:
==> was the host list filtered as per the volume-type provided during the
create volume process?
==> Why we are using the first host from the "weighed_hosts" list?

Please help me out here.

Thanks & Regards,
Gans
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20131108/39f33f59/attachment.html>


More information about the OpenStack-dev mailing list