)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"37bf5d5b6aa8a81f1854d595de156f07f40acdb8","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Nodes in cleaning are not associated with an instance and so should not"},{"line_number":10,"context_line":"report as consuming resources. Instead, report as zero resources"},{"line_number":11,"context_line":"available."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I48913f724a1bbe3711ea543a50b9ba096d5e95d7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3afb71cf_b0b8ede6","line":11,"updated":"2015-06-05 04:28:40.000000000","message":"Do you mean report as zero resource *consumed*?","commit_id":"f7e684e8087d6f60f846ab5fe8afc773d782bce0"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"77a6489478a74c0d3e0b541a801db6a5beea21e5","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Nodes in cleaning are not associated with an instance and so should not"},{"line_number":10,"context_line":"report as consuming resources. Instead, report as zero resources"},{"line_number":11,"context_line":"available."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: I48913f724a1bbe3711ea543a50b9ba096d5e95d7"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3afb71cf_4820e39b","line":11,"in_reply_to":"3afb71cf_b0b8ede6","updated":"2015-06-05 13:56:24.000000000","message":"No, zero available. This is what we do for nodes in a failed state, etc; they have no resources available to be scheduled to.","commit_id":"f7e684e8087d6f60f846ab5fe8afc773d782bce0"}],"nova/virt/ironic/driver.py":[{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"0a5667a5c0f9d34dd33d655e65a6adeb560f0b5c","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        # keep NOSTATE around for compatibility"},{"line_number":211,"context_line":"        good_provision_states \u003d ["},{"line_number":212,"context_line":"            ironic_states.AVAILABLE, ironic_states.NOSTATE]"},{"line_number":213,"context_line":"        return (node_obj.maintenance or"},{"line_number":214,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":215,"context_line":"                node_obj.provision_state not in good_provision_states)"},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3afb71cf_7c36bd04","line":213,"updated":"2015-06-05 15:41:46.000000000","message":"The CLEANING/DELETING/DELETED states need to be added up here (maybe ZAPPING too?).\n\nAlso, can we get a comment describing what states we should consider \"used\" vs \"unavailable\" so someone else doesn\u0027t inadvertently recreate the bug at a later date.","commit_id":"e196c43207d172521fc86d473b8ad182b9ddc3e5"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"69d396bc1fc8ff5cb9b6d4b535cd10659256d0ba","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        # keep NOSTATE around for compatibility"},{"line_number":211,"context_line":"        good_provision_states \u003d ["},{"line_number":212,"context_line":"            ironic_states.AVAILABLE, ironic_states.NOSTATE]"},{"line_number":213,"context_line":"        return (node_obj.maintenance or"},{"line_number":214,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":215,"context_line":"                node_obj.provision_state not in good_provision_states)"},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3afb71cf_37873e11","line":213,"in_reply_to":"3afb71cf_3773beb3","updated":"2015-06-05 15:50:16.000000000","message":"I understand now, thanks.","commit_id":"e196c43207d172521fc86d473b8ad182b9ddc3e5"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"d598ef3eb1a01aa3df86f6a66690047f67c1c950","unresolved":false,"context_lines":[{"line_number":210,"context_line":"        # keep NOSTATE around for compatibility"},{"line_number":211,"context_line":"        good_provision_states \u003d ["},{"line_number":212,"context_line":"            ironic_states.AVAILABLE, ironic_states.NOSTATE]"},{"line_number":213,"context_line":"        return (node_obj.maintenance or"},{"line_number":214,"context_line":"                node_obj.power_state in bad_power_states or"},{"line_number":215,"context_line":"                node_obj.provision_state not in good_provision_states)"},{"line_number":216,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3afb71cf_3773beb3","line":213,"in_reply_to":"3afb71cf_7c36bd04","updated":"2015-06-05 15:43:06.000000000","message":"They don\u0027t need to be added here. Note \"provision_state not in (available, nostate)\". Any other provision state besides those two returns False.","commit_id":"e196c43207d172521fc86d473b8ad182b9ddc3e5"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"69d396bc1fc8ff5cb9b6d4b535cd10659256d0ba","unresolved":false,"context_lines":[{"line_number":224,"context_line":"        used."},{"line_number":225,"context_line":"        \"\"\""},{"line_number":226,"context_line":"        used_provision_states \u003d ["},{"line_number":227,"context_line":"            ironic_states.DEPLOYING, ironic_states.DEPLOYWAIT,"},{"line_number":228,"context_line":"            ironic_states.DEPLOYDONE, ironic_states.ACTIVE]"},{"line_number":229,"context_line":"        return (node_obj.instance_uuid is not None or"},{"line_number":230,"context_line":"                node_obj.provision_state in used_provision_states)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3afb71cf_177d621c","line":227,"updated":"2015-06-05 15:50:16.000000000","message":"We should still add a comment warning not to add states not associated with an instance to this list.","commit_id":"e196c43207d172521fc86d473b8ad182b9ddc3e5"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"ea618eefa6638eac5a32d22c6f1b7a454aa45000","unresolved":false,"context_lines":[{"line_number":221,"context_line":"        or not. A node is used when it is either in the process of putting"},{"line_number":222,"context_line":"        a new instance on the node, has an instance on the node, or is in"},{"line_number":223,"context_line":"        the process of cleaning up from a deleted instance. Returns True if"},{"line_number":224,"context_line":"        used."},{"line_number":225,"context_line":""},{"line_number":226,"context_line":"        If we report resources as consumed for a node that does not have an"},{"line_number":227,"context_line":"        instance on it, the resource tracker will notice there\u0027s no instances"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_26234b07","line":224,"updated":"2015-06-08 19:47:54.000000000","message":"It seems like this paragraph could be removed.  Or maybe reworded, since it\u0027s really about the instance attachment.","commit_id":"f0ca0f73b131838f1441ff4affae10fe78ff7150"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"967465f82f8e9068b6e559ffca0ad60d2ddf5ec4","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        consuming resources and try to correct us. So only nodes with an"},{"line_number":229,"context_line":"        instance attached should report as consumed here."},{"line_number":230,"context_line":"        \"\"\""},{"line_number":231,"context_line":"        return node_obj.instance_uuid is not None"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    def _node_resource(self, node):"},{"line_number":234,"context_line":"        \"\"\"Helper method to create resource dict from node stats.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_1d42233f","line":231,"updated":"2015-06-05 16:29:08.000000000","message":"See comment at L755 first.\n\nWhat about:\n\n   return node_obj.provision_state !\u003d ironic_states.AVAILABLE\n\nSince we only schedule something in the node when it\u0027s AVAILABLE, maybe we can determine that everything else means the node resources are not available","commit_id":"f0ca0f73b131838f1441ff4affae10fe78ff7150"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"ea618eefa6638eac5a32d22c6f1b7a454aa45000","unresolved":false,"context_lines":[{"line_number":279,"context_line":"        if self._node_resources_used(node):"},{"line_number":280,"context_line":"            # Node is in the process of deploying, is deployed, or is in"},{"line_number":281,"context_line":"            # the process of cleaning up from a deploy. Report all of its"},{"line_number":282,"context_line":"            # resources as in use."},{"line_number":283,"context_line":"            vcpus_used \u003d vcpus"},{"line_number":284,"context_line":"            memory_mb_used \u003d memory_mb"},{"line_number":285,"context_line":"            local_gb_used \u003d local_gb"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_266a2b1b","line":282,"updated":"2015-06-08 19:47:54.000000000","message":"This comment seems out of date now.","commit_id":"f0ca0f73b131838f1441ff4affae10fe78ff7150"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"967465f82f8e9068b6e559ffca0ad60d2ddf5ec4","unresolved":false,"context_lines":[{"line_number":771,"context_line":"            node \u003d _validate_instance_and_node(ironicclient, instance)"},{"line_number":772,"context_line":"            if node.provision_state in (ironic_states.NOSTATE,"},{"line_number":773,"context_line":"                                        ironic_states.CLEANING,"},{"line_number":774,"context_line":"                                        ironic_states.CLEANFAIL,"},{"line_number":775,"context_line":"                                        ironic_states.AVAILABLE):"},{"line_number":776,"context_line":"                # From a user standpoint, the node is unprovisioned. If a node"},{"line_number":777,"context_line":"                # gets into CLEANFAIL state, it must be fixed in Ironic, but we"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_c255ca1d","line":774,"updated":"2015-06-05 16:29:08.000000000","message":"The flow seems to be:\n\n1 - From destroy() we are going to call this method (_unprovision(), L830)\n\n2 - We then call set_provision_state deleted (L757) to delete the instance in Ironic. And we pool Ironic until the node provision_state goes to one of the states above.\n\nSay the node goes from ACTIVE to CLEANING. We then break the loop. And return from _unprovision()\n\n3 - Back to the destroy() context, not the code is going to call _cleanup_deploy() (L832) and that will remove the instance_uuid association of the node.\n\nAt this point, the node might still be at CLEANING (because it can take a long time), but the instance was already removed from Ironic therefor a call to _node_resources_used (L217) will return that the node resources are not used (which seems wrong, since it\u0027s cleaning yet and not ready for being scheduled again)","commit_id":"f0ca0f73b131838f1441ff4affae10fe78ff7150"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"7c9d4f8ad81d4570f6ad2a26b3e3a107764dde18","unresolved":false,"context_lines":[{"line_number":771,"context_line":"            node \u003d _validate_instance_and_node(ironicclient, instance)"},{"line_number":772,"context_line":"            if node.provision_state in (ironic_states.NOSTATE,"},{"line_number":773,"context_line":"                                        ironic_states.CLEANING,"},{"line_number":774,"context_line":"                                        ironic_states.CLEANFAIL,"},{"line_number":775,"context_line":"                                        ironic_states.AVAILABLE):"},{"line_number":776,"context_line":"                # From a user standpoint, the node is unprovisioned. If a node"},{"line_number":777,"context_line":"                # gets into CLEANFAIL state, it must be fixed in Ironic, but we"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_7dc117e4","line":774,"in_reply_to":"3afb71cf_5dabfb89","updated":"2015-06-05 16:44:01.000000000","message":"Oh yeah... gosh it\u0027s messy.\n\nJust pointing out, it seems to have a difference there. When  _node_resources_used returns True we report all the resources as being used. When _node_resources_unavailable returns True we basically say that there are no resources (everything is 0).\n\nI think that at the end both will result in what we want: Prevent an instance from being scheduled onto this node. But, still RT seems to see both cases differently.\n\n(just wanted to point that out).\n\n...\n\nTODO: We need to refactor those bits","commit_id":"f0ca0f73b131838f1441ff4affae10fe78ff7150"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"b239c7a2b7bd314ee68a818ed63ae9b75777fb19","unresolved":false,"context_lines":[{"line_number":771,"context_line":"            node \u003d _validate_instance_and_node(ironicclient, instance)"},{"line_number":772,"context_line":"            if node.provision_state in (ironic_states.NOSTATE,"},{"line_number":773,"context_line":"                                        ironic_states.CLEANING,"},{"line_number":774,"context_line":"                                        ironic_states.CLEANFAIL,"},{"line_number":775,"context_line":"                                        ironic_states.AVAILABLE):"},{"line_number":776,"context_line":"                # From a user standpoint, the node is unprovisioned. If a node"},{"line_number":777,"context_line":"                # gets into CLEANFAIL state, it must be fixed in Ironic, but we"}],"source_content_type":"text/x-python","patch_set":4,"id":"3afb71cf_5dabfb89","line":774,"in_reply_to":"3afb71cf_c255ca1d","updated":"2015-06-05 16:31:51.000000000","message":"Right, so see lines 279-290 or so. If _node_resources_used returns False, we check _node_resources_unavailable, which will return True. That will cause us to report zero resources available for that node and won\u0027t be scheduled to.","commit_id":"f0ca0f73b131838f1441ff4affae10fe78ff7150"}]}
