<div dir="ltr">James,<div>This is the right way to think about the problem. I have more specific comments in the script, but just wanted to let you know this is a great start.</div><div><br></div><div>Thanks!</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">On Wed, Nov 27, 2013 at 7:42 AM, James <span dir="ltr">&lt;<a href="mailto:purpleidea@gmail.com" target="_blank">purpleidea@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
This is along the lines of &quot;tools for sysadmins&quot;. I plan on using<br>
these algorithms for puppet-gluster, but will try to maintain them<br>
separately as a standalone tool.<br>
<br>
The problem: Given a set of bricks and servers, if they have a logical<br>
naming convention, can an algorithm decide the ideal order. This could<br>
allow parameters such as replica count, and<br>
chained=true/false/offset#.<br>
<br>
The second problem: Given a set of bricks in a volume, if someone adds<br>
X bricks and removes Y bricks, is this valid, and what is the valid<br>
sequence of add/remove brick commands.<br>
<br>
I&#39;ve written some code with test cases to try and figure this all out.<br>
I&#39;ve left out a lot of corner cases, but the boilerplate is there to<br>
make it happen. Hopefully it&#39;s self explanatory. (gluster.py) Read and<br>
run it.<br>
<br>
Once this all works, the puppet-gluster use case is magic. It will be<br>
able to take care of these operations for you (if you want).<br>
<br>
For non puppet users, this will give admins the confidence to know<br>
what commands they should _probably_ run in what order. I say probably<br>
because we assume that if there&#39;s an error, they&#39;ll stop and inspect<br>
first.<br>
<br>
I haven&#39;t yet tried to implement the chained cases, or anything<br>
involving striping. There are also some corner cases with some of the<br>
current code. Once you add chaining and striping, etc, I realized it<br>
was time to step back and ask for help :)<br>
<br>
I hope this all makes sense. Comments, code, test cases are appreciated!<br>
<br>
Cheers,<br>
<br>
James<br>
@purpleidea (irc/twitter)<br>
<a href="https://ttboj.wordpress.com/" target="_blank">https://ttboj.wordpress.com/</a><br>
<br>_______________________________________________<br>
Gluster-users mailing list<br>
<a href="mailto:Gluster-users@gluster.org">Gluster-users@gluster.org</a><br>
<a href="http://supercolony.gluster.org/mailman/listinfo/gluster-users" target="_blank">http://supercolony.gluster.org/mailman/listinfo/gluster-users</a><br></blockquote></div><br></div>