<div dir="ltr">Hi All,<div><br></div><div>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.</div>
<div><br></div><div><a href="http://docs.openstack.org/admin-guide-cloud/content//multi_backend.html">http://docs.openstack.org/admin-guide-cloud/content//multi_backend.html</a><br></div><div><br></div><div>I setup two backends and was able to see both the backend hosts in cinder service-list.</div>
<div><br></div><div>PART 1 :</div><div>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.</div>
<div><br></div><div><i>cinder/openstack/common/scheduler/filter.py : get_filtered_objects :</i> <br></div><div><br></div><div><div><b>for filter_cls in filter_classes:</b></div><div><b>            objs = filter_cls().filter_all(objs, filter_properties)</b></div>
</div><div><b>return list(objs)</b><br></div><div><br></div><div>In these lines of code, the objs will contain the list of hosts as per the filter classes.</div><div>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"</div>
<div><br></div><div>I changed the code to this and it was then returning the list of hosts.</div><div>Changed code :</div><div><div><b>for filter_cls in filter_classes:</b></div><div><b>            objs = filter_cls().filter_all(objs, filter_properties)</b></div>
<div><b>            if objs:</b></div><div><b>                return list(objs)</b></div><div><b>return list(objs)</b></div></div><div><br></div><div>PART 2 :</div><div>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.</div>
<div><br></div><div>I went through the logs and found that it was discovering both the hosts in the file </div><div><i>cinder/cinder/scheduler : filter_scheduler.py : _get_weighted_candidates : line 222</i><br></div><div>
<br></div><div>after getting the hosts list it was choosing the first host in the list in file </div><div><i>cinder/cinder/scheduler : filter_scheduler.py : _schedule : line 239</i><br></div><div><br></div><div>My doubts:</div>
<div>==> was the host list filtered as per the volume-type provided during the create volume process?</div><div>==> Why we are using the first host from the "weighed_hosts" list?</div><div><br></div><div>Please help me out here.</div>
<div><br></div><div>Thanks & Regards,</div><div>Gans</div></div>