)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dcff789bb291ec74043782f4add4704ca358dd57","unresolved":false,"context_lines":[{"line_number":5829,"context_line":"            vm_power_state \u003d vm_instance.state"},{"line_number":5830,"context_line":"            if ((vm_power_state \u003d\u003d power_state.NOSTATE)"},{"line_number":5831,"context_line":"                  and (db_instance.vm_state \u003d\u003d vm_states.ERROR)):"},{"line_number":5832,"context_line":"                db_instance.cleaned \u003d True"},{"line_number":5833,"context_line":"                db_instance.save()"},{"line_number":5834,"context_line":"        except exception.InstanceNotFound:"},{"line_number":5835,"context_line":"            vm_power_state \u003d power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_253d96bb","line":5832,"updated":"2015-08-14 08:08:26.000000000","message":"cleaned flag means that all the resources of this instance are released on the compute host. You set this flag true here but I don\u0027t see how do you ensure that the resources are really released. There is a cleanup method in the virt driver API and libvirt driver implements it, so at least one driver has an extra cleanup logic that needs to be executed before you can assume that the instance is cleaned.","commit_id":"844593c8f95fec6d75f2c039fccd8cf3802bb265"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8c5a32f31a0a750f0894ab284193150cd0f4f69f","unresolved":false,"context_lines":[{"line_number":5829,"context_line":"            vm_power_state \u003d vm_instance.state"},{"line_number":5830,"context_line":"            if ((vm_power_state \u003d\u003d power_state.NOSTATE)"},{"line_number":5831,"context_line":"                  and (db_instance.vm_state \u003d\u003d vm_states.ERROR)):"},{"line_number":5832,"context_line":"                db_instance.cleaned \u003d True"},{"line_number":5833,"context_line":"                db_instance.save()"},{"line_number":5834,"context_line":"        except exception.InstanceNotFound:"},{"line_number":5835,"context_line":"            vm_power_state \u003d power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_d9c7b262","line":5832,"in_reply_to":"1a4dcd0f_213901f3","updated":"2015-08-17 08:49:34.000000000","message":"I cannot really comment form ironic point of view. However I think you create a race between _query_driver_power_state_and_sync (which is called from the periodic task _sync_power_states) and _run_pending_deletes (see https://github.com/openstack/nova/blob/master/nova/compute/manager.py#L6347) which also a periodic task. The later gets deleted but not cleaned instances from the db and cleans up the instance disk while the former sets the cleaned flag without cleaning the instance disk. Therefore I think if the former runs first then the instance disk will not be deleted and we will leak resources.","commit_id":"844593c8f95fec6d75f2c039fccd8cf3802bb265"},{"author":{"_account_id":15967,"name":"vikas choudhary","email":"choudharyvikas16@gmail.com","username":"vikaschoudhary16"},"change_message_id":"06ac4905813e6151ae9245ac5c2f4bf9a510dcd0","unresolved":false,"context_lines":[{"line_number":5829,"context_line":"            vm_power_state \u003d vm_instance.state"},{"line_number":5830,"context_line":"            if ((vm_power_state \u003d\u003d power_state.NOSTATE)"},{"line_number":5831,"context_line":"                  and (db_instance.vm_state \u003d\u003d vm_states.ERROR)):"},{"line_number":5832,"context_line":"                db_instance.cleaned \u003d True"},{"line_number":5833,"context_line":"                db_instance.save()"},{"line_number":5834,"context_line":"        except exception.InstanceNotFound:"},{"line_number":5835,"context_line":"            vm_power_state \u003d power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_213901f3","line":5832,"in_reply_to":"1a4dcd0f_253d96bb","updated":"2015-08-14 11:30:40.000000000","message":"Gibi many thanks for providing review comments :).\nThis issue was raised on ironic driver.I reproduced and analyzed it with ironic driver\n only.Behavior of libvirt driver APIs should also be same.If this block is being executed \n:                                                                                                                                         \n1.virt driver(ironic/libvirt) is not broken.                                                                             \n2.Instance could not be found in virtualization driver database.If resources are not released, there should have been an entry in hypervisor db.  power_state.NOSTATE \nis being sent by virt driver only when instance is not found.\nhttps://github.com/openstack/nova/blob/master/nova/virt/ironic/driver.py#L605\n\nPlease correct me if my understanding is wrong.","commit_id":"844593c8f95fec6d75f2c039fccd8cf3802bb265"},{"author":{"_account_id":15967,"name":"vikas choudhary","email":"choudharyvikas16@gmail.com","username":"vikaschoudhary16"},"change_message_id":"6ef7e600151ae737311ebab35b1e328898630019","unresolved":false,"context_lines":[{"line_number":5829,"context_line":"            vm_power_state \u003d vm_instance.state"},{"line_number":5830,"context_line":"            if ((vm_power_state \u003d\u003d power_state.NOSTATE)"},{"line_number":5831,"context_line":"                  and (db_instance.vm_state \u003d\u003d vm_states.ERROR)):"},{"line_number":5832,"context_line":"                db_instance.cleaned \u003d True"},{"line_number":5833,"context_line":"                db_instance.save()"},{"line_number":5834,"context_line":"        except exception.InstanceNotFound:"},{"line_number":5835,"context_line":"            vm_power_state \u003d power_state.NOSTATE"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa1b9901_60540654","line":5832,"in_reply_to":"1a4dcd0f_d9c7b262","updated":"2015-08-17 11:21:18.000000000","message":"Thanks Gibi.\nYou are right. I was doing mistake.Actually libvirt driver and ironic driver does not behave exactly same.In case of a deploy failure, ironic driver do clean up hypervisor but thats not the case with libvirt driver.\nhttps://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L2490\nhttps://github.com/openstack/nova/blob/master/nova/virt/ironic/driver.py#L796\n\nFix should be related to ironic driver only.I will be re-submitting changes soon.","commit_id":"844593c8f95fec6d75f2c039fccd8cf3802bb265"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dcff789bb291ec74043782f4add4704ca358dd57","unresolved":false,"context_lines":[{"line_number":780,"context_line":"        for instance in instances:"},{"line_number":781,"context_line":"            if ((instance.vm_state !\u003d vm_states.DELETED)"},{"line_number":782,"context_line":"                     and not (instance.vm_state \u003d\u003d vm_states.ERROR"},{"line_number":783,"context_line":"                     and instance.cleaned)):"},{"line_number":784,"context_line":"                self._update_usage_from_instance(context, instance)"},{"line_number":785,"context_line":""},{"line_number":786,"context_line":"    def _find_orphaned_instances(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_25ab56d8","line":783,"updated":"2015-08-14 08:08:26.000000000","message":"I think we don\u0027t need to check if the instance is in ERROR state or not, it should be enough to check if it cleaned or not as cleaned should mean that there is no resource usage exists for this instance on the host","commit_id":"844593c8f95fec6d75f2c039fccd8cf3802bb265"},{"author":{"_account_id":15967,"name":"vikas choudhary","email":"choudharyvikas16@gmail.com","username":"vikaschoudhary16"},"change_message_id":"06ac4905813e6151ae9245ac5c2f4bf9a510dcd0","unresolved":false,"context_lines":[{"line_number":780,"context_line":"        for instance in instances:"},{"line_number":781,"context_line":"            if ((instance.vm_state !\u003d vm_states.DELETED)"},{"line_number":782,"context_line":"                     and not (instance.vm_state \u003d\u003d vm_states.ERROR"},{"line_number":783,"context_line":"                     and instance.cleaned)):"},{"line_number":784,"context_line":"                self._update_usage_from_instance(context, instance)"},{"line_number":785,"context_line":""},{"line_number":786,"context_line":"    def _find_orphaned_instances(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a4dcd0f_fc389cd6","line":783,"in_reply_to":"1a4dcd0f_25ab56d8","updated":"2015-08-14 11:30:40.000000000","message":"yes, your point makes sense.","commit_id":"844593c8f95fec6d75f2c039fccd8cf3802bb265"}],"nova/tests/unit/compute/test_resource_tracker.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d03829ec58e3d08783052516fc71d61782e28177","unresolved":false,"context_lines":[{"line_number":41,"context_line":"from nova.tests.unit.pci import fakes as pci_fakes"},{"line_number":42,"context_line":"from nova.virt import driver"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"FAKE_VIRT_MEMORY_MB \u003d 5"},{"line_number":46,"context_line":"FAKE_VIRT_MEMORY_OVERHEAD \u003d 1"},{"line_number":47,"context_line":"FAKE_VIRT_MEMORY_WITH_OVERHEAD \u003d ("}],"source_content_type":"text/x-python","patch_set":4,"id":"1a4dcd0f_d94812cf","side":"PARENT","line":44,"updated":"2015-08-17 08:51:43.000000000","message":"Seems like an unnecessary change","commit_id":"003a2f6fcb3295d15d61825bfe6fa7e07033693a"}]}
