)]}'
{"labs/scripts/ubuntu/setup_cinder_volumes.sh":[{"author":{"_account_id":11109,"name":"Roger Luethi","email":"rl@patchworkscience.org","username":"rluethi"},"change_message_id":"d0624cbea64587366d4b54b133d0dc542a7288bc","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"bab921fb_10426668","updated":"2015-04-26 12:43:18.000000000","message":"This file is not bashate clean.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":9178,"name":"Sayali Lunkad","email":"sayali.lunkad@suse.com","username":"sayalilunkad"},"change_message_id":"a5f22d74ede901027e597e326525277a63a2edeb","unresolved":false,"context_lines":[{"line_number":110,"context_line":"# Force restart cinder API and wait for 20 seconds."},{"line_number":111,"context_line":"echo \"Restarting Cinder API\""},{"line_number":112,"context_line":"node_ssh controller-mgmt \"sudo service cinder-api restart\""},{"line_number":113,"context_line":"sleep 20"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"echo \"Waiting for cinder to start.\""},{"line_number":116,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder service-list\" \u003e/dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"bab921fb_c2e11ad2","line":113,"updated":"2015-04-24 12:10:44.000000000","message":"I think instead of adding a random sleep here you can put it in a loop to till the service restarts. Something like on line 116 in this file.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":7007,"name":"Pranav Salunke","email":"dguitarbite@gmail.com","username":"dguitarbite"},"change_message_id":"87843f11ea3b38be7eec16e4ec2b0f0c03267ca1","unresolved":false,"context_lines":[{"line_number":110,"context_line":"# Force restart cinder API and wait for 20 seconds."},{"line_number":111,"context_line":"echo \"Restarting Cinder API\""},{"line_number":112,"context_line":"node_ssh controller-mgmt \"sudo service cinder-api restart\""},{"line_number":113,"context_line":"sleep 20"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"echo \"Waiting for cinder to start.\""},{"line_number":116,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder service-list\" \u003e/dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"1aca2d91_39185584","line":113,"in_reply_to":"7ad32947_9fbe26fe","updated":"2015-05-08 13:27:01.000000000","message":"Sayali, I do not understand your proposed solution! It is simple that while loop with sleep 20 is more complex than simple sleep 20. Also if the cinder-api service has issues/errors it will be caught later on in this script.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":9178,"name":"Sayali Lunkad","email":"sayali.lunkad@suse.com","username":"sayalilunkad"},"change_message_id":"42549de8033be49c0e147a1db3809de55d42ba6e","unresolved":false,"context_lines":[{"line_number":110,"context_line":"# Force restart cinder API and wait for 20 seconds."},{"line_number":111,"context_line":"echo \"Restarting Cinder API\""},{"line_number":112,"context_line":"node_ssh controller-mgmt \"sudo service cinder-api restart\""},{"line_number":113,"context_line":"sleep 20"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"echo \"Waiting for cinder to start.\""},{"line_number":116,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder service-list\" \u003e/dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7ad32947_9fbe26fe","line":113,"in_reply_to":"7ad32947_f3dc3c48","updated":"2015-04-28 06:04:05.000000000","message":"Maybe this needs sleep after the service has started. So in that case you could try using a while loop with a sleep of 20 so it will invariably sleep for 20 each time. And in the case where the service api \u0027lies\u0027 it will not be affected as even here we are restarting the service and then immediately putting a sleep whereas there we will only be adding a check to confirm. I think that would be a better option.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":7007,"name":"Pranav Salunke","email":"dguitarbite@gmail.com","username":"dguitarbite"},"change_message_id":"2200b32b3798a335994e3bd0cf26b6838fdb8072","unresolved":false,"context_lines":[{"line_number":110,"context_line":"# Force restart cinder API and wait for 20 seconds."},{"line_number":111,"context_line":"echo \"Restarting Cinder API\""},{"line_number":112,"context_line":"node_ssh controller-mgmt \"sudo service cinder-api restart\""},{"line_number":113,"context_line":"sleep 20"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"echo \"Waiting for cinder to start.\""},{"line_number":116,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder service-list\" \u003e/dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7ad32947_f3dc3c48","line":113,"in_reply_to":"bab921fb_309c4a0e","updated":"2015-04-27 22:41:40.000000000","message":"My initial patch had that considered, but it simply does not work all the time.\n\nAs per my observation, I see that trying to run the \"cinder services-list\" should technically wait till the services are back up and running but it does not work as required! Cinder takes time to be aware of its services exact status. I want to stress on this point to note that creating loop conditions will not address this issue because cinder-api status will lie :|. I believe that this is not a shortcut in this patch and I have spent considerable amount of time before concluding my final solution for this patch.\n\nThis sleep should fix it for the minimum cluster configuration but nothing less and everything more on the Ram and Processor.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":11109,"name":"Roger Luethi","email":"rl@patchworkscience.org","username":"rluethi"},"change_message_id":"d0624cbea64587366d4b54b133d0dc542a7288bc","unresolved":false,"context_lines":[{"line_number":110,"context_line":"# Force restart cinder API and wait for 20 seconds."},{"line_number":111,"context_line":"echo \"Restarting Cinder API\""},{"line_number":112,"context_line":"node_ssh controller-mgmt \"sudo service cinder-api restart\""},{"line_number":113,"context_line":"sleep 20"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"echo \"Waiting for cinder to start.\""},{"line_number":116,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder service-list\" \u003e/dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"bab921fb_309c4a0e","line":113,"in_reply_to":"bab921fb_c2e11ad2","updated":"2015-04-26 12:43:18.000000000","message":"I agree with Sayali. Of course it is possible to sleep for a long time and hope that fixes it. The preferred way, however, is to keep checking until a condition is met (i.e. service is up). That way, you don\u0027t wait too long (which increases the runtime unnecessarily) or not long enough (hitting the error). If you print out a period (.) every time you check, the log file will tell you how long you had to wait (which is useful information).","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":9178,"name":"Sayali Lunkad","email":"sayali.lunkad@suse.com","username":"sayalilunkad"},"change_message_id":"a5f22d74ede901027e597e326525277a63a2edeb","unresolved":false,"context_lines":[{"line_number":120,"context_line":"echo \"cinder service-list\""},{"line_number":121,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder service-list\""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"function check_cinder_services {"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    # It takes some time for cinder to detect its services and update its"},{"line_number":126,"context_line":"    # status. This method will wait for 20 seconds to get the status of the"}],"source_content_type":"text/x-sh","patch_set":3,"id":"bab921fb_85720cac","line":123,"updated":"2015-04-24 12:10:44.000000000","message":"I think since we are facing many scenarios where we need this sort of a check. It has been used twice in this file itself. I think  it would be nice if we had a common function in the lib which would  take the service command and the grep string as input and can be called where ever required. Let me know what you think.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":9178,"name":"Sayali Lunkad","email":"sayali.lunkad@suse.com","username":"sayalilunkad"},"change_message_id":"42549de8033be49c0e147a1db3809de55d42ba6e","unresolved":false,"context_lines":[{"line_number":120,"context_line":"echo \"cinder service-list\""},{"line_number":121,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder service-list\""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"function check_cinder_services {"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    # It takes some time for cinder to detect its services and update its"},{"line_number":126,"context_line":"    # status. This method will wait for 20 seconds to get the status of the"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7ad32947_df96de93","line":123,"in_reply_to":"7ad32947_73c82c75","updated":"2015-04-28 06:04:05.000000000","message":"This is used in more than one script. The heat script uses this.  And I think neutron too.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":7007,"name":"Pranav Salunke","email":"dguitarbite@gmail.com","username":"dguitarbite"},"change_message_id":"87843f11ea3b38be7eec16e4ec2b0f0c03267ca1","unresolved":false,"context_lines":[{"line_number":120,"context_line":"echo \"cinder service-list\""},{"line_number":121,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder service-list\""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"function check_cinder_services {"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    # It takes some time for cinder to detect its services and update its"},{"line_number":126,"context_line":"    # status. This method will wait for 20 seconds to get the status of the"}],"source_content_type":"text/x-sh","patch_set":3,"id":"1aca2d91_b43a2ccc","line":123,"in_reply_to":"7ad32947_df96de93","updated":"2015-05-08 13:27:01.000000000","message":"I disagree with you Sayali, this function has some special bits added to it, the work flow is not the same as other scripts.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":11109,"name":"Roger Luethi","email":"rl@patchworkscience.org","username":"rluethi"},"change_message_id":"d0624cbea64587366d4b54b133d0dc542a7288bc","unresolved":false,"context_lines":[{"line_number":120,"context_line":"echo \"cinder service-list\""},{"line_number":121,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder service-list\""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"function check_cinder_services {"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    # It takes some time for cinder to detect its services and update its"},{"line_number":126,"context_line":"    # status. This method will wait for 20 seconds to get the status of the"}],"source_content_type":"text/x-sh","patch_set":3,"id":"bab921fb_f0a13247","line":123,"in_reply_to":"bab921fb_85720cac","updated":"2015-04-26 12:43:18.000000000","message":"A generic function might be useful, but since this patch is already here, maybe we can introduce the generic function later on in a separate patch which only unifies  the wait loops.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":7007,"name":"Pranav Salunke","email":"dguitarbite@gmail.com","username":"dguitarbite"},"change_message_id":"2200b32b3798a335994e3bd0cf26b6838fdb8072","unresolved":false,"context_lines":[{"line_number":120,"context_line":"echo \"cinder service-list\""},{"line_number":121,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder service-list\""},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"function check_cinder_services {"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"    # It takes some time for cinder to detect its services and update its"},{"line_number":126,"context_line":"    # status. This method will wait for 20 seconds to get the status of the"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7ad32947_73c82c75","line":123,"in_reply_to":"bab921fb_f0a13247","updated":"2015-04-27 22:41:40.000000000","message":"I would like to argree with Roger here, but with different reason. The generic function idea is great but it is not exactly needed unless we have to do the same in more than one script.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":11109,"name":"Roger Luethi","email":"rl@patchworkscience.org","username":"rluethi"},"change_message_id":"d0624cbea64587366d4b54b133d0dc542a7288bc","unresolved":false,"context_lines":[{"line_number":154,"context_line":"AUTH\u003d\"source $CONFIG_DIR/demo-openstackrc.sh\""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"echo \"cinder create --display-name demo-volume1 1\""},{"line_number":157,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder create --display-name demo-volume1 1;sleep 20\""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"echo \"check if cinder has the given volume\""},{"line_number":160,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder list | grep demo-volume1\" \u003e /dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"bab921fb_b0885ac6","line":157,"updated":"2015-04-26 12:43:18.000000000","message":"Same as above, don\u0027t sleep 20.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":9178,"name":"Sayali Lunkad","email":"sayali.lunkad@suse.com","username":"sayalilunkad"},"change_message_id":"42549de8033be49c0e147a1db3809de55d42ba6e","unresolved":false,"context_lines":[{"line_number":154,"context_line":"AUTH\u003d\"source $CONFIG_DIR/demo-openstackrc.sh\""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"echo \"cinder create --display-name demo-volume1 1\""},{"line_number":157,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder create --display-name demo-volume1 1;sleep 20\""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"echo \"check if cinder has the given volume\""},{"line_number":160,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder list | grep demo-volume1\" \u003e /dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7ad32947_7fbb4a0f","line":157,"in_reply_to":"7ad32947_33a194aa","updated":"2015-04-28 06:04:05.000000000","message":"same as above.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":7007,"name":"Pranav Salunke","email":"dguitarbite@gmail.com","username":"dguitarbite"},"change_message_id":"87843f11ea3b38be7eec16e4ec2b0f0c03267ca1","unresolved":false,"context_lines":[{"line_number":154,"context_line":"AUTH\u003d\"source $CONFIG_DIR/demo-openstackrc.sh\""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"echo \"cinder create --display-name demo-volume1 1\""},{"line_number":157,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder create --display-name demo-volume1 1;sleep 20\""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"echo \"check if cinder has the given volume\""},{"line_number":160,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder list | grep demo-volume1\" \u003e /dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"1aca2d91_b496ac92","line":157,"in_reply_to":"7ad32947_7fbb4a0f","updated":"2015-05-08 13:27:01.000000000","message":"There is no use for while loop here. The output of this command is not reliable and attempting to delete cinder vol. which is under provisioning creates a race condition.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":7007,"name":"Pranav Salunke","email":"dguitarbite@gmail.com","username":"dguitarbite"},"change_message_id":"2200b32b3798a335994e3bd0cf26b6838fdb8072","unresolved":false,"context_lines":[{"line_number":154,"context_line":"AUTH\u003d\"source $CONFIG_DIR/demo-openstackrc.sh\""},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"echo \"cinder create --display-name demo-volume1 1\""},{"line_number":157,"context_line":"node_ssh controller-mgmt \"$AUTH; cinder create --display-name demo-volume1 1;sleep 20\""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"echo \"check if cinder has the given volume\""},{"line_number":160,"context_line":"until node_ssh controller-mgmt \"$AUTH; cinder list | grep demo-volume1\" \u003e /dev/null 2\u003e\u00261; do"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7ad32947_33a194aa","line":157,"in_reply_to":"bab921fb_b0885ac6","updated":"2015-04-27 22:41:40.000000000","message":"My answer is again the same as above. This is intentional and I have spent a lot more time on this as required for writing the loop. :)","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":11109,"name":"Roger Luethi","email":"rl@patchworkscience.org","username":"rluethi"},"change_message_id":"d0624cbea64587366d4b54b133d0dc542a7288bc","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    i\u003d1"},{"line_number":169,"context_line":"    while :"},{"line_number":170,"context_line":"    do"},{"line_number":171,"context_line":"        if [[ -z  `node_ssh controller-mgmt \"$AUTH;cinder list\" | grep creating` ]] \u003e /dev/null 2\u003e\u00261"},{"line_number":172,"context_line":"        then"},{"line_number":173,"context_line":"            echo \"Cinder volume seems to be created\""},{"line_number":174,"context_line":"            return 0"}],"source_content_type":"text/x-sh","patch_set":3,"id":"bab921fb_ab258f09","line":171,"updated":"2015-04-26 12:43:18.000000000","message":"If the list is empty or indicates an error, this function will claim the the volume was created successfully.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"},{"author":{"_account_id":7007,"name":"Pranav Salunke","email":"dguitarbite@gmail.com","username":"dguitarbite"},"change_message_id":"2200b32b3798a335994e3bd0cf26b6838fdb8072","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    i\u003d1"},{"line_number":169,"context_line":"    while :"},{"line_number":170,"context_line":"    do"},{"line_number":171,"context_line":"        if [[ -z  `node_ssh controller-mgmt \"$AUTH;cinder list\" | grep creating` ]] \u003e /dev/null 2\u003e\u00261"},{"line_number":172,"context_line":"        then"},{"line_number":173,"context_line":"            echo \"Cinder volume seems to be created\""},{"line_number":174,"context_line":"            return 0"}],"source_content_type":"text/x-sh","patch_set":3,"id":"7ad32947_93f50885","line":171,"in_reply_to":"bab921fb_ab258f09","updated":"2015-04-27 22:41:40.000000000","message":"I think I should add a comment explaining the obvious part. This is a feature not a bug ;).\n\nIf the cinder-volume is under creating state, it will not allow deleting that volume and give error, which is handled in this case. If the volume is under creating or created state, the volume may be deleted. I think I might want to add another if clasue to print error state.","commit_id":"a8151281ad0f768cade92c99e26fd09bb923a062"}]}
