<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 25, 2015 at 3:58 PM, Sean Dague <span dir="ltr"><<a href="mailto:sean@dague.net" target="_blank">sean@dague.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On 03/25/2015 03:16 AM, Deepak Shetty wrote:<br>
><br>
><br>
> On Wed, Mar 25, 2015 at 11:29 AM, Deepak Shetty <<a href="mailto:dpkshetty@gmail.com">dpkshetty@gmail.com</a><br>
</span><span class="">> <mailto:<a href="mailto:dpkshetty@gmail.com">dpkshetty@gmail.com</a>>> wrote:<br>
><br>
><br>
><br>
>     On Wed, Mar 25, 2015 at 12:58 AM, Ian Wienand <<a href="mailto:iwienand@redhat.com">iwienand@redhat.com</a><br>
</span><div><div class="h5">>     <mailto:<a href="mailto:iwienand@redhat.com">iwienand@redhat.com</a>>> wrote:<br>
><br>
>         On 03/24/2015 03:17 PM, Deepak Shetty wrote:<br>
>         > For eg: Look at [1]<br>
>         > [1] <a href="https://github.com/stackforge/devstack-plugin-glusterfs/blob/master/devstack/settings" target="_blank">https://github.com/stackforge/devstack-plugin-glusterfs/blob/master/devstack/settings</a><br>
><br>
>         > I would like ability to change these while I use the enable_plugin<br>
>         > apporach to setup devstack w/ GlusterFS per my local glusterfs setup<br>
><br>
>         So I think the plugin should do<br>
><br>
>         CINDER_ENABLED_BACKENDS=${CINDER_ENABLED_BACKENDS:-glusterfs:glusterfs,lvm:lvm1}<br>
><br>
>         i.e. provide a default only if the variable is unset.<br>
><br>
><br>
>     Bah! That was easy, i should have figured that myself :)<br>
>     Thanks for catching that<br>
><br>
><br>
><br>
>         This seems like one of those "traps for new players" and is one<br>
>         concern I have with devstack plugins -- that authors keep having to<br>
>         find out lessons learned independently.  I have added a note on this<br>
>         to the documentation in [1].<br>
><br>
>         -i<br>
><br>
>         [1] <a href="https://review.openstack.org/#/c/167375/" target="_blank">https://review.openstack.org/#/c/167375/</a><br>
><br>
><br>
>     Great, i +1'ed it.<br>
><br>
>     Also i posted patch to fix settings file @<br>
>     <a href="https://review.openstack.org/167494" target="_blank">https://review.openstack.org/167494</a><br>
><br>
><br>
> Ian,<br>
>    Looks like usign bash default in settings file of plugin is not<br>
> working, in my patch it didn't use glusterfs driver, it used LVM (default)<br>
> I think whats happening here is that by the time settings file is<br>
> sourced, CINDER_ENABLED_BACKENDS is already set to lvm by lib/cinder<br>
> so settings file's default value is never taken<br>
><br>
> IIUC there are 3 scenarios (taking CINDER_ENABLED_BACKENDS as example var) :<br>
><br>
> 1) localrc doesn't have CINDER_ENABLED_BACKENDS and enable_plugin<br>
>     - Here we want the lib/cinder's default value to be taken<br>
>     - this should work fine<br>
><br>
> 2) localrc doesn't have CINDER_ENABLED_BACKENDS but has enable_plugin<br>
> glusterfs<br>
>     - Here we want the plugin's default values to be taken, but its not<br>
> as lib/cinder already initialized CINDER_ENABLED_BACKENDS to use lvm backend<br>
>     - Thus broken<br>
><br>
> 3) localrc has both CINDER_ENABLED_BACKENDS and enable_plugin glusterfs<br>
> specified<br>
>     - Here we want CINDER_ENABLED_BACKENDS present in my localrc to be<br>
> chosen<br>
>     - This will work as by the time settings file is sourced<br>
> CINDER_ENABLED_BACKENDS is already initialised to my value in localrc<br>
><br>
> So #2 scenario would need some changes in stack.sh handling of plugin code ?<br>
<br>
</div></div>Right, so this code runs late enough that you don't get to change the<br>
defaults. I think that's ok.<br>
<br>
I would instead do the following:<br>
<br>
1) CINDER_ENABLED_BACKENDS+=,glusterfs:glusterfs<br>
<br>
or<br>
<br>
2) CINDER_ENABLED_BACKENDS=glusterfs:glusterfs<br>
<br>
in the plugin.<br>
<br>
Clearly, if you've enabled the plugin, you want glusterfs. I think that<br>
in most cases you probably only want glusterfs as your backend, so<br>
option #2 seems sensible.<br></blockquote><div><br></div><br></div><div class="gmail_quote">#1 is needed for multi-backend testing<br></div><div class="gmail_quote">#2 is needed for single-backend testing<br><br></div><div class="gmail_quote">#2 is what we currently, we blindly override the var, but that forces the devstack user to <br>use the config given in the plugin, I wanted a way to either use plugin config or override it<br><br>I think #1 is better, since it gives the power in localrc to do:<br></div><div class="gmail_quote"><br>1) CINDER_ENABLED_BACKENDS=<br></div><div class="gmail_quote">This will ensure lib/cinder doesn't populate it and plugin adds glusterfs:glusterfs for single backend<br><br></div><div class="gmail_quote">2) No mention of CINDER_ENABLED_BACKENDS in localrc<br></div><div class="gmail_quote">This will make it CINDER_ENABLED_BACKENDS=lvm:lvm-driver1, glusterfs:glusterfs for multi-backend<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">Also for vars in settings file that are backend specific (hence not touched by lib/cinder):<br><br>GLUSTERFS_LOOPBACK_DISK_SIZE & CINDER_GLUSTERFS_SHARES<br><br></div><div class="gmail_quote">They can remain as :<br><span class="">GLUSTERFS_LOOPBACK_DISK_SIZE=</span><span class="">${GLUSTERFS_LOOPBACK_DISK_SIZE:-8G}<br></span><br><span class="">CINDER_GLUSTERFS_SHARES=</span><span class="">${CINDER_GLUSTERFS_SHARES:-</span><span class="">"127.0.0.1:/vol1;127.0.0.1:/vol2"</span><span class="">}<br><br></span></div><div class="gmail_quote"><span class="">(as mentioned in the patch @ <a href="https://review.openstack.org/#/c/167494/1/devstack/settings">https://review.openstack.org/#/c/167494/1/devstack/settings</a>)<br><br></span></div><div class="gmail_quote"><span class="">This will give the end user the ability to change loopback size and/or gluster server IPs<br></span></div><div class="gmail_quote"><span class="">based on the needs of his/her local setup<br><br></span></div><div class="gmail_quote"><span class="">Agree ?<br><br></span></div><div class="gmail_quote"><span class="">If yes, then we must mention this in the plugin.rst in a nice way for other plugin writers to <br></span></div><div class="gmail_quote"><span class="">understand properly :) ?<br><br></span></div><div class="gmail_quote"><span class="">thanx,<br></span></div><div class="gmail_quote"><span class="">deepak<br><br></span></div><div class="gmail_quote"> <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class=""><font color="#888888"><br>
        -Sean<br>
<br>
--<br>
Sean Dague<br>
<a href="http://dague.net" target="_blank">http://dague.net</a><br>
<br>
</font></span><br>__________________________________________________________________________<br>
OpenStack Development Mailing List (not for usage questions)<br>
Unsubscribe: <a href="http://OpenStack-dev-request@lists.openstack.org?subject:unsubscribe" target="_blank">OpenStack-dev-request@lists.openstack.org?subject:unsubscribe</a><br>
<a href="http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev" target="_blank">http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev</a><br>
<br></blockquote></div><br></div></div>