)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"7b83c5cd1a0e9fc6bd42d274c378b3f9d423715b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Clean up orphan instances"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This peaordic task instances that are listed in the hypervisor"},{"line_number":10,"context_line":"on a given compute node but are not listed in the nova database"},{"line_number":11,"context_line":"as running on that compute node."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bfdaf3ff_226adab2","line":9,"range":{"start_line":9,"start_character":13,"end_line":9,"end_character":14},"updated":"2019-01-15 04:33:16.000000000","message":"Typo: periodic.\nThis sentence has poor grammar.\n\nI think you wanted to say something like:\n\nThis creates a periodic task to clean up orphan instances. This will destroy lingering instances on the hypervisor without any record in the nova database.","commit_id":"408155ff573c09aea32a5480533be0f10735cded"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9cca6824b6f534db3c4321df8d58e2e3cb050f91","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Clean up orphan instances"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This peaordic task instances that are listed in the hypervisor"},{"line_number":10,"context_line":"on a given compute node but are not listed in the nova database"},{"line_number":11,"context_line":"as running on that compute node."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Instances in the middle of migration or waiting for resize/migrate"},{"line_number":14,"context_line":"confirmation will not be destroyed."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"bfdaf3ff_dc8a80bd","line":11,"range":{"start_line":10,"start_character":24,"end_line":11,"end_character":31},"updated":"2019-01-18 15:40:44.000000000","message":"When I read this the first time, I interpreted it as \"not listed in the nova database\" \u003d\u003d \"deleted from the nova database\". It would be helpful [for people like me] if you could re-word this a bit to be clear that instances are not deleted, they are still running and should be destroyed. Also, please add words explaining why they should be destroyed if they are not \"deleted\" in the nova database.","commit_id":"408155ff573c09aea32a5480533be0f10735cded"},{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"1edee150363a23927a14e80eaba998e79632795e","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"  This commit introduce a new periodic clean task to query vm from"},{"line_number":22,"context_line":"libvirt and deleted them if they are not tracking by Nova."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-Bug: #1820802"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: Ie9fe8bd25f4625161d529ecdcc2822fc9d614083"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5fc1f717_1bd65ec5","line":23,"updated":"2019-03-19 14:58:41.000000000","message":"Append to this paragraph:\n\nThis is configurable via option running_orphan_instance_action.","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"e698a128c0a46e92e0a7ff5a8977e4a2ca603ef5","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"  This commit introduce a new periodic clean task to query vm from"},{"line_number":22,"context_line":"libvirt and deleted them if they are not tracking by Nova."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"Closes-Bug: #1820802"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: Ie9fe8bd25f4625161d529ecdcc2822fc9d614083"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"5fc1f717_9311c9af","line":23,"in_reply_to":"5fc1f717_1bd65ec5","updated":"2019-03-20 02:23:33.000000000","message":"Done","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":13,"context_line":"There may be a few ways an instance is not listed in the Database"},{"line_number":14,"context_line":"at all. For example,there is some sort of failure after"},{"line_number":15,"context_line":"live-migration started and not cleaning up completely in"},{"line_number":16,"context_line":"live-migration rollback due to unhandled exception. The"},{"line_number":17,"context_line":"live-migration completes. The result are 2 identical VMs -- one of"},{"line_number":18,"context_line":"them becomes an orphan that is not tracked in nova but is still"},{"line_number":19,"context_line":"seen by libvirt."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"This commit introduce a new periodic clean task to query vm from"},{"line_number":22,"context_line":"libvirt and deleted them if they are not tracking by Nova. This is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"5fc1f717_a6116e5f","line":19,"range":{"start_line":16,"start_character":52,"end_line":19,"end_character":16},"updated":"2019-03-27 14:24:53.000000000","message":"Yeah so in this case we have 1 instance in the database but it\u0027s pointing at the destination host/node for the live migration, but we failed to cleanup the guest on the source hypervisor so it\u0027s still running there consuming resources, correct?","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":13,"context_line":"There may be a few ways an instance is not listed in the Database"},{"line_number":14,"context_line":"at all. For example,there is some sort of failure after"},{"line_number":15,"context_line":"live-migration started and not cleaning up completely in"},{"line_number":16,"context_line":"live-migration rollback due to unhandled exception. The"},{"line_number":17,"context_line":"live-migration completes. The result are 2 identical VMs -- one of"},{"line_number":18,"context_line":"them becomes an orphan that is not tracked in nova but is still"},{"line_number":19,"context_line":"seen by libvirt."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"This commit introduce a new periodic clean task to query vm from"},{"line_number":22,"context_line":"libvirt and deleted them if they are not tracking by Nova. This is"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"5fc1f717_fc7db9b1","line":19,"range":{"start_line":16,"start_character":52,"end_line":19,"end_character":16},"in_reply_to":"5fc1f717_a6116e5f","updated":"2019-03-28 08:15:43.000000000","message":"yeah. This quite complex to reproduce. @Jim Gauld know the whole story, if we need more clarify.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There may be an instance is not listed in the Database at all. For"},{"line_number":14,"context_line":"example,there is some sort of failure after live-migration started"},{"line_number":15,"context_line":"and not cleaning up completely in live-migration rollback due to"},{"line_number":16,"context_line":"unhandled exception. The live-migration completes. The result are"},{"line_number":17,"context_line":"2 identical VMs -- one of them becomes an orphan that is not tracked"},{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ffb9cba7_ab83dfcb","line":16,"range":{"start_line":15,"start_character":4,"end_line":16,"end_character":20},"updated":"2019-04-26 13:52:35.000000000","message":"Could we fix the original unhandled exception case? Is there  a bug report for it?","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"802e0374245bd226dd641d2959a8b0f02802cd10","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There may be an instance is not listed in the Database at all. For"},{"line_number":14,"context_line":"example,there is some sort of failure after live-migration started"},{"line_number":15,"context_line":"and not cleaning up completely in live-migration rollback due to"},{"line_number":16,"context_line":"unhandled exception. The live-migration completes. The result are"},{"line_number":17,"context_line":"2 identical VMs -- one of them becomes an orphan that is not tracked"},{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ffb9cba7_88611ad6","line":16,"range":{"start_line":15,"start_character":4,"end_line":16,"end_character":20},"in_reply_to":"ffb9cba7_3c3e3b8c","updated":"2019-04-29 15:23:15.000000000","message":"These robustness scenarios go way-back, and are hard to recreate without forcing system problems, and there have been a number of robustness improvements along the way which many have addressed a number of the error scenarios.  We don\u0027t have historical bug reports from pre-StarlingX. When we originally tried to address this problem, I would either try to recreate a fault, or simulate by injecting various exceptions in various parts of code.\n\nThere were types of robustness cases based on notes I have which resulted in orphans:\ncase 1: server duplicated with live-migration with fault\n- start live-migration\n- during LM there is a fault of some kind and does not entirely clean up, but libvirt continues to completion\n\neg. during LM :\n- controller is rebooted or AMQP/rabbitmq killed\n- get a rollback but the rollback fails with some exception\n- get networking API port error\n- get cinder API error\n- get ISCSI error at some point\n- If using 2M or 1G hugepages and system has very little remaining 4K pages, the orphan VMs contribute to unpredictable/unquantifiable behaviour due to OOM-killer killing off various Linux system tasks that don\u0027t always come back, or we notice subsequent libvirt exceptions or cannot \u0027fork\u0027 processes due to insufficient memory.\n\ncase 2: This description from someone else\n- nova-compute goes down\n- user deletes the server (local delete in the API)\n- archive/purge deleted records from the DB\n- nova-compute comes back up\n- guest is still running on the hypervisor and consuming resources\n\nTo simulate faults:\n- inject failures -- place in various parts of code (eg, pre-live migration, post-live migration, rollback handling, pinning overlap problem in resource tracker, neutron networking API, cinder volume API, etc).\n\nThe \u0027case 1\u0027 scenario would happen due to uncontrolled events during live-migration (like power outage requiring \u0027dead-office-recovery\u0027, reboot of compute host, or AMQP failure.)","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ba8bea6d926b0949a585e03a1abd863e67c91a85","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There may be an instance is not listed in the Database at all. For"},{"line_number":14,"context_line":"example,there is some sort of failure after live-migration started"},{"line_number":15,"context_line":"and not cleaning up completely in live-migration rollback due to"},{"line_number":16,"context_line":"unhandled exception. The live-migration completes. The result are"},{"line_number":17,"context_line":"2 identical VMs -- one of them becomes an orphan that is not tracked"},{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"dfbec78f_afa022a7","line":16,"range":{"start_line":15,"start_character":4,"end_line":16,"end_character":20},"in_reply_to":"ffb9cba7_88611ad6","updated":"2019-05-04 14:59:10.000000000","message":"@Jim: thanks. It feels that at least in some of these cases the orphaning can be prevented by fixing the root cause in nova.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"ccd41efbe6902d0e044dcbfa47042714c7d7a9fb","unresolved":false,"context_lines":[{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There may be an instance is not listed in the Database at all. For"},{"line_number":14,"context_line":"example,there is some sort of failure after live-migration started"},{"line_number":15,"context_line":"and not cleaning up completely in live-migration rollback due to"},{"line_number":16,"context_line":"unhandled exception. The live-migration completes. The result are"},{"line_number":17,"context_line":"2 identical VMs -- one of them becomes an orphan that is not tracked"},{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ffb9cba7_3c3e3b8c","line":16,"range":{"start_line":15,"start_character":4,"end_line":16,"end_character":20},"in_reply_to":"ffb9cba7_ab83dfcb","updated":"2019-04-29 05:55:37.000000000","message":"@Jim Gauld may help on this question.\nDescription here may not be exactly what happened there. commit message need to be revised.\n\nThat problem happens while the networking has broken(if I remember correctly, this reported by starlingX.)","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"And if delete an instance while the nova-compute service is down,"},{"line_number":22,"context_line":"the instance will became orphan and is not tracked by nova database."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"This commit introduce a new periodic clean task to query vm from"},{"line_number":25,"context_line":"libvirt and deleted them if they are not tracking by Nova. Which"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ffb9cba7_0b66ab52","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":68},"updated":"2019-04-26 13:52:35.000000000","message":"I think we mark those instance deleted in the database but does not remove them from the db so when the compute comes up it will clean up the instance from the hypervisor","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"ccd41efbe6902d0e044dcbfa47042714c7d7a9fb","unresolved":false,"context_lines":[{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"And if delete an instance while the nova-compute service is down,"},{"line_number":22,"context_line":"the instance will became orphan and is not tracked by nova database."},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"This commit introduce a new periodic clean task to query vm from"},{"line_number":25,"context_line":"libvirt and deleted them if they are not tracking by Nova. Which"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ffb9cba7_fc5c23ee","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":68},"in_reply_to":"ffb9cba7_0b66ab52","updated":"2019-04-29 05:55:37.000000000","message":"@Jim Gauld. The instance this patch talk about is the instance which not in DB totally. also reported by starlingX, JIm Gault may help us on this.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":25,"context_line":"libvirt and deleted them if they are not tracking by Nova. Which"},{"line_number":26,"context_line":"action is taken is configurable via option"},{"line_number":27,"context_line":"\u0027running_orphan_instance_action\u0027."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: Ie9fe8bd25f4625161d529ecdcc2822fc9d614083"},{"line_number":30,"context_line":"Closes-Bug: #1820802"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"ffb9cba7_11325ca8","line":28,"updated":"2019-04-26 13:52:35.000000000","message":"I feel that if the above cases can happen then we also have to try to fix the root cause of the problems as well.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"80a04995b8bdbdc83c469375b53a1012ea27b23d","unresolved":false,"context_lines":[{"line_number":11,"context_line":"deleted, and have \u0027deleted\u0027 attribute in database."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There may be an instance is not listed in the Database at all. For"},{"line_number":14,"context_line":"example,there is some sort of failure after live-migration started"},{"line_number":15,"context_line":"and not cleaning up completely in live-migration rollback due to"},{"line_number":16,"context_line":"unhandled exception. The live-migration completes. The result are"},{"line_number":17,"context_line":"2 identical VMs -- one of them becomes an orphan that is not tracked"},{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":37,"id":"5faad753_594cf375","line":16,"range":{"start_line":14,"start_character":8,"end_line":16,"end_character":20},"updated":"2019-09-06 02:15:29.000000000","message":"To be clear, I don\u0027t think this scenario should be in the scope of this patch. If there are bugs in the rollback routines for migrations, those should be fixed as separate bugs, which Balazs Gibizer commented on PS18.\n\nThis patch should only be about cleaning up \"unknown\" instances which are not in the database at all.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":11,"context_line":"deleted, and have \u0027deleted\u0027 attribute in database."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"There may be an instance is not listed in the Database at all. For"},{"line_number":14,"context_line":"example,there is some sort of failure after live-migration started"},{"line_number":15,"context_line":"and not cleaning up completely in live-migration rollback due to"},{"line_number":16,"context_line":"unhandled exception. The live-migration completes. The result are"},{"line_number":17,"context_line":"2 identical VMs -- one of them becomes an orphan that is not tracked"},{"line_number":18,"context_line":"as running in source host but is still running and consuming"},{"line_number":19,"context_line":"resources."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":37,"id":"3fa7e38b_15695324","line":16,"range":{"start_line":14,"start_character":8,"end_line":16,"end_character":20},"in_reply_to":"5faad753_594cf375","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"7d49877f45c6335c4093f90e4be44cc74e080544","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Yongli He \u003cyongli.he@intel.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2019-10-14 16:11:07 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"clean up orphan instances"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The existing _cleanup_running_deleted_instances() periodic audit"},{"line_number":10,"context_line":"calls _running_deleted_instances, and finds instances that were"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":42,"id":"3fa7e38b_3fdde2dc","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":25},"updated":"2019-11-15 07:25:28.000000000","message":"We should name this patch as cleanup \u0027non tracked\u0027 instance.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"}],"nova/compute/manager.py":[{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"570bfde68a3d39dc79aed7869341e2d190bd04c6","unresolved":false,"context_lines":[{"line_number":8367,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8368,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8369,"context_line":""},{"line_number":8370,"context_line":"    @periodic_task.periodic_task(spacing\u003d300)"},{"line_number":8371,"context_line":"    def _cleanup_running_orphan_instances(self, context):"},{"line_number":8372,"context_line":"        \"\"\"Cleanup orphan instances."},{"line_number":8373,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_f7549223","line":8370,"range":{"start_line":8370,"start_character":41,"end_line":8370,"end_character":44},"updated":"2019-01-15 04:22:17.000000000","message":"This should have a configuration parameter for orphan instance cleanup interval.","commit_id":"408155ff573c09aea32a5480533be0f10735cded"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"2eee3b82b9c8be6c6fde679ab558bdf61b3cc6f7","unresolved":false,"context_lines":[{"line_number":8367,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8368,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8369,"context_line":""},{"line_number":8370,"context_line":"    @periodic_task.periodic_task(spacing\u003d300)"},{"line_number":8371,"context_line":"    def _cleanup_running_orphan_instances(self, context):"},{"line_number":8372,"context_line":"        \"\"\"Cleanup orphan instances."},{"line_number":8373,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bfdaf3ff_e4b84677","line":8370,"range":{"start_line":8370,"start_character":41,"end_line":8370,"end_character":44},"in_reply_to":"bfdaf3ff_f7549223","updated":"2019-01-16 06:40:32.000000000","message":"thanks Jim. I\u0027m will come back here address these. the \u0027numa\u0027 \u0027server_group\u0027 API code update is the priority now.","commit_id":"408155ff573c09aea32a5480533be0f10735cded"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f1221cbeb3335ac20214f97ea43ae7d1494d38b1","unresolved":false,"context_lines":[{"line_number":1205,"context_line":""},{"line_number":1206,"context_line":"        try:"},{"line_number":1207,"context_line":"            # Destroy any running domains not in the DB"},{"line_number":1208,"context_line":"            self._destroy_orphan_instances(context)"},{"line_number":1209,"context_line":"            # checking that instance was not already evacuated to other host"},{"line_number":1210,"context_line":"            evacuated_instances \u003d self._destroy_evacuated_instances(context)"},{"line_number":1211,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_3c992fc3","line":1208,"range":{"start_line":1208,"start_character":11,"end_line":1208,"end_character":51},"updated":"2019-01-30 06:36:48.000000000","message":"will this has conflict/duplicate logic to line 1210?","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"7b75f3635b30108d3ea160960fcc57cd4289b229","unresolved":false,"context_lines":[{"line_number":1205,"context_line":""},{"line_number":1206,"context_line":"        try:"},{"line_number":1207,"context_line":"            # Destroy any running domains not in the DB"},{"line_number":1208,"context_line":"            self._destroy_orphan_instances(context)"},{"line_number":1209,"context_line":"            # checking that instance was not already evacuated to other host"},{"line_number":1210,"context_line":"            evacuated_instances \u003d self._destroy_evacuated_instances(context)"},{"line_number":1211,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_554c1241","line":1208,"range":{"start_line":1208,"start_character":11,"end_line":1208,"end_character":51},"in_reply_to":"9fdfeff1_3c992fc3","updated":"2019-03-14 08:35:10.000000000","message":"The unit test reveals some conflict. I\u0027m digging that.","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f1221cbeb3335ac20214f97ea43ae7d1494d38b1","unresolved":false,"context_lines":[{"line_number":8284,"context_line":"                LOG.warning(\u0027Detected orphan instance %s on hypervisor \u0027"},{"line_number":8285,"context_line":"                            \u0027but not in nova database; deleting this domain.\u0027,"},{"line_number":8286,"context_line":"                             inst_name)"},{"line_number":8287,"context_line":"                self.driver.destroy_name(inst_name)"},{"line_number":8288,"context_line":"            except Exception as ex:"},{"line_number":8289,"context_line":"                LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"},{"line_number":8290,"context_line":"                                \u0027%(details)s\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_bc851f5c","line":8287,"range":{"start_line":8287,"start_character":29,"end_line":8287,"end_character":40},"updated":"2019-01-30 06:36:48.000000000","message":"this name is confusing..\n\nmaybe destory_instance_by_name? or somethingt else...","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"7b75f3635b30108d3ea160960fcc57cd4289b229","unresolved":false,"context_lines":[{"line_number":8284,"context_line":"                LOG.warning(\u0027Detected orphan instance %s on hypervisor \u0027"},{"line_number":8285,"context_line":"                            \u0027but not in nova database; deleting this domain.\u0027,"},{"line_number":8286,"context_line":"                             inst_name)"},{"line_number":8287,"context_line":"                self.driver.destroy_name(inst_name)"},{"line_number":8288,"context_line":"            except Exception as ex:"},{"line_number":8289,"context_line":"                LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"},{"line_number":8290,"context_line":"                                \u0027%(details)s\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_f5665ec1","line":8287,"range":{"start_line":8287,"start_character":29,"end_line":8287,"end_character":40},"in_reply_to":"9fdfeff1_bc851f5c","updated":"2019-03-14 08:35:10.000000000","message":"Done","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"f1221cbeb3335ac20214f97ea43ae7d1494d38b1","unresolved":false,"context_lines":[{"line_number":8367,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8368,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8369,"context_line":""},{"line_number":8370,"context_line":"    @periodic_task.periodic_task(spacing\u003d300)"},{"line_number":8371,"context_line":"    def _cleanup_running_orphan_instances(self, context):"},{"line_number":8372,"context_line":"        \"\"\"Cleanup orphan instances."},{"line_number":8373,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_7ca257fe","line":8370,"range":{"start_line":8370,"start_character":44,"end_line":8370,"end_character":45},"updated":"2019-01-30 06:36:48.000000000","message":"looks like we can make it configurable?","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"7b75f3635b30108d3ea160960fcc57cd4289b229","unresolved":false,"context_lines":[{"line_number":8367,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8368,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8369,"context_line":""},{"line_number":8370,"context_line":"    @periodic_task.periodic_task(spacing\u003d300)"},{"line_number":8371,"context_line":"    def _cleanup_running_orphan_instances(self, context):"},{"line_number":8372,"context_line":"        \"\"\"Cleanup orphan instances."},{"line_number":8373,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_d561e2aa","line":8370,"range":{"start_line":8370,"start_character":44,"end_line":8370,"end_character":45},"in_reply_to":"9fdfeff1_7ca257fe","updated":"2019-03-14 08:35:10.000000000","message":"Gonna add it, thanks. While getting it done, ping you.","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"e51c5ecc867d4bbdb29aba49288b905be4c6fb1c","unresolved":false,"context_lines":[{"line_number":8625,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8626,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8627,"context_line":""},{"line_number":8628,"context_line":"    @periodic_task.periodic_task(spacing\u003d300)"},{"line_number":8629,"context_line":"    def _cleanup_running_orphan_instances(self, context):"},{"line_number":8630,"context_line":"        \"\"\"Cleanup orphan instances."},{"line_number":8631,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_8c925156","line":8628,"range":{"start_line":8628,"start_character":2,"end_line":8628,"end_character":45},"updated":"2019-03-15 14:43:59.000000000","message":"This was one of my early comments: please add configurable parameter for orphan cleanup interval, with default 300 seconds. Then this could be treated as a switch that can be disabled, though I hope no one would do that.","commit_id":"50d9659651e06f4770ffecb173c045f9d4aa708f"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"12c1cb399bdb8fd25a102f4343a1eba96bf19081","unresolved":false,"context_lines":[{"line_number":8625,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8626,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8627,"context_line":""},{"line_number":8628,"context_line":"    @periodic_task.periodic_task(spacing\u003d300)"},{"line_number":8629,"context_line":"    def _cleanup_running_orphan_instances(self, context):"},{"line_number":8630,"context_line":"        \"\"\"Cleanup orphan instances."},{"line_number":8631,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5fc1f717_05286194","line":8628,"range":{"start_line":8628,"start_character":2,"end_line":8628,"end_character":45},"in_reply_to":"5fc1f717_8c925156","updated":"2019-03-18 07:51:44.000000000","message":"Base on similarity with running_delete, propose to use the same interval config. refer to the code.","commit_id":"50d9659651e06f4770ffecb173c045f9d4aa708f"},{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"1edee150363a23927a14e80eaba998e79632795e","unresolved":false,"context_lines":[{"line_number":8588,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8589,"context_line":"                    LOG.warning(\u0027Detected orphan instance %s on hypervisor \u0027"},{"line_number":8590,"context_line":"                                \u0027but not in nova database;\u0027"},{"line_number":8591,"context_line":"                                \u0027 deleting this domain.\u0027,"},{"line_number":8592,"context_line":"                                inst_name)"},{"line_number":8593,"context_line":"                elif action \u003d\u003d \"reap\":"},{"line_number":8594,"context_line":"                    LOG.warning(\u0027Deleted orphan instance %s on hypervisor \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_605faf72","line":8591,"range":{"start_line":8591,"start_character":0,"end_line":8591,"end_character":57},"updated":"2019-03-19 14:58:41.000000000","message":"the \u0027log\u0027 action doesn\u0027t actually delete the domain; perhaps delete these 3 words","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"e698a128c0a46e92e0a7ff5a8977e4a2ca603ef5","unresolved":false,"context_lines":[{"line_number":8588,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8589,"context_line":"                    LOG.warning(\u0027Detected orphan instance %s on hypervisor \u0027"},{"line_number":8590,"context_line":"                                \u0027but not in nova database;\u0027"},{"line_number":8591,"context_line":"                                \u0027 deleting this domain.\u0027,"},{"line_number":8592,"context_line":"                                inst_name)"},{"line_number":8593,"context_line":"                elif action \u003d\u003d \"reap\":"},{"line_number":8594,"context_line":"                    LOG.warning(\u0027Deleted orphan instance %s on hypervisor \u0027"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_d8920e4c","line":8591,"range":{"start_line":8591,"start_character":0,"end_line":8591,"end_character":57},"in_reply_to":"5fc1f717_605faf72","updated":"2019-03-20 02:23:33.000000000","message":"Done","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"1edee150363a23927a14e80eaba998e79632795e","unresolved":false,"context_lines":[{"line_number":8638,"context_line":"        for instance in to_kill:"},{"line_number":8639,"context_line":"            try:"},{"line_number":8640,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8641,"context_line":"                    LOG.info(\u0027Founding instance %(inst_name)s as its host (\u0027"},{"line_number":8642,"context_line":"                             \u0027%(instance_host)s) is not equal to our \u0027"},{"line_number":8643,"context_line":"                             \u0027host (%(our_host)s).\u0027,"},{"line_number":8644,"context_line":"                                {\u0027inst_name\u0027: instance.name,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_60ed6f8a","line":8641,"range":{"start_line":8641,"start_character":29,"end_line":8641,"end_character":39},"updated":"2019-03-19 14:58:41.000000000","message":"\u0027founding\u0027 is not a word;  change to \u0027Detected orphan instance\u0027","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"e698a128c0a46e92e0a7ff5a8977e4a2ca603ef5","unresolved":false,"context_lines":[{"line_number":8638,"context_line":"        for instance in to_kill:"},{"line_number":8639,"context_line":"            try:"},{"line_number":8640,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8641,"context_line":"                    LOG.info(\u0027Founding instance %(inst_name)s as its host (\u0027"},{"line_number":8642,"context_line":"                             \u0027%(instance_host)s) is not equal to our \u0027"},{"line_number":8643,"context_line":"                             \u0027host (%(our_host)s).\u0027,"},{"line_number":8644,"context_line":"                                {\u0027inst_name\u0027: instance.name,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_38a1d296","line":8641,"range":{"start_line":8641,"start_character":29,"end_line":8641,"end_character":39},"in_reply_to":"5fc1f717_60ed6f8a","updated":"2019-03-20 02:23:33.000000000","message":"Done","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":532,"context_line":"        # This is a dict, keyed by instance uuid, to a two-item tuple of"},{"line_number":533,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":534,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":535,"context_line":"        self.suspected_uuids \u003d set([])"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","},{"line_number":538,"context_line":"                                             *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_4600ca02","line":535,"range":{"start_line":535,"start_character":13,"end_line":535,"end_character":28},"updated":"2019-03-27 14:24:53.000000000","message":"This is the first thing I see in the code patch and I have no idea what the context on this will be, so we should either rename it to be more specific (suspected_orphan_uuids?) and/or at least have a code comment about what this variable will be used for.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":532,"context_line":"        # This is a dict, keyed by instance uuid, to a two-item tuple of"},{"line_number":533,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":534,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":535,"context_line":"        self.suspected_uuids \u003d set([])"},{"line_number":536,"context_line":""},{"line_number":537,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","},{"line_number":538,"context_line":"                                             *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_5f663fef","line":535,"range":{"start_line":535,"start_character":13,"end_line":535,"end_character":28},"in_reply_to":"5fc1f717_4600ca02","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8510,"context_line":"            objects.ConsoleAuthToken.\\"},{"line_number":8511,"context_line":"                clean_expired_console_auths_for_host(context, self.host)"},{"line_number":8512,"context_line":""},{"line_number":8513,"context_line":"    def _reap_orphan_instances(self, context, instance):"},{"line_number":8514,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8515,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8516,"context_line":"        # because is it trying to access the instance in the"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_09041314","line":8513,"range":{"start_line":8513,"start_character":29,"end_line":8513,"end_character":30},"updated":"2019-03-27 14:24:53.000000000","message":"This method only works on a single instance correct? So drop the plural here.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8510,"context_line":"            objects.ConsoleAuthToken.\\"},{"line_number":8511,"context_line":"                clean_expired_console_auths_for_host(context, self.host)"},{"line_number":8512,"context_line":""},{"line_number":8513,"context_line":"    def _reap_orphan_instances(self, context, instance):"},{"line_number":8514,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8515,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8516,"context_line":"        # because is it trying to access the instance in the"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_3c610106","line":8513,"range":{"start_line":8513,"start_character":29,"end_line":8513,"end_character":30},"in_reply_to":"5fc1f717_09041314","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8513,"context_line":"    def _reap_orphan_instances(self, context, instance):"},{"line_number":8514,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8515,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8516,"context_line":"        # because is it trying to access the instance in the"},{"line_number":8517,"context_line":"        # database.More precisely when it is trying to destroy"},{"line_number":8518,"context_line":"        # the disks."},{"line_number":8519,"context_line":"        instance_not_found \u003d False"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_a9061f1b","line":8516,"range":{"start_line":8516,"start_character":18,"end_line":8516,"end_character":23},"updated":"2019-03-27 14:24:53.000000000","message":"it is","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8513,"context_line":"    def _reap_orphan_instances(self, context, instance):"},{"line_number":8514,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8515,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8516,"context_line":"        # because is it trying to access the instance in the"},{"line_number":8517,"context_line":"        # database.More precisely when it is trying to destroy"},{"line_number":8518,"context_line":"        # the disks."},{"line_number":8519,"context_line":"        instance_not_found \u003d False"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_5c5c0d4a","line":8516,"range":{"start_line":8516,"start_character":18,"end_line":8516,"end_character":23},"in_reply_to":"5fc1f717_a9061f1b","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8514,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8515,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8516,"context_line":"        # because is it trying to access the instance in the"},{"line_number":8517,"context_line":"        # database.More precisely when it is trying to destroy"},{"line_number":8518,"context_line":"        # the disks."},{"line_number":8519,"context_line":"        instance_not_found \u003d False"},{"line_number":8520,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_6914b744","line":8517,"range":{"start_line":8517,"start_character":19,"end_line":8517,"end_character":20},"updated":"2019-03-27 14:24:53.000000000","message":"space","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8514,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8515,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8516,"context_line":"        # because is it trying to access the instance in the"},{"line_number":8517,"context_line":"        # database.More precisely when it is trying to destroy"},{"line_number":8518,"context_line":"        # the disks."},{"line_number":8519,"context_line":"        instance_not_found \u003d False"},{"line_number":8520,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_fc56192a","line":8517,"range":{"start_line":8517,"start_character":19,"end_line":8517,"end_character":20},"in_reply_to":"5fc1f717_6914b744","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8517,"context_line":"        # database.More precisely when it is trying to destroy"},{"line_number":8518,"context_line":"        # the disks."},{"line_number":8519,"context_line":"        instance_not_found \u003d False"},{"line_number":8520,"context_line":"        try:"},{"line_number":8521,"context_line":"            nw_info \u003d self.network_api.get_instance_nw_info(context, instance)"},{"line_number":8522,"context_line":"            bdi \u003d self._get_instance_block_device_info(context, instance)"},{"line_number":8523,"context_line":"            destroy_disks \u003d not (self._is_instance_storage_shared(context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_2948ef59","line":8520,"updated":"2019-03-27 14:24:53.000000000","message":"This try/except block is copied from _destroy_evacuated_instances, I wonder if we could move it to a common helper method somehow, but that\u0027s just a nit at this point - maybe leave a comment at least in case we make a change in either location.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8517,"context_line":"        # database.More precisely when it is trying to destroy"},{"line_number":8518,"context_line":"        # the disks."},{"line_number":8519,"context_line":"        instance_not_found \u003d False"},{"line_number":8520,"context_line":"        try:"},{"line_number":8521,"context_line":"            nw_info \u003d self.network_api.get_instance_nw_info(context, instance)"},{"line_number":8522,"context_line":"            bdi \u003d self._get_instance_block_device_info(context, instance)"},{"line_number":8523,"context_line":"            destroy_disks \u003d not (self._is_instance_storage_shared(context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_7c38e9ec","line":8520,"in_reply_to":"5fc1f717_2948ef59","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8527,"context_line":"            nw_info \u003d network_model.NetworkInfo()"},{"line_number":8528,"context_line":"            bdi \u003d {}"},{"line_number":8529,"context_line":"            LOG.info(\u0027Instance has been marked deleted already, \u0027"},{"line_number":8530,"context_line":"                         \u0027removing it from the hypervisor.\u0027,"},{"line_number":8531,"context_line":"                     instance\u003dinstance)"},{"line_number":8532,"context_line":"            # always destroy disks if the instance was deleted"},{"line_number":8533,"context_line":"            destroy_disks \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_893803d3","line":8530,"range":{"start_line":8530,"start_character":20,"end_line":8530,"end_character":25},"updated":"2019-03-27 14:24:53.000000000","message":"Fix the alignment here.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8527,"context_line":"            nw_info \u003d network_model.NetworkInfo()"},{"line_number":8528,"context_line":"            bdi \u003d {}"},{"line_number":8529,"context_line":"            LOG.info(\u0027Instance has been marked deleted already, \u0027"},{"line_number":8530,"context_line":"                         \u0027removing it from the hypervisor.\u0027,"},{"line_number":8531,"context_line":"                     instance\u003dinstance)"},{"line_number":8532,"context_line":"            # always destroy disks if the instance was deleted"},{"line_number":8533,"context_line":"            destroy_disks \u003d True"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_9c3b55e8","line":8530,"range":{"start_line":8530,"start_character":20,"end_line":8530,"end_character":25},"in_reply_to":"5fc1f717_893803d3","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8543,"context_line":"                    self.driver.cleanup(context, instance,"},{"line_number":8544,"context_line":"                                        nw_info,"},{"line_number":8545,"context_line":"                                        bdi, destroy_disks\u003dFalse)"},{"line_number":8546,"context_line":"                except exception.InstanceNotFound as ex:"},{"line_number":8547,"context_line":"                    # The above call may throw an exception but"},{"line_number":8548,"context_line":"                    # we want to call it anyways since it might"},{"line_number":8549,"context_line":"                    # clean things up a bit."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_495c5b18","line":8546,"updated":"2019-03-27 14:24:53.000000000","message":"Couldn\u0027t you avoid this by using a mutated context with read_deleted\u003dTrue?","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8543,"context_line":"                    self.driver.cleanup(context, instance,"},{"line_number":8544,"context_line":"                                        nw_info,"},{"line_number":8545,"context_line":"                                        bdi, destroy_disks\u003dFalse)"},{"line_number":8546,"context_line":"                except exception.InstanceNotFound as ex:"},{"line_number":8547,"context_line":"                    # The above call may throw an exception but"},{"line_number":8548,"context_line":"                    # we want to call it anyways since it might"},{"line_number":8549,"context_line":"                    # clean things up a bit."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_7f0c5beb","line":8546,"in_reply_to":"5fc1f717_495c5b18","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8554,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8555,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8556,"context_line":""},{"line_number":8557,"context_line":"    def _destroy_orphan_instances(self, context):"},{"line_number":8558,"context_line":"        \"\"\"Helper to destroy orphan instances."},{"line_number":8559,"context_line":""},{"line_number":8560,"context_line":"        Destroys instances that are lingering on hypervisor without"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_49977b46","line":8557,"updated":"2019-03-27 14:24:53.000000000","message":"This method is huge. Could we split it into at least two parts: one that does the orphan destroy/power off and one that deals with \u0027suspect_instances\u0027?","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8554,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8555,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8556,"context_line":""},{"line_number":8557,"context_line":"    def _destroy_orphan_instances(self, context):"},{"line_number":8558,"context_line":"        \"\"\"Helper to destroy orphan instances."},{"line_number":8559,"context_line":""},{"line_number":8560,"context_line":"        Destroys instances that are lingering on hypervisor without"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_ffedabef","line":8557,"in_reply_to":"5fc1f717_49977b46","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8575,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8576,"context_line":"            filters[\u0027uuid\u0027] \u003d driver_uuids"},{"line_number":8577,"context_line":"            with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"},{"line_number":8578,"context_line":"                local_instances \u003d objects.InstanceList.get_by_filters("},{"line_number":8579,"context_line":"                    context, filters, use_slave\u003dTrue)"},{"line_number":8580,"context_line":"            db_names \u003d [instance.name for instance in local_instances]"},{"line_number":8581,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_c95a8bf0","line":8578,"updated":"2019-03-27 14:24:53.000000000","message":"OK I guess you don\u0027t filter on host because the instance could be running on another host but it\u0027s old guest is running here. Might be good to have a comment about that.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8575,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8576,"context_line":"            filters[\u0027uuid\u0027] \u003d driver_uuids"},{"line_number":8577,"context_line":"            with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"},{"line_number":8578,"context_line":"                local_instances \u003d objects.InstanceList.get_by_filters("},{"line_number":8579,"context_line":"                    context, filters, use_slave\u003dTrue)"},{"line_number":8580,"context_line":"            db_names \u003d [instance.name for instance in local_instances]"},{"line_number":8581,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_3f42533f","line":8578,"in_reply_to":"5fc1f717_c95a8bf0","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8579,"context_line":"                    context, filters, use_slave\u003dTrue)"},{"line_number":8580,"context_line":"            db_names \u003d [instance.name for instance in local_instances]"},{"line_number":8581,"context_line":"        except Exception:"},{"line_number":8582,"context_line":"            LOG.error(\u0027List orphan instances fail\u0027, exc_info\u003d1)"},{"line_number":8583,"context_line":"            return"},{"line_number":8584,"context_line":""},{"line_number":8585,"context_line":"        # Instances found on hypervisor but not in database are orphans."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_c9412b0c","line":8582,"range":{"start_line":8582,"start_character":52,"end_line":8582,"end_character":62},"updated":"2019-03-27 14:24:53.000000000","message":"Why not just use LOG.exception if you want a traceback?","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8579,"context_line":"                    context, filters, use_slave\u003dTrue)"},{"line_number":8580,"context_line":"            db_names \u003d [instance.name for instance in local_instances]"},{"line_number":8581,"context_line":"        except Exception:"},{"line_number":8582,"context_line":"            LOG.error(\u0027List orphan instances fail\u0027, exc_info\u003d1)"},{"line_number":8583,"context_line":"            return"},{"line_number":8584,"context_line":""},{"line_number":8585,"context_line":"        # Instances found on hypervisor but not in database are orphans."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_7f1f7b5a","line":8582,"range":{"start_line":8582,"start_character":52,"end_line":8582,"end_character":62},"in_reply_to":"5fc1f717_c9412b0c","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8592,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8593,"context_line":"                            inst_name)"},{"line_number":8594,"context_line":"            elif action \u003d\u003d \"reap\":"},{"line_number":8595,"context_line":"                LOG.warning(\u0027Deleted orphan instance %s on hypervisor \u0027"},{"line_number":8596,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8597,"context_line":"                            inst_name)"},{"line_number":8598,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_09d89350","line":8595,"range":{"start_line":8595,"start_character":29,"end_line":8595,"end_character":36},"updated":"2019-03-27 14:24:53.000000000","message":"Tense is weird here, you\u0027re saying you deleted it before you call driver.destroy_instance_by_name, which might fail. Maybe say \"Attempting to delete orphan...\".","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8592,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8593,"context_line":"                            inst_name)"},{"line_number":8594,"context_line":"            elif action \u003d\u003d \"reap\":"},{"line_number":8595,"context_line":"                LOG.warning(\u0027Deleted orphan instance %s on hypervisor \u0027"},{"line_number":8596,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8597,"context_line":"                            inst_name)"},{"line_number":8598,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_5f0f1f2d","line":8595,"range":{"start_line":8595,"start_character":29,"end_line":8595,"end_character":36},"in_reply_to":"5fc1f717_09d89350","updated":"2019-03-28 08:15:43.000000000","message":"Gonna use \u0027Deleting\u0027","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8597,"context_line":"                            inst_name)"},{"line_number":8598,"context_line":"                try:"},{"line_number":8599,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8600,"context_line":"                except Exception as ex:"},{"line_number":8601,"context_line":"                    LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"},{"line_number":8602,"context_line":"                            \u0027%(details)s\u0027,"},{"line_number":8603,"context_line":"                        {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_c935ab46","line":8600,"updated":"2019-03-27 14:24:53.000000000","message":"Here and below for power_off_by_name, for any virt driver that doesn\u0027t implement these methods you need to handle NotImplementedError and not log a warning and spam the logs, especially because you\u0027re using a shared config option for other periodics that those virt drivers might support.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8597,"context_line":"                            inst_name)"},{"line_number":8598,"context_line":"                try:"},{"line_number":8599,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8600,"context_line":"                except Exception as ex:"},{"line_number":8601,"context_line":"                    LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"},{"line_number":8602,"context_line":"                            \u0027%(details)s\u0027,"},{"line_number":8603,"context_line":"                        {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_9f7027a6","line":8600,"in_reply_to":"5fc1f717_c935ab46","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8599,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8600,"context_line":"                except Exception as ex:"},{"line_number":8601,"context_line":"                    LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"},{"line_number":8602,"context_line":"                            \u0027%(details)s\u0027,"},{"line_number":8603,"context_line":"                        {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"},{"line_number":8604,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8605,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_a9da9f47","line":8602,"updated":"2019-03-27 14:24:53.000000000","message":"nit: alignment","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8599,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8600,"context_line":"                except Exception as ex:"},{"line_number":8601,"context_line":"                    LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"},{"line_number":8602,"context_line":"                            \u0027%(details)s\u0027,"},{"line_number":8603,"context_line":"                        {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"},{"line_number":8604,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8605,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_df030f0c","line":8602,"in_reply_to":"5fc1f717_a9da9f47","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8603,"context_line":"                        {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"},{"line_number":8604,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8605,"context_line":"                try:"},{"line_number":8606,"context_line":"                    LOG.warning(\u0027Power off orphan instance %s on hypervisor \u0027"},{"line_number":8607,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8608,"context_line":"                            inst_name)"},{"line_number":8609,"context_line":"                    # and power it off"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_09c17354","line":8606,"range":{"start_line":8606,"start_character":33,"end_line":8606,"end_character":38},"updated":"2019-03-27 14:24:53.000000000","message":"\"Powering off\" or \"Attempting to power off\".","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8603,"context_line":"                        {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"},{"line_number":8604,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8605,"context_line":"                try:"},{"line_number":8606,"context_line":"                    LOG.warning(\u0027Power off orphan instance %s on hypervisor \u0027"},{"line_number":8607,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8608,"context_line":"                            inst_name)"},{"line_number":8609,"context_line":"                    # and power it off"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_fc04d919","line":8606,"range":{"start_line":8606,"start_character":33,"end_line":8606,"end_character":38},"in_reply_to":"5fc1f717_09c17354","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8604,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8605,"context_line":"                try:"},{"line_number":8606,"context_line":"                    LOG.warning(\u0027Power off orphan instance %s on hypervisor \u0027"},{"line_number":8607,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8608,"context_line":"                            inst_name)"},{"line_number":8609,"context_line":"                    # and power it off"},{"line_number":8610,"context_line":"                    self.driver.power_off_by_name(inst_name)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_29eeafec","line":8607,"updated":"2019-03-27 14:24:53.000000000","message":"alignment","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8604,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8605,"context_line":"                try:"},{"line_number":8606,"context_line":"                    LOG.warning(\u0027Power off orphan instance %s on hypervisor \u0027"},{"line_number":8607,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8608,"context_line":"                            inst_name)"},{"line_number":8609,"context_line":"                    # and power it off"},{"line_number":8610,"context_line":"                    self.driver.power_off_by_name(inst_name)"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_1c00c501","line":8607,"in_reply_to":"5fc1f717_29eeafec","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8612,"context_line":"                    LOG.warning(\u0027Trouble power off orphan %(name)s: \u0027"},{"line_number":8613,"context_line":"                                \u0027%(details)s\u0027,"},{"line_number":8614,"context_line":"                                {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"},{"line_number":8615,"context_line":"            else:"},{"line_number":8616,"context_line":"                raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8617,"context_line":"                                  \" for CONF.running_orphan_\""},{"line_number":8618,"context_line":"                                  \"instance_action\") % action)"},{"line_number":8619,"context_line":""},{"line_number":8620,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8621,"context_line":"        # supposed to be running on this host.  Ignore ones that are"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_29c78f66","line":8618,"range":{"start_line":8615,"start_character":12,"end_line":8618,"end_character":62},"updated":"2019-03-27 14:24:53.000000000","message":"We shouldn\u0027t need this if we use choices kwarg on the config option, the user would get a ValueError for using a value that is not correct.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8612,"context_line":"                    LOG.warning(\u0027Trouble power off orphan %(name)s: \u0027"},{"line_number":8613,"context_line":"                                \u0027%(details)s\u0027,"},{"line_number":8614,"context_line":"                                {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"},{"line_number":8615,"context_line":"            else:"},{"line_number":8616,"context_line":"                raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8617,"context_line":"                                  \" for CONF.running_orphan_\""},{"line_number":8618,"context_line":"                                  \"instance_action\") % action)"},{"line_number":8619,"context_line":""},{"line_number":8620,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8621,"context_line":"        # supposed to be running on this host.  Ignore ones that are"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_3c0fc137","line":8618,"range":{"start_line":8615,"start_character":12,"end_line":8618,"end_character":62},"in_reply_to":"5fc1f717_29c78f66","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8665,"context_line":"                try:"},{"line_number":8666,"context_line":"                    self.driver.power_off(instance)"},{"line_number":8667,"context_line":"                except Exception:"},{"line_number":8668,"context_line":"                    LOG.warning(\"Orphan Cleanup Failed to power off\""},{"line_number":8669,"context_line":"                                \"instance\","},{"line_number":8670,"context_line":"                                instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8671,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_29754f32","line":8668,"range":{"start_line":8668,"start_character":67,"end_line":8668,"end_character":68},"updated":"2019-03-27 14:24:53.000000000","message":"space","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8665,"context_line":"                try:"},{"line_number":8666,"context_line":"                    self.driver.power_off(instance)"},{"line_number":8667,"context_line":"                except Exception:"},{"line_number":8668,"context_line":"                    LOG.warning(\"Orphan Cleanup Failed to power off\""},{"line_number":8669,"context_line":"                                \"instance\","},{"line_number":8670,"context_line":"                                instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8671,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_fc2b7991","line":8668,"range":{"start_line":8668,"start_character":67,"end_line":8668,"end_character":68},"in_reply_to":"5fc1f717_29754f32","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":8668,"context_line":"                    LOG.warning(\"Orphan Cleanup Failed to power off\""},{"line_number":8669,"context_line":"                                \"instance\","},{"line_number":8670,"context_line":"                                instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8671,"context_line":"            else:"},{"line_number":8672,"context_line":"                raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8673,"context_line":"                      \" for CONF.running_orphan_\""},{"line_number":8674,"context_line":"                      \"instance_action\") % action)"},{"line_number":8675,"context_line":""},{"line_number":8676,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"},{"line_number":8677,"context_line":"    def _cleanup_running_orphan_instances(self, context):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_09941336","line":8674,"range":{"start_line":8671,"start_character":12,"end_line":8674,"end_character":50},"updated":"2019-03-27 14:24:53.000000000","message":"Shouldn\u0027t need this.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":8668,"context_line":"                    LOG.warning(\"Orphan Cleanup Failed to power off\""},{"line_number":8669,"context_line":"                                \"instance\","},{"line_number":8670,"context_line":"                                instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8671,"context_line":"            else:"},{"line_number":8672,"context_line":"                raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8673,"context_line":"                      \" for CONF.running_orphan_\""},{"line_number":8674,"context_line":"                      \"instance_action\") % action)"},{"line_number":8675,"context_line":""},{"line_number":8676,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"},{"line_number":8677,"context_line":"    def _cleanup_running_orphan_instances(self, context):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_9c14b54e","line":8674,"range":{"start_line":8671,"start_character":12,"end_line":8674,"end_character":50},"in_reply_to":"5fc1f717_09941336","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"9bd32014662ad19398bedcba16221562ae909056","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        # This is a dict, keyed by instance uuid, to a two-item tuple of"},{"line_number":528,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":529,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":530,"context_line":"        # Logging the suspected instances which is not belong to this host."},{"line_number":531,"context_line":"        self.suspected_uuids \u003d set([])"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_b6027fb3","line":530,"range":{"start_line":530,"start_character":48,"end_line":530,"end_character":54},"updated":"2019-04-25 08:13:38.000000000","message":"does not?","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        # This is a dict, keyed by instance uuid, to a two-item tuple of"},{"line_number":528,"context_line":"        # migration object and Future for the queued live migration."},{"line_number":529,"context_line":"        self._waiting_live_migrations \u003d {}"},{"line_number":530,"context_line":"        # Logging the suspected instances which is not belong to this host."},{"line_number":531,"context_line":"        self.suspected_uuids \u003d set([])"},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"        super(ComputeManager, self).__init__(service_name\u003d\"compute\","}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_aa316b5c","line":530,"range":{"start_line":530,"start_character":48,"end_line":530,"end_character":54},"in_reply_to":"ffb9cba7_b6027fb3","updated":"2019-04-30 05:58:08.000000000","message":"Done","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8536,"context_line":"            context, self.host)"},{"line_number":8537,"context_line":""},{"line_number":8538,"context_line":"    def _reap_suspect_instance(self, context, instance):"},{"line_number":8539,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8540,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8541,"context_line":"        # because it is trying to access the instance in the"},{"line_number":8542,"context_line":"        # database. More precisely when it is trying to destroy"},{"line_number":8543,"context_line":"        # the disks."},{"line_number":8544,"context_line":"        instance_not_found \u003d False"},{"line_number":8545,"context_line":"        try:"},{"line_number":8546,"context_line":"            # This code block is identical with _destroy_evacuated_instances"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_113b3c9c","line":8543,"range":{"start_line":8539,"start_character":0,"end_line":8543,"end_character":20},"updated":"2019-04-26 13:52:35.000000000","message":"I think in the _reap_suspect_instance() case we do have an instance record in the database. So I don\u0027t think this comment is in the correct place.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8536,"context_line":"            context, self.host)"},{"line_number":8537,"context_line":""},{"line_number":8538,"context_line":"    def _reap_suspect_instance(self, context, instance):"},{"line_number":8539,"context_line":"        # Calling self.driver.destroy when the instance is not"},{"line_number":8540,"context_line":"        # found in the database causes self.driver.cleanup to fail"},{"line_number":8541,"context_line":"        # because it is trying to access the instance in the"},{"line_number":8542,"context_line":"        # database. More precisely when it is trying to destroy"},{"line_number":8543,"context_line":"        # the disks."},{"line_number":8544,"context_line":"        instance_not_found \u003d False"},{"line_number":8545,"context_line":"        try:"},{"line_number":8546,"context_line":"            # This code block is identical with _destroy_evacuated_instances"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_5f02f370","line":8543,"range":{"start_line":8539,"start_character":0,"end_line":8543,"end_character":20},"in_reply_to":"ffb9cba7_113b3c9c","updated":"2019-04-30 05:58:08.000000000","message":"Done","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8543,"context_line":"        # the disks."},{"line_number":8544,"context_line":"        instance_not_found \u003d False"},{"line_number":8545,"context_line":"        try:"},{"line_number":8546,"context_line":"            # This code block is identical with _destroy_evacuated_instances"},{"line_number":8547,"context_line":"            nw_info \u003d self.network_api.get_instance_nw_info(context, instance)"},{"line_number":8548,"context_line":"            bdi \u003d self._get_instance_block_device_info(context, instance)"},{"line_number":8549,"context_line":"            destroy_disks \u003d not (self._is_instance_storage_shared(context,"},{"line_number":8550,"context_line":"                                                                  instance))"},{"line_number":8551,"context_line":"        except exception.InstanceNotFound:"},{"line_number":8552,"context_line":"            instance_not_found \u003d True"},{"line_number":8553,"context_line":"            nw_info \u003d network_model.NetworkInfo()"},{"line_number":8554,"context_line":"            bdi \u003d {}"},{"line_number":8555,"context_line":"            LOG.info(\u0027Instance has been marked deleted already, \u0027"},{"line_number":8556,"context_line":"                     \u0027removing it from the hypervisor.\u0027,"},{"line_number":8557,"context_line":"                     instance\u003dinstance)"},{"line_number":8558,"context_line":"            # always destroy disks if the instance was deleted"},{"line_number":8559,"context_line":"            destroy_disks \u003d True"},{"line_number":8560,"context_line":""},{"line_number":8561,"context_line":"        try:"},{"line_number":8562,"context_line":"            self.driver.destroy(context, instance,"},{"line_number":8563,"context_line":"                                nw_info,"},{"line_number":8564,"context_line":"                                bdi, destroy_disks)"},{"line_number":8565,"context_line":"        except Exception as ex:"},{"line_number":8566,"context_line":"            if instance_not_found:"},{"line_number":8567,"context_line":"                with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_d15da4e9","line":8564,"range":{"start_line":8546,"start_character":0,"end_line":8564,"end_character":51},"updated":"2019-04-26 13:52:35.000000000","message":"I think this is the same as in _destroy_evacuated_instances(). If so then please pull out a common function.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8543,"context_line":"        # the disks."},{"line_number":8544,"context_line":"        instance_not_found \u003d False"},{"line_number":8545,"context_line":"        try:"},{"line_number":8546,"context_line":"            # This code block is identical with _destroy_evacuated_instances"},{"line_number":8547,"context_line":"            nw_info \u003d self.network_api.get_instance_nw_info(context, instance)"},{"line_number":8548,"context_line":"            bdi \u003d self._get_instance_block_device_info(context, instance)"},{"line_number":8549,"context_line":"            destroy_disks \u003d not (self._is_instance_storage_shared(context,"},{"line_number":8550,"context_line":"                                                                  instance))"},{"line_number":8551,"context_line":"        except exception.InstanceNotFound:"},{"line_number":8552,"context_line":"            instance_not_found \u003d True"},{"line_number":8553,"context_line":"            nw_info \u003d network_model.NetworkInfo()"},{"line_number":8554,"context_line":"            bdi \u003d {}"},{"line_number":8555,"context_line":"            LOG.info(\u0027Instance has been marked deleted already, \u0027"},{"line_number":8556,"context_line":"                     \u0027removing it from the hypervisor.\u0027,"},{"line_number":8557,"context_line":"                     instance\u003dinstance)"},{"line_number":8558,"context_line":"            # always destroy disks if the instance was deleted"},{"line_number":8559,"context_line":"            destroy_disks \u003d True"},{"line_number":8560,"context_line":""},{"line_number":8561,"context_line":"        try:"},{"line_number":8562,"context_line":"            self.driver.destroy(context, instance,"},{"line_number":8563,"context_line":"                                nw_info,"},{"line_number":8564,"context_line":"                                bdi, destroy_disks)"},{"line_number":8565,"context_line":"        except Exception as ex:"},{"line_number":8566,"context_line":"            if instance_not_found:"},{"line_number":8567,"context_line":"                with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_4a254f5b","line":8564,"range":{"start_line":8546,"start_character":0,"end_line":8564,"end_character":51},"in_reply_to":"ffb9cba7_d15da4e9","updated":"2019-04-30 05:58:08.000000000","message":"Done","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8582,"context_line":"        \"\"\""},{"line_number":8583,"context_line":"        for instance in suspect_instances:"},{"line_number":8584,"context_line":"            if action \u003d\u003d \"log\":"},{"line_number":8585,"context_line":"                LOG.info(\u0027Detected orphan instance %(inst_name)s as its\u0027"},{"line_number":8586,"context_line":"                         \u0027 host (%(instance_host)s) is not equal to our\u0027"},{"line_number":8587,"context_line":"                         \u0027host (%(our_host)s).\u0027,"},{"line_number":8588,"context_line":"                            {\u0027inst_name\u0027: instance.name,"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_51bbf40c","line":8585,"updated":"2019-04-26 13:52:35.000000000","message":"let\u0027s try not to log the same thing to the compute log at every periodic cycle.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8582,"context_line":"        \"\"\""},{"line_number":8583,"context_line":"        for instance in suspect_instances:"},{"line_number":8584,"context_line":"            if action \u003d\u003d \"log\":"},{"line_number":8585,"context_line":"                LOG.info(\u0027Detected orphan instance %(inst_name)s as its\u0027"},{"line_number":8586,"context_line":"                         \u0027 host (%(instance_host)s) is not equal to our\u0027"},{"line_number":8587,"context_line":"                         \u0027host (%(our_host)s).\u0027,"},{"line_number":8588,"context_line":"                            {\u0027inst_name\u0027: instance.name,"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_ca74df38","line":8585,"in_reply_to":"ffb9cba7_51bbf40c","updated":"2019-04-30 05:58:08.000000000","message":"in the next revision.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8619,"context_line":"        \"\"\""},{"line_number":8620,"context_line":"        for inst_name in orphan_instances:"},{"line_number":8621,"context_line":"            if action \u003d\u003d \"log\":"},{"line_number":8622,"context_line":"                LOG.warning(\u0027Detected orphan instance %s on hypervisor \u0027"},{"line_number":8623,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8624,"context_line":"                            inst_name)"},{"line_number":8625,"context_line":"            elif action \u003d\u003d \"reap\":"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_d125a4ac","line":8622,"updated":"2019-04-26 13:52:35.000000000","message":"This will periodically log the same thing to the compute log. I think we should log an information only once.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8619,"context_line":"        \"\"\""},{"line_number":8620,"context_line":"        for inst_name in orphan_instances:"},{"line_number":8621,"context_line":"            if action \u003d\u003d \"log\":"},{"line_number":8622,"context_line":"                LOG.warning(\u0027Detected orphan instance %s on hypervisor \u0027"},{"line_number":8623,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8624,"context_line":"                            inst_name)"},{"line_number":8625,"context_line":"            elif action \u003d\u003d \"reap\":"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_2a933b5d","line":8622,"in_reply_to":"ffb9cba7_d125a4ac","updated":"2019-04-30 05:58:08.000000000","message":"gonna fix this on next revision, thanks.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"9bd32014662ad19398bedcba16221562ae909056","unresolved":false,"context_lines":[{"line_number":8623,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8624,"context_line":"                            inst_name)"},{"line_number":8625,"context_line":"            elif action \u003d\u003d \"reap\":"},{"line_number":8626,"context_line":"                LOG.warning(\u0027Deleting orphan instance %s on hypervisor \u0027"},{"line_number":8627,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8628,"context_line":"                            inst_name)"},{"line_number":8629,"context_line":"                try:"},{"line_number":8630,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8631,"context_line":"                except Exception as ex:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_b6c59f3e","line":8628,"range":{"start_line":8626,"start_character":16,"end_line":8628,"end_character":38},"updated":"2019-04-25 08:13:38.000000000","message":"Hmm, seems should be debug to me","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"539b43d994e550dd46c033426685adc25e9b69a9","unresolved":false,"context_lines":[{"line_number":8623,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8624,"context_line":"                            inst_name)"},{"line_number":8625,"context_line":"            elif action \u003d\u003d \"reap\":"},{"line_number":8626,"context_line":"                LOG.warning(\u0027Deleting orphan instance %s on hypervisor \u0027"},{"line_number":8627,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8628,"context_line":"                            inst_name)"},{"line_number":8629,"context_line":"                try:"},{"line_number":8630,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8631,"context_line":"                except Exception as ex:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_a203120f","line":8628,"range":{"start_line":8626,"start_character":16,"end_line":8628,"end_character":38},"in_reply_to":"ffb9cba7_b6c59f3e","updated":"2019-04-25 15:20:28.000000000","message":"you will never known that you had a problem if you don\u0027t log it; this does not flood so I think it OK as warning","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"9bd32014662ad19398bedcba16221562ae909056","unresolved":false,"context_lines":[{"line_number":8635,"context_line":"                                    {\u0027name\u0027: inst_name, \u0027details\u0027: ex})"},{"line_number":8636,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8637,"context_line":"                try:"},{"line_number":8638,"context_line":"                    LOG.warning(\u0027Powering off orphan instance %s on \u0027"},{"line_number":8639,"context_line":"                                \u0027hypervisor but not in nova database.\u0027,"},{"line_number":8640,"context_line":"                                inst_name)"},{"line_number":8641,"context_line":"                    # and power it off"},{"line_number":8642,"context_line":"                    self.driver.power_off_by_name(inst_name)"},{"line_number":8643,"context_line":"                except Exception as ex:"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_d6c0532d","line":8640,"range":{"start_line":8638,"start_character":20,"end_line":8640,"end_character":42},"updated":"2019-04-25 08:13:38.000000000","message":"ditto","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8638,"context_line":"                    LOG.warning(\u0027Powering off orphan instance %s on \u0027"},{"line_number":8639,"context_line":"                                \u0027hypervisor but not in nova database.\u0027,"},{"line_number":8640,"context_line":"                                inst_name)"},{"line_number":8641,"context_line":"                    # and power it off"},{"line_number":8642,"context_line":"                    self.driver.power_off_by_name(inst_name)"},{"line_number":8643,"context_line":"                except Exception as ex:"},{"line_number":8644,"context_line":"                    if not isinstance(ex, NotImplementedError):"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_f14d4872","line":8641,"range":{"start_line":8641,"start_character":20,"end_line":8641,"end_character":38},"updated":"2019-04-26 13:52:35.000000000","message":"Seems like the first part of the comment is missing","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8663,"context_line":"            return"},{"line_number":8664,"context_line":""},{"line_number":8665,"context_line":"        try:"},{"line_number":8666,"context_line":"            # list instances even not tracked in nova DB"},{"line_number":8667,"context_line":"            driver_instances \u003d self.driver.list_instances()"},{"line_number":8668,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8669,"context_line":"            # Query all instances on this host include ones should"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_8bd61bc3","line":8666,"range":{"start_line":8666,"start_character":29,"end_line":8666,"end_character":33},"updated":"2019-04-26 13:52:35.000000000","message":"s/even//","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8663,"context_line":"            return"},{"line_number":8664,"context_line":""},{"line_number":8665,"context_line":"        try:"},{"line_number":8666,"context_line":"            # list instances even not tracked in nova DB"},{"line_number":8667,"context_line":"            driver_instances \u003d self.driver.list_instances()"},{"line_number":8668,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8669,"context_line":"            # Query all instances on this host include ones should"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_caa93f7c","line":8666,"range":{"start_line":8666,"start_character":29,"end_line":8666,"end_character":33},"in_reply_to":"ffb9cba7_8bd61bc3","updated":"2019-04-30 05:58:08.000000000","message":"Done","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8696,"context_line":"                    continue"},{"line_number":8697,"context_line":"                else:"},{"line_number":8698,"context_line":"                    suspected_instances.append(instance)"},{"line_number":8699,"context_line":"        suspected_instances \u003d set(suspected_instances)"},{"line_number":8700,"context_line":""},{"line_number":8701,"context_line":"        # Look for suspected instances that were also suspect last time"},{"line_number":8702,"context_line":"        # through the audit.  If so we will kill them."}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_31e76043","line":8699,"range":{"start_line":8699,"start_character":7,"end_line":8699,"end_character":54},"updated":"2019-04-26 13:52:35.000000000","message":"define the suspected_instances as a set at L8690 then you don\u0027t have to copy the data here","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8696,"context_line":"                    continue"},{"line_number":8697,"context_line":"                else:"},{"line_number":8698,"context_line":"                    suspected_instances.append(instance)"},{"line_number":8699,"context_line":"        suspected_instances \u003d set(suspected_instances)"},{"line_number":8700,"context_line":""},{"line_number":8701,"context_line":"        # Look for suspected instances that were also suspect last time"},{"line_number":8702,"context_line":"        # through the audit.  If so we will kill them."}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_2aca5b4d","line":8699,"range":{"start_line":8699,"start_character":7,"end_line":8699,"end_character":54},"in_reply_to":"ffb9cba7_31e76043","updated":"2019-04-30 05:58:08.000000000","message":"Done","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8698,"context_line":"                    suspected_instances.append(instance)"},{"line_number":8699,"context_line":"        suspected_instances \u003d set(suspected_instances)"},{"line_number":8700,"context_line":""},{"line_number":8701,"context_line":"        # Look for suspected instances that were also suspect last time"},{"line_number":8702,"context_line":"        # through the audit.  If so we will kill them."},{"line_number":8703,"context_line":"        to_kill \u003d set([instance for instance in suspected_instances"},{"line_number":8704,"context_line":"                       if instance.uuid in self.suspected_uuids])"},{"line_number":8705,"context_line":"        suspected_instances -\u003d to_kill"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_117a5c87","line":8702,"range":{"start_line":8701,"start_character":0,"end_line":8702,"end_character":54},"updated":"2019-04-26 13:52:35.000000000","message":"Why we wait two periodic cycles?","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8698,"context_line":"                    suspected_instances.append(instance)"},{"line_number":8699,"context_line":"        suspected_instances \u003d set(suspected_instances)"},{"line_number":8700,"context_line":""},{"line_number":8701,"context_line":"        # Look for suspected instances that were also suspect last time"},{"line_number":8702,"context_line":"        # through the audit.  If so we will kill them."},{"line_number":8703,"context_line":"        to_kill \u003d set([instance for instance in suspected_instances"},{"line_number":8704,"context_line":"                       if instance.uuid in self.suspected_uuids])"},{"line_number":8705,"context_line":"        suspected_instances -\u003d to_kill"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_cad7ffed","line":8702,"range":{"start_line":8701,"start_character":0,"end_line":8702,"end_character":54},"in_reply_to":"ffb9cba7_117a5c87","updated":"2019-04-30 05:58:08.000000000","message":"leave it open for now. \nthis might have some history here. let check if Jim knows the reason.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8704,"context_line":"                       if instance.uuid in self.suspected_uuids])"},{"line_number":8705,"context_line":"        suspected_instances -\u003d to_kill"},{"line_number":8706,"context_line":"        self.suspected_uuids \u003d set([instance.uuid for instance in"},{"line_number":8707,"context_line":"                                           suspected_instances])"},{"line_number":8708,"context_line":"        self._clean_up_suspect_instances(context, action, to_kill)"},{"line_number":8709,"context_line":""},{"line_number":8710,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_11d6dc50","line":8707,"range":{"start_line":8707,"start_character":36,"end_line":8707,"end_character":43},"updated":"2019-04-26 13:52:35.000000000","message":"the indent feels wrong here.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":8704,"context_line":"                       if instance.uuid in self.suspected_uuids])"},{"line_number":8705,"context_line":"        suspected_instances -\u003d to_kill"},{"line_number":8706,"context_line":"        self.suspected_uuids \u003d set([instance.uuid for instance in"},{"line_number":8707,"context_line":"                                           suspected_instances])"},{"line_number":8708,"context_line":"        self._clean_up_suspect_instances(context, action, to_kill)"},{"line_number":8709,"context_line":""},{"line_number":8710,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_8adee70e","line":8707,"range":{"start_line":8707,"start_character":36,"end_line":8707,"end_character":43},"in_reply_to":"ffb9cba7_11d6dc50","updated":"2019-04-30 05:58:08.000000000","message":"Done","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"70a436ec76503136cca6d94a4a68556986a04ae4","unresolved":false,"context_lines":[{"line_number":8826,"context_line":""},{"line_number":8827,"context_line":"        try:"},{"line_number":8828,"context_line":"            # list instances not tracked in nova DB"},{"line_number":8829,"context_line":"            driver_instances \u003d filter(self.driver.verify_nova_namespace,"},{"line_number":8830,"context_line":"                                      self.driver.list_instances())"},{"line_number":8831,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8832,"context_line":"            # Query all instances on this host include ones should"},{"line_number":8833,"context_line":"            # not running on this host. So can not filter by host."}],"source_content_type":"text/x-python","patch_set":25,"id":"9fb8cfa7_0603580f","line":8830,"range":{"start_line":8829,"start_character":11,"end_line":8830,"end_character":67},"updated":"2019-06-19 11:01:42.000000000","message":"ok so this is filtering base on a new function added to each driver which you added to libvirt here https://review.opendev.org/#/c/648912/11/nova/virt/libvirt/driver.py@9679\n\nhowever the default implementation  means that all out of tree drivers and most in tree drivers will raise an exception so  i think you need to update the previous patch in the series.\n\nhttps://review.opendev.org/#/c/648912/11/nova/virt/driver.py@1864","commit_id":"b77eda2125b1431ffe7aefa2e197ebfda2a6373c"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"804e4861438bd71df1063ee3b48075c8c13c6c41","unresolved":false,"context_lines":[{"line_number":8197,"context_line":"    @periodic_task.periodic_task("},{"line_number":8198,"context_line":"        spacing\u003dCONF.running_deleted_instance_poll_interval,"},{"line_number":8199,"context_line":"        run_immediately\u003dTrue)"},{"line_number":8200,"context_line":"    def _cleanup_running_deleted_instances(self, context):"},{"line_number":8201,"context_line":"        \"\"\"Cleanup any instances which are erroneously still running after"},{"line_number":8202,"context_line":"        having been deleted."},{"line_number":8203,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_661407a1","line":8200,"updated":"2019-06-26 19:51:45.000000000","message":"Based on the discussion from the PTG, we agreed on an approach to add a new \u0027reap-unknown\u0027 enumerated choice to the CONF.running_deleted_instance_action config option and enhance this method to handle cleaning up orphaned instances not found in the database.","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"162691e8f35060837888680ca61a5429d31c359b","unresolved":false,"context_lines":[{"line_number":8197,"context_line":"    @periodic_task.periodic_task("},{"line_number":8198,"context_line":"        spacing\u003dCONF.running_deleted_instance_poll_interval,"},{"line_number":8199,"context_line":"        run_immediately\u003dTrue)"},{"line_number":8200,"context_line":"    def _cleanup_running_deleted_instances(self, context):"},{"line_number":8201,"context_line":"        \"\"\"Cleanup any instances which are erroneously still running after"},{"line_number":8202,"context_line":"        having been deleted."},{"line_number":8203,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"7faddb67_91454d1a","line":8200,"in_reply_to":"9fb8cfa7_661407a1","updated":"2019-07-05 08:57:17.000000000","message":"Done","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"804e4861438bd71df1063ee3b48075c8c13c6c41","unresolved":false,"context_lines":[{"line_number":8226,"context_line":""},{"line_number":8227,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8228,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8229,"context_line":"            for instance in self._running_deleted_instances(context):"},{"line_number":8230,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8231,"context_line":"                    LOG.warning(\"Detected instance with name label \""},{"line_number":8232,"context_line":"                                \"\u0027%s\u0027 which is marked as \""}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_e6da37e7","line":8229,"range":{"start_line":8229,"start_character":33,"end_line":8229,"end_character":59},"updated":"2019-06-26 19:51:45.000000000","message":"This method will return running deleted instances that are found in the database. There is another method, self.driver.list_instance_uuids, which will return the UUIDs for all [libvirt] guests running on the host. If you did something like make a set() out of each list and take the set difference, you could get a list of UUIDs that are running and not found in the database.\n\nThen, if action \u003d\u003d \u0027reap-unknown\u0027, you can destroy the running and not found domains. Else, you log a message about the running and not found domains.","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"162691e8f35060837888680ca61a5429d31c359b","unresolved":false,"context_lines":[{"line_number":8226,"context_line":""},{"line_number":8227,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8228,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8229,"context_line":"            for instance in self._running_deleted_instances(context):"},{"line_number":8230,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8231,"context_line":"                    LOG.warning(\"Detected instance with name label \""},{"line_number":8232,"context_line":"                                \"\u0027%s\u0027 which is marked as \""}],"source_content_type":"text/x-python","patch_set":28,"id":"7faddb67_314a5927","line":8229,"range":{"start_line":8229,"start_character":33,"end_line":8229,"end_character":59},"in_reply_to":"9fb8cfa7_e6da37e7","updated":"2019-07-05 08:57:17.000000000","message":"Done\n\nWe can not simply add reap_unkonw, which overwrite the original reap, poweroff option, so I decide just use reap and poweroff instead.","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"804e4861438bd71df1063ee3b48075c8c13c6c41","unresolved":false,"context_lines":[{"line_number":8272,"context_line":"                    raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8273,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8274,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8275,"context_line":""},{"line_number":8276,"context_line":"    def _running_deleted_instances(self, context):"},{"line_number":8277,"context_line":"        \"\"\"Returns a list of instances nova thinks is deleted,"},{"line_number":8278,"context_line":"        but the hypervisor thinks is still running."}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_e6b1d790","line":8275,"updated":"2019-06-26 19:51:45.000000000","message":"Maybe we could add a new loop here which loops over the \"unknown\" instances (running but not found in database) and if action \u003d\u003d \u0027reap-unknown\u0027, destroy them, similar to what\u0027s shown on L8254 - L8266. Actually, if the instance has been archived/purged from the database, we wouldn\u0027t be able to retrieve BDM records anyway, so we need not do that part.\n\nWe would call self.driver.destroy directly, I think. And I\u0027m thinking instead of adding new methods to the libvirt driver, just construct a shell Instance(uuid\u003d\u003cuuid\u003e, name\u003d\u003cmake up a name\u003e, ...) for anything that is needed internally by destroy(). That way we get all of the usual cleanup activities (such as retry, etc) that are implemented in the existing destroy() method.","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8775,"context_line":"                      \"%(profile)s\", {\u0027port_id\u0027: port_id,"},{"line_number":8776,"context_line":"                                      \u0027profile\u0027: profile})"},{"line_number":8777,"context_line":""},{"line_number":8778,"context_line":"    def _reap_suspect_instance(self, context, instance):"},{"line_number":8779,"context_line":"        # While in case the instance is not found, continue trying"},{"line_number":8780,"context_line":"        # to destroy the disks."},{"line_number":8781,"context_line":""},{"line_number":8782,"context_line":"        instance_not_found \u003d False"},{"line_number":8783,"context_line":"        try:"},{"line_number":8784,"context_line":"            nw_info, bdi \u003d self._destroy_instance(context, instance)"},{"line_number":8785,"context_line":"        except Exception as ex:"},{"line_number":8786,"context_line":"            if instance_not_found:"},{"line_number":8787,"context_line":"                with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"},{"line_number":8788,"context_line":"                    self.driver.cleanup(context, instance,"},{"line_number":8789,"context_line":"                                        nw_info,"},{"line_number":8790,"context_line":"                                        bdi, destroy_disks\u003dFalse)"},{"line_number":8791,"context_line":"            else:"},{"line_number":8792,"context_line":"                LOG.warning(\u0027Trouble destroying illegitimate instance \u0027"},{"line_number":8793,"context_line":"                            \u0027%(inst_name)s: %(details)s.\u0027,"},{"line_number":8794,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8795,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8796,"context_line":""},{"line_number":8797,"context_line":"    def _clean_up_suspect_instances(self, context, action, suspect_instances):"},{"line_number":8798,"context_line":"        \"\"\"Cleanup suspected instances"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_cbc29c53","line":8795,"range":{"start_line":8778,"start_character":2,"end_line":8795,"end_character":44},"updated":"2019-06-26 19:12:08.000000000","message":"proably not need","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8794,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8795,"context_line":"                             \u0027details\u0027: ex})"},{"line_number":8796,"context_line":""},{"line_number":8797,"context_line":"    def _clean_up_suspect_instances(self, context, action, suspect_instances):"},{"line_number":8798,"context_line":"        \"\"\"Cleanup suspected instances"},{"line_number":8799,"context_line":""},{"line_number":8800,"context_line":"        Suspected Instances are ones which is in the nova DB but"},{"line_number":8801,"context_line":"        aren\u0027t supposed to be running on this host."},{"line_number":8802,"context_line":"        \"\"\""},{"line_number":8803,"context_line":"        for instance in suspect_instances:"},{"line_number":8804,"context_line":"            if action \u003d\u003d \"log\":"},{"line_number":8805,"context_line":"                LOG.info(\u0027Detected orphan instance %(inst_name)s as its\u0027"},{"line_number":8806,"context_line":"                         \u0027 host (%(instance_host)s) is not equal to our\u0027"},{"line_number":8807,"context_line":"                         \u0027host (%(our_host)s).\u0027,"},{"line_number":8808,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8809,"context_line":"                             \u0027instance_host\u0027: instance.host,"},{"line_number":8810,"context_line":"                             \u0027our_host\u0027: self.host}, instance\u003dinstance)"},{"line_number":8811,"context_line":"            elif action \u003d\u003d \"reap\":"},{"line_number":8812,"context_line":"                LOG.info(\u0027Deleting instance %(inst_name)s as its host (\u0027"},{"line_number":8813,"context_line":"                         \u0027%(instance_host)s) is not equal to our \u0027"},{"line_number":8814,"context_line":"                         \u0027host (%(our_host)s).\u0027,"},{"line_number":8815,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8816,"context_line":"                             \u0027instance_host\u0027: instance.host,"},{"line_number":8817,"context_line":"                             \u0027our_host\u0027: self.host}, instance\u003dinstance)"},{"line_number":8818,"context_line":"                self._reap_suspect_instance(context, instance)"},{"line_number":8819,"context_line":"            elif action \u003d\u003d \"shutdown\":"},{"line_number":8820,"context_line":"                LOG.info(\u0027Power down instance %(inst_name)s as its host (\u0027"},{"line_number":8821,"context_line":"                         \u0027%(instance_host)s) is not equal to our \u0027"},{"line_number":8822,"context_line":"                         \u0027host (%(our_host)s).\u0027,"},{"line_number":8823,"context_line":"                            {\u0027inst_name\u0027: instance.name,"},{"line_number":8824,"context_line":"                             \u0027instance_host\u0027: instance.host,"},{"line_number":8825,"context_line":"                             \u0027our_host\u0027: self.host}, instance\u003dinstance)"},{"line_number":8826,"context_line":"                try:"},{"line_number":8827,"context_line":"                    self.driver.power_off(instance)"},{"line_number":8828,"context_line":"                except Exception as ex:"},{"line_number":8829,"context_line":"                    LOG.warning(\u0027Trouble power off suspect instance %(name)s: \u0027"},{"line_number":8830,"context_line":"                                    \u0027%(details)s\u0027,"},{"line_number":8831,"context_line":"                                    {\u0027name\u0027: instance.name, \u0027details\u0027: ex})"},{"line_number":8832,"context_line":""},{"line_number":8833,"context_line":"    def _clean_up_orphan_instances(self, action, orphan_instances):"},{"line_number":8834,"context_line":"        \"\"\"Helper to _destroy_orphan_instances."}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_0bcd1484","line":8831,"range":{"start_line":8797,"start_character":3,"end_line":8831,"end_character":75},"updated":"2019-06-26 19:12:08.000000000","message":"i dont think this is needed see comment below","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8847,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8848,"context_line":"                            inst_name)"},{"line_number":8849,"context_line":"                try:"},{"line_number":8850,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8851,"context_line":"                except Exception as ex:"},{"line_number":8852,"context_line":"                    if not isinstance(ex, NotImplementedError):"},{"line_number":8853,"context_line":"                        LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_06ac2beb","line":8850,"range":{"start_line":8850,"start_character":32,"end_line":8850,"end_character":56},"updated":"2019-06-26 19:12:08.000000000","message":"this should use a uuid instead","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"162691e8f35060837888680ca61a5429d31c359b","unresolved":false,"context_lines":[{"line_number":8847,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8848,"context_line":"                            inst_name)"},{"line_number":8849,"context_line":"                try:"},{"line_number":8850,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8851,"context_line":"                except Exception as ex:"},{"line_number":8852,"context_line":"                    if not isinstance(ex, NotImplementedError):"},{"line_number":8853,"context_line":"                        LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"7faddb67_31aed9e7","line":8850,"range":{"start_line":8850,"start_character":32,"end_line":8850,"end_character":56},"in_reply_to":"9fb8cfa7_06ac2beb","updated":"2019-07-05 08:57:17.000000000","message":"Done","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"321556475cf757d352b5f48c003f9e05398a3f87","unresolved":false,"context_lines":[{"line_number":8847,"context_line":"                            \u0027but not in nova database.\u0027,"},{"line_number":8848,"context_line":"                            inst_name)"},{"line_number":8849,"context_line":"                try:"},{"line_number":8850,"context_line":"                    self.driver.destroy_instance_by_name(inst_name)"},{"line_number":8851,"context_line":"                except Exception as ex:"},{"line_number":8852,"context_line":"                    if not isinstance(ex, NotImplementedError):"},{"line_number":8853,"context_line":"                        LOG.warning(\u0027Trouble destroying orphan %(name)s: \u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_06e42b0c","line":8850,"range":{"start_line":8850,"start_character":32,"end_line":8850,"end_character":56},"in_reply_to":"9fb8cfa7_06ac2beb","updated":"2019-06-26 19:21:56.000000000","message":"im kind of concerend that this will end up leak alot of resouces like local disks, volume attachments and  port on the vswitch .","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8858,"context_line":"                    LOG.warning(\u0027Powering off orphan instance %s on \u0027"},{"line_number":8859,"context_line":"                                \u0027hypervisor but not in nova database.\u0027,"},{"line_number":8860,"context_line":"                                inst_name)"},{"line_number":8861,"context_line":"                    self.driver.power_off_by_name(inst_name)"},{"line_number":8862,"context_line":"                except Exception as ex:"},{"line_number":8863,"context_line":"                    if not isinstance(ex, NotImplementedError):"},{"line_number":8864,"context_line":"                        LOG.warning(\u0027Trouble power off orphan %(name)s: \u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_a6b43f37","line":8861,"range":{"start_line":8861,"start_character":32,"end_line":8861,"end_character":49},"updated":"2019-06-26 19:12:08.000000000","message":"this shoudl use a uuid","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"162691e8f35060837888680ca61a5429d31c359b","unresolved":false,"context_lines":[{"line_number":8858,"context_line":"                    LOG.warning(\u0027Powering off orphan instance %s on \u0027"},{"line_number":8859,"context_line":"                                \u0027hypervisor but not in nova database.\u0027,"},{"line_number":8860,"context_line":"                                inst_name)"},{"line_number":8861,"context_line":"                    self.driver.power_off_by_name(inst_name)"},{"line_number":8862,"context_line":"                except Exception as ex:"},{"line_number":8863,"context_line":"                    if not isinstance(ex, NotImplementedError):"},{"line_number":8864,"context_line":"                        LOG.warning(\u0027Trouble power off orphan %(name)s: \u0027"}],"source_content_type":"text/x-python","patch_set":28,"id":"7faddb67_51ab55d5","line":8861,"range":{"start_line":8861,"start_character":32,"end_line":8861,"end_character":49},"in_reply_to":"9fb8cfa7_a6b43f37","updated":"2019-07-05 08:57:17.000000000","message":"Done","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8884,"context_line":"        try:"},{"line_number":8885,"context_line":"            # list instances not tracked in nova DB"},{"line_number":8886,"context_line":"            driver_instances \u003d filter(self.driver.verify_nova_namespace,"},{"line_number":8887,"context_line":"                                      self.driver.list_instances())"},{"line_number":8888,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8889,"context_line":"            # Query all instances on this host include ones should"},{"line_number":8890,"context_line":"            # not running on this host. So can not filter by host."}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_2bc818a6","line":8887,"range":{"start_line":8887,"start_character":50,"end_line":8887,"end_character":64},"updated":"2019-06-26 19:12:08.000000000","message":"we should be using  list_instance_uuids here\n\nthen we dont need all the get by name fucntion you are in the previous pacth right?","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"162691e8f35060837888680ca61a5429d31c359b","unresolved":false,"context_lines":[{"line_number":8884,"context_line":"        try:"},{"line_number":8885,"context_line":"            # list instances not tracked in nova DB"},{"line_number":8886,"context_line":"            driver_instances \u003d filter(self.driver.verify_nova_namespace,"},{"line_number":8887,"context_line":"                                      self.driver.list_instances())"},{"line_number":8888,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8889,"context_line":"            # Query all instances on this host include ones should"},{"line_number":8890,"context_line":"            # not running on this host. So can not filter by host."}],"source_content_type":"text/x-python","patch_set":28,"id":"7faddb67_5194b58b","line":8887,"range":{"start_line":8887,"start_character":50,"end_line":8887,"end_character":64},"in_reply_to":"9fb8cfa7_2bc818a6","updated":"2019-07-05 08:57:17.000000000","message":"Done","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8885,"context_line":"            # list instances not tracked in nova DB"},{"line_number":8886,"context_line":"            driver_instances \u003d filter(self.driver.verify_nova_namespace,"},{"line_number":8887,"context_line":"                                      self.driver.list_instances())"},{"line_number":8888,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8889,"context_line":"            # Query all instances on this host include ones should"},{"line_number":8890,"context_line":"            # not running on this host. So can not filter by host."},{"line_number":8891,"context_line":"            filters[\u0027uuid\u0027] \u003d driver_uuids"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_8b0a64cf","line":8888,"range":{"start_line":8888,"start_character":11,"end_line":8888,"end_character":60},"updated":"2019-06-26 19:12:08.000000000","message":"then we dont need to do this which will iterate over all the domains on the host again.","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"162691e8f35060837888680ca61a5429d31c359b","unresolved":false,"context_lines":[{"line_number":8885,"context_line":"            # list instances not tracked in nova DB"},{"line_number":8886,"context_line":"            driver_instances \u003d filter(self.driver.verify_nova_namespace,"},{"line_number":8887,"context_line":"                                      self.driver.list_instances())"},{"line_number":8888,"context_line":"            driver_uuids \u003d self.driver.list_instance_uuids()"},{"line_number":8889,"context_line":"            # Query all instances on this host include ones should"},{"line_number":8890,"context_line":"            # not running on this host. So can not filter by host."},{"line_number":8891,"context_line":"            filters[\u0027uuid\u0027] \u003d driver_uuids"}],"source_content_type":"text/x-python","patch_set":28,"id":"7faddb67_118e3d78","line":8888,"range":{"start_line":8888,"start_character":11,"end_line":8888,"end_character":60},"in_reply_to":"9fb8cfa7_8b0a64cf","updated":"2019-07-05 08:57:17.000000000","message":"Done","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        orphan_instances \u003d set(driver_instances) - set(db_names)"},{"line_number":8904,"context_line":"        self._clean_up_orphan_instances(action, orphan_instances)"},{"line_number":8905,"context_line":""},{"line_number":8906,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8907,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8908,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8909,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8910,"context_line":"        suspected_instances \u003d set()"},{"line_number":8911,"context_line":"        for instance in local_instances:"},{"line_number":8912,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8913,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8914,"context_line":"                                            task_states.RESIZE_MIGRATING] or"},{"line_number":8915,"context_line":"                        instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8916,"context_line":"                    continue"},{"line_number":8917,"context_line":"                else:"},{"line_number":8918,"context_line":"                    suspected_instances.add(instance)"},{"line_number":8919,"context_line":""},{"line_number":8920,"context_line":"        # Look for suspected instances that were also suspect last time"},{"line_number":8921,"context_line":"        # through the audit.  If so we will kill them."},{"line_number":8922,"context_line":"        to_kill \u003d set([instance for instance in suspected_instances"},{"line_number":8923,"context_line":"                       if instance.uuid in self.suspected_uuids])"},{"line_number":8924,"context_line":"        suspected_instances -\u003d to_kill"},{"line_number":8925,"context_line":"        self.suspected_uuids \u003d set([instance.uuid for instance in"},{"line_number":8926,"context_line":"                                    suspected_instances])"},{"line_number":8927,"context_line":"        self._clean_up_suspect_instances(context, action, to_kill)"},{"line_number":8928,"context_line":""},{"line_number":8929,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"},{"line_number":8930,"context_line":"    def _cleanup_running_orphan_instances(self, context):"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_2b56d8cf","line":8927,"range":{"start_line":8905,"start_character":0,"end_line":8927,"end_character":66},"updated":"2019-06-26 19:12:08.000000000","message":"i think should already be covered by \n\n_cleanup_running_deleted_instances\n\nhttps://github.com/openstack/nova/blob/50e491c1058913b70e257bec30cc483b7d07d6e1/nova/compute/manager.py#L8188-L8275","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"162691e8f35060837888680ca61a5429d31c359b","unresolved":false,"context_lines":[{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        orphan_instances \u003d set(driver_instances) - set(db_names)"},{"line_number":8904,"context_line":"        self._clean_up_orphan_instances(action, orphan_instances)"},{"line_number":8905,"context_line":""},{"line_number":8906,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8907,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8908,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8909,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8910,"context_line":"        suspected_instances \u003d set()"},{"line_number":8911,"context_line":"        for instance in local_instances:"},{"line_number":8912,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8913,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8914,"context_line":"                                            task_states.RESIZE_MIGRATING] or"},{"line_number":8915,"context_line":"                        instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8916,"context_line":"                    continue"},{"line_number":8917,"context_line":"                else:"},{"line_number":8918,"context_line":"                    suspected_instances.add(instance)"},{"line_number":8919,"context_line":""},{"line_number":8920,"context_line":"        # Look for suspected instances that were also suspect last time"},{"line_number":8921,"context_line":"        # through the audit.  If so we will kill them."},{"line_number":8922,"context_line":"        to_kill \u003d set([instance for instance in suspected_instances"},{"line_number":8923,"context_line":"                       if instance.uuid in self.suspected_uuids])"},{"line_number":8924,"context_line":"        suspected_instances -\u003d to_kill"},{"line_number":8925,"context_line":"        self.suspected_uuids \u003d set([instance.uuid for instance in"},{"line_number":8926,"context_line":"                                    suspected_instances])"},{"line_number":8927,"context_line":"        self._clean_up_suspect_instances(context, action, to_kill)"},{"line_number":8928,"context_line":""},{"line_number":8929,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"},{"line_number":8930,"context_line":"    def _cleanup_running_orphan_instances(self, context):"}],"source_content_type":"text/x-python","patch_set":28,"id":"7faddb67_7140d108","line":8927,"range":{"start_line":8905,"start_character":0,"end_line":8927,"end_character":66},"in_reply_to":"9fb8cfa7_2b56d8cf","updated":"2019-07-05 08:57:17.000000000","message":"Done","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bfc25e9f78dd86f0c2e8783be933e85196ef4c7c","unresolved":false,"context_lines":[{"line_number":8927,"context_line":"        self._clean_up_suspect_instances(context, action, to_kill)"},{"line_number":8928,"context_line":""},{"line_number":8929,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"},{"line_number":8930,"context_line":"    def _cleanup_running_orphan_instances(self, context):"},{"line_number":8931,"context_line":"        \"\"\"Cleanup orphan instances."},{"line_number":8932,"context_line":""},{"line_number":8933,"context_line":"        Periodic task to clean up instances which are erroneously still"}],"source_content_type":"text/x-python","patch_set":28,"id":"9fb8cfa7_cb97fc44","line":8930,"range":{"start_line":8930,"start_character":8,"end_line":8930,"end_character":41},"updated":"2019-06-26 19:12:08.000000000","message":"i think we should be combining this with _cleanup_running_deleted_instances","commit_id":"51629a56f39ce2f3d2f348d2b610405914dca799"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8203,"context_line":"        The use-case for this cleanup task is: for various reasons, it may be"},{"line_number":8204,"context_line":"        possible for the database to show an instance as deleted but for that"},{"line_number":8205,"context_line":"        instance to still be running on a host machine (see bug"},{"line_number":8206,"context_line":"        https://bugs.launchpad.net/nova/+bug/911366). Or a orphan instance"},{"line_number":8207,"context_line":"        which listed in DB but running on a wrong host machine."},{"line_number":8208,"context_line":""},{"line_number":8209,"context_line":"        This cleanup task is a cross-hypervisor utility for finding these"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_ee590c5a","line":8206,"range":{"start_line":8206,"start_character":59,"end_line":8206,"end_character":74},"updated":"2019-07-09 13:37:18.000000000","message":"orphan instnaces are instance that are not listed in teh db because they have been deleted and purged form the db while the compute node was offline ...","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8203,"context_line":"        The use-case for this cleanup task is: for various reasons, it may be"},{"line_number":8204,"context_line":"        possible for the database to show an instance as deleted but for that"},{"line_number":8205,"context_line":"        instance to still be running on a host machine (see bug"},{"line_number":8206,"context_line":"        https://bugs.launchpad.net/nova/+bug/911366). Or a orphan instance"},{"line_number":8207,"context_line":"        which listed in DB but running on a wrong host machine."},{"line_number":8208,"context_line":""},{"line_number":8209,"context_line":"        This cleanup task is a cross-hypervisor utility for finding these"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_06c6c19b","line":8206,"range":{"start_line":8206,"start_character":59,"end_line":8206,"end_character":74},"in_reply_to":"7faddb67_ee590c5a","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8204,"context_line":"        possible for the database to show an instance as deleted but for that"},{"line_number":8205,"context_line":"        instance to still be running on a host machine (see bug"},{"line_number":8206,"context_line":"        https://bugs.launchpad.net/nova/+bug/911366). Or a orphan instance"},{"line_number":8207,"context_line":"        which listed in DB but running on a wrong host machine."},{"line_number":8208,"context_line":""},{"line_number":8209,"context_line":"        This cleanup task is a cross-hypervisor utility for finding these"},{"line_number":8210,"context_line":"        zombied instances and either logging the discrepancy (likely what you"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_0e2a688f","line":8207,"range":{"start_line":8207,"start_character":31,"end_line":8207,"end_character":62},"updated":"2019-07-09 13:37:18.000000000","message":"... so im not sure how they can be running on the wrong host machine.\n\nif they have a db recored they are not an orphan instance.","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8204,"context_line":"        possible for the database to show an instance as deleted but for that"},{"line_number":8205,"context_line":"        instance to still be running on a host machine (see bug"},{"line_number":8206,"context_line":"        https://bugs.launchpad.net/nova/+bug/911366). Or a orphan instance"},{"line_number":8207,"context_line":"        which listed in DB but running on a wrong host machine."},{"line_number":8208,"context_line":""},{"line_number":8209,"context_line":"        This cleanup task is a cross-hypervisor utility for finding these"},{"line_number":8210,"context_line":"        zombied instances and either logging the discrepancy (likely what you"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_e6ba8508","line":8207,"range":{"start_line":8207,"start_character":31,"end_line":8207,"end_character":62},"in_reply_to":"7faddb67_0e2a688f","updated":"2019-07-11 07:20:26.000000000","message":"Done\nWhich migrated to other machines but left the original one not been deleted.","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8217,"context_line":""},{"line_number":8218,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8219,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8220,"context_line":"            insts_nodb, insts_orp \u003d self._running_orphan_instances(context)"},{"line_number":8221,"context_line":"            deleted_insts \u003d self._running_deleted_instances(context)"},{"line_number":8222,"context_line":""},{"line_number":8223,"context_line":"            for instance in deleted_insts + list(insts_orp):"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_49c61a9d","line":8220,"range":{"start_line":8220,"start_character":24,"end_line":8220,"end_character":33},"updated":"2019-07-09 13:37:18.000000000","message":"an this is the moved set\nchange this to moved_instnaces","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8217,"context_line":""},{"line_number":8218,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8219,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8220,"context_line":"            insts_nodb, insts_orp \u003d self._running_orphan_instances(context)"},{"line_number":8221,"context_line":"            deleted_insts \u003d self._running_deleted_instances(context)"},{"line_number":8222,"context_line":""},{"line_number":8223,"context_line":"            for instance in deleted_insts + list(insts_orp):"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_693c36bf","line":8220,"range":{"start_line":8220,"start_character":12,"end_line":8220,"end_character":22},"updated":"2019-07-09 13:37:18.000000000","message":"you reversed the names\nthis is the set of orphaned instances.\n\nchange this to orphaned_insts","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8217,"context_line":""},{"line_number":8218,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8219,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8220,"context_line":"            insts_nodb, insts_orp \u003d self._running_orphan_instances(context)"},{"line_number":8221,"context_line":"            deleted_insts \u003d self._running_deleted_instances(context)"},{"line_number":8222,"context_line":""},{"line_number":8223,"context_line":"            for instance in deleted_insts + list(insts_orp):"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_269e5d54","line":8220,"range":{"start_line":8220,"start_character":24,"end_line":8220,"end_character":33},"in_reply_to":"7faddb67_49c61a9d","updated":"2019-07-11 07:20:26.000000000","message":"I change them to notracked and moved, both of them should be named orphan. such name might better.","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8217,"context_line":""},{"line_number":8218,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8219,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8220,"context_line":"            insts_nodb, insts_orp \u003d self._running_orphan_instances(context)"},{"line_number":8221,"context_line":"            deleted_insts \u003d self._running_deleted_instances(context)"},{"line_number":8222,"context_line":""},{"line_number":8223,"context_line":"            for instance in deleted_insts + list(insts_orp):"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_e64fe531","line":8220,"range":{"start_line":8220,"start_character":12,"end_line":8220,"end_character":22},"in_reply_to":"7faddb67_693c36bf","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8220,"context_line":"            insts_nodb, insts_orp \u003d self._running_orphan_instances(context)"},{"line_number":8221,"context_line":"            deleted_insts \u003d self._running_deleted_instances(context)"},{"line_number":8222,"context_line":""},{"line_number":8223,"context_line":"            for instance in deleted_insts + list(insts_orp):"},{"line_number":8224,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8225,"context_line":"                    LOG.warning(\"Detected instance with name label \""},{"line_number":8226,"context_line":"                                \"\u0027%s\u0027 which is marked as \""}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_e90826da","line":8223,"range":{"start_line":8223,"start_character":49,"end_line":8223,"end_character":58},"updated":"2019-07-09 13:37:18.000000000","message":"moved_instnaces\n\ni would also prefer you apped moved_instnaces\nto deleted_insts above before the for loop","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8220,"context_line":"            insts_nodb, insts_orp \u003d self._running_orphan_instances(context)"},{"line_number":8221,"context_line":"            deleted_insts \u003d self._running_deleted_instances(context)"},{"line_number":8222,"context_line":""},{"line_number":8223,"context_line":"            for instance in deleted_insts + list(insts_orp):"},{"line_number":8224,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8225,"context_line":"                    LOG.warning(\"Detected instance with name label \""},{"line_number":8226,"context_line":"                                \"\u0027%s\u0027 which is marked as \""}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_e6a7e5a6","line":8223,"range":{"start_line":8223,"start_character":49,"end_line":8223,"end_character":58},"in_reply_to":"7faddb67_e90826da","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8227,"context_line":"                                \"DELETED but still present on host.\","},{"line_number":8228,"context_line":"                                instance.name, instance\u003dinstance)"},{"line_number":8229,"context_line":""},{"line_number":8230,"context_line":"                elif action \u003d\u003d \u0027shutdown\u0027:"},{"line_number":8231,"context_line":"                    LOG.info(\"Powering off instance with name label \""},{"line_number":8232,"context_line":"                             \"\u0027%s\u0027 which is marked as \""},{"line_number":8233,"context_line":"                             \"DELETED but still present on host.\","}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_a9ea2ea9","line":8230,"range":{"start_line":8230,"start_character":21,"end_line":8230,"end_character":27},"updated":"2019-07-09 13:37:18.000000000","message":"this will have to be updated to allso work for shutdown_unknown\n\ne.g. if action in (\u0027shutdown\u0027, \u0027shutdown_unknown\u0027):","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8227,"context_line":"                                \"DELETED but still present on host.\","},{"line_number":8228,"context_line":"                                instance.name, instance\u003dinstance)"},{"line_number":8229,"context_line":""},{"line_number":8230,"context_line":"                elif action \u003d\u003d \u0027shutdown\u0027:"},{"line_number":8231,"context_line":"                    LOG.info(\"Powering off instance with name label \""},{"line_number":8232,"context_line":"                             \"\u0027%s\u0027 which is marked as \""},{"line_number":8233,"context_line":"                             \"DELETED but still present on host.\","}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_86b871c8","line":8230,"range":{"start_line":8230,"start_character":21,"end_line":8230,"end_character":27},"in_reply_to":"7faddb67_a9ea2ea9","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8245,"context_line":"                        LOG.warning(\"Failed to power off instance\","},{"line_number":8246,"context_line":"                                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8247,"context_line":""},{"line_number":8248,"context_line":"                elif action \u003d\u003d \u0027reap\u0027:"},{"line_number":8249,"context_line":"                    LOG.info(\"Destroying instance with name label \""},{"line_number":8250,"context_line":"                             \"\u0027%s\u0027 which is marked as \""},{"line_number":8251,"context_line":"                             \"DELETED but still present on host.\","}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_69cc3661","line":8248,"range":{"start_line":8248,"start_character":15,"end_line":8248,"end_character":38},"updated":"2019-07-09 13:37:18.000000000","message":"same as above but for reap_unknown","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8245,"context_line":"                        LOG.warning(\"Failed to power off instance\","},{"line_number":8246,"context_line":"                                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8247,"context_line":""},{"line_number":8248,"context_line":"                elif action \u003d\u003d \u0027reap\u0027:"},{"line_number":8249,"context_line":"                    LOG.info(\"Destroying instance with name label \""},{"line_number":8250,"context_line":"                             \"\u0027%s\u0027 which is marked as \""},{"line_number":8251,"context_line":"                             \"DELETED but still present on host.\","}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_a6bb2dc2","line":8248,"range":{"start_line":8248,"start_character":15,"end_line":8248,"end_character":38},"in_reply_to":"7faddb67_69cc3661","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8267,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8268,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8269,"context_line":""},{"line_number":8270,"context_line":"            for instance in insts_nodb:"},{"line_number":8271,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8272,"context_line":"                    LOG.warning(\"Orphan instance with name label \""},{"line_number":8273,"context_line":"                                \"\u0027%s\u0027 which is not tracked in DB\""}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_69e2f603","line":8270,"range":{"start_line":8270,"start_character":28,"end_line":8270,"end_character":38},"updated":"2019-07-09 13:37:18.000000000","message":"orphaned_insts","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8267,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8268,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8269,"context_line":""},{"line_number":8270,"context_line":"            for instance in insts_nodb:"},{"line_number":8271,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8272,"context_line":"                    LOG.warning(\"Orphan instance with name label \""},{"line_number":8273,"context_line":"                                \"\u0027%s\u0027 which is not tracked in DB\""}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_06cc8168","line":8270,"range":{"start_line":8270,"start_character":28,"end_line":8270,"end_character":38},"in_reply_to":"7faddb67_69e2f603","updated":"2019-07-11 07:20:26.000000000","message":"Done\n\nchanged to \u0027notracked\u0027","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8267,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8268,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8269,"context_line":""},{"line_number":8270,"context_line":"            for instance in insts_nodb:"},{"line_number":8271,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8272,"context_line":"                    LOG.warning(\"Orphan instance with name label \""},{"line_number":8273,"context_line":"                                \"\u0027%s\u0027 which is not tracked in DB\""},{"line_number":8274,"context_line":"                                \"but still present on host.\","},{"line_number":8275,"context_line":"                                instance.name, instance\u003dinstance)"},{"line_number":8276,"context_line":"                elif action \u003d\u003d \u0027shutdown\u0027:"},{"line_number":8277,"context_line":"                    LOG.info(\"Powering off Orphan instance with name label \""},{"line_number":8278,"context_line":"                             \"\u0027%s\u0027 which is not tracked in DB \""},{"line_number":8279,"context_line":"                             \"but still present on host.\","},{"line_number":8280,"context_line":"                             instance.name, instance\u003dinstance)"},{"line_number":8281,"context_line":"                    try:"},{"line_number":8282,"context_line":"                        try:"},{"line_number":8283,"context_line":"                            # disable starting the instance"},{"line_number":8284,"context_line":"                            self.driver.set_bootable(instance, False)"},{"line_number":8285,"context_line":"                        except NotImplementedError:"},{"line_number":8286,"context_line":"                            LOG.debug(\"set_bootable is not implemented \""},{"line_number":8287,"context_line":"                                      \"for the current driver\")"},{"line_number":8288,"context_line":"                        # and power it off"},{"line_number":8289,"context_line":"                        self.driver.power_off(instance)"},{"line_number":8290,"context_line":"                    except Exception:"},{"line_number":8291,"context_line":"                        LOG.warning(\"Failed to power off orphan instance\","},{"line_number":8292,"context_line":"                                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8293,"context_line":"                elif action \u003d\u003d \u0027reap\u0027:"},{"line_number":8294,"context_line":"                    try:"},{"line_number":8295,"context_line":"                        nwinfo \u003d instance.get_network_info()"},{"line_number":8296,"context_line":"                        self.driver.destroy(context, instance, nwinfo)"},{"line_number":8297,"context_line":"                    except Exception as e:"},{"line_number":8298,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8299,"context_line":"                                    \"unkonw orphan instance: %s\","},{"line_number":8300,"context_line":"                                    e, instance\u003dinstance)"},{"line_number":8301,"context_line":""},{"line_number":8302,"context_line":"    def _running_orphan_instances(self, context):"},{"line_number":8303,"context_line":"        insts_wo_db \u003d set()"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_29c15e2f","line":8300,"range":{"start_line":8270,"start_character":9,"end_line":8300,"end_character":57},"updated":"2019-07-09 13:37:18.000000000","message":"we are ment to have reap_unknown and shutdown_unknown\n\nconfig options for orpahn instanceses\nthey should not be reaped with with the standard reap config value.\n\nshutdown is proably ok but we should be safe by defualt and not change the behavior.\n\nlog is safe enough that i dont think it needs a log unknown.","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8267,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8268,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8269,"context_line":""},{"line_number":8270,"context_line":"            for instance in insts_nodb:"},{"line_number":8271,"context_line":"                if action \u003d\u003d \"log\":"},{"line_number":8272,"context_line":"                    LOG.warning(\"Orphan instance with name label \""},{"line_number":8273,"context_line":"                                \"\u0027%s\u0027 which is not tracked in DB\""},{"line_number":8274,"context_line":"                                \"but still present on host.\","},{"line_number":8275,"context_line":"                                instance.name, instance\u003dinstance)"},{"line_number":8276,"context_line":"                elif action \u003d\u003d \u0027shutdown\u0027:"},{"line_number":8277,"context_line":"                    LOG.info(\"Powering off Orphan instance with name label \""},{"line_number":8278,"context_line":"                             \"\u0027%s\u0027 which is not tracked in DB \""},{"line_number":8279,"context_line":"                             \"but still present on host.\","},{"line_number":8280,"context_line":"                             instance.name, instance\u003dinstance)"},{"line_number":8281,"context_line":"                    try:"},{"line_number":8282,"context_line":"                        try:"},{"line_number":8283,"context_line":"                            # disable starting the instance"},{"line_number":8284,"context_line":"                            self.driver.set_bootable(instance, False)"},{"line_number":8285,"context_line":"                        except NotImplementedError:"},{"line_number":8286,"context_line":"                            LOG.debug(\"set_bootable is not implemented \""},{"line_number":8287,"context_line":"                                      \"for the current driver\")"},{"line_number":8288,"context_line":"                        # and power it off"},{"line_number":8289,"context_line":"                        self.driver.power_off(instance)"},{"line_number":8290,"context_line":"                    except Exception:"},{"line_number":8291,"context_line":"                        LOG.warning(\"Failed to power off orphan instance\","},{"line_number":8292,"context_line":"                                    instance\u003dinstance, exc_info\u003dTrue)"},{"line_number":8293,"context_line":"                elif action \u003d\u003d \u0027reap\u0027:"},{"line_number":8294,"context_line":"                    try:"},{"line_number":8295,"context_line":"                        nwinfo \u003d instance.get_network_info()"},{"line_number":8296,"context_line":"                        self.driver.destroy(context, instance, nwinfo)"},{"line_number":8297,"context_line":"                    except Exception as e:"},{"line_number":8298,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8299,"context_line":"                                    \"unkonw orphan instance: %s\","},{"line_number":8300,"context_line":"                                    e, instance\u003dinstance)"},{"line_number":8301,"context_line":""},{"line_number":8302,"context_line":"    def _running_orphan_instances(self, context):"},{"line_number":8303,"context_line":"        insts_wo_db \u003d set()"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_e6c0452d","line":8300,"range":{"start_line":8270,"start_character":9,"end_line":8300,"end_character":57},"in_reply_to":"7faddb67_29c15e2f","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8312,"context_line":"        # use self.driver.destroy()"},{"line_number":8313,"context_line":"        insts_wo_db_uuid \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8314,"context_line":""},{"line_number":8315,"context_line":"        # construction a instance object for destroy no DB entry instances"},{"line_number":8316,"context_line":"        for id in insts_wo_db_uuid:"},{"line_number":8317,"context_line":"            kw \u003d {"},{"line_number":8318,"context_line":"                  \u0027uuid\u0027: id,"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_e9eca62a","line":8315,"range":{"start_line":8315,"start_character":10,"end_line":8315,"end_character":74},"updated":"2019-07-09 13:37:18.000000000","message":"construct instance objects for instance without a db entry","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8312,"context_line":"        # use self.driver.destroy()"},{"line_number":8313,"context_line":"        insts_wo_db_uuid \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8314,"context_line":""},{"line_number":8315,"context_line":"        # construction a instance object for destroy no DB entry instances"},{"line_number":8316,"context_line":"        for id in insts_wo_db_uuid:"},{"line_number":8317,"context_line":"            kw \u003d {"},{"line_number":8318,"context_line":"                  \u0027uuid\u0027: id,"}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_26cc1d60","line":8315,"range":{"start_line":8315,"start_character":10,"end_line":8315,"end_character":74},"in_reply_to":"7faddb67_e9eca62a","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6619df052e57fa5e1a7b22f6b710287aa200e8f8","unresolved":false,"context_lines":[{"line_number":8325,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8326,"context_line":"                insts_wo_db.add(inst)"},{"line_number":8327,"context_line":""},{"line_number":8328,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8329,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8330,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8331,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8332,"context_line":"        for instance in local_instances:"},{"line_number":8333,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8334,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8335,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8336,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8337,"context_line":"                    continue"},{"line_number":8338,"context_line":"                else:"},{"line_number":8339,"context_line":"                    insts_suspect.add(instance)"},{"line_number":8340,"context_line":""},{"line_number":8341,"context_line":"        return insts_wo_db, insts_suspect"},{"line_number":8342,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_099fc25f","line":8339,"range":{"start_line":8328,"start_character":4,"end_line":8339,"end_character":47},"updated":"2019-07-09 13:37:18.000000000","message":"you could also include the delete instnaces in this by \nchekcing if the task state is deleted\nand the instance is old enough and return that as a third argument to avoid needeing to loop over all the instance again by calling _running_deleted_instances","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8325,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8326,"context_line":"                insts_wo_db.add(inst)"},{"line_number":8327,"context_line":""},{"line_number":8328,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8329,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8330,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8331,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8332,"context_line":"        for instance in local_instances:"},{"line_number":8333,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8334,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8335,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8336,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8337,"context_line":"                    continue"},{"line_number":8338,"context_line":"                else:"},{"line_number":8339,"context_line":"                    insts_suspect.add(instance)"},{"line_number":8340,"context_line":""},{"line_number":8341,"context_line":"        return insts_wo_db, insts_suspect"},{"line_number":8342,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"7faddb67_b99272f5","line":8339,"range":{"start_line":8328,"start_character":4,"end_line":8339,"end_character":47},"in_reply_to":"7faddb67_099fc25f","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"688dcae563669bad6f8f3b6def33a8031abff3d0"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"90a60e00494c384cff40bbad2d8d7cd6d083d7ab","unresolved":false,"context_lines":[{"line_number":8223,"context_line":"            insts_set \u003d self._running_deleted_instances(context)"},{"line_number":8224,"context_line":"            deleted_insts, notracked_insts, moved_insts \u003d insts_set"},{"line_number":8225,"context_line":""},{"line_number":8226,"context_line":"            if action in (\u0027log\u0027, \u0027reap_unknown\u0027, \u0027shutdown_unknown\u0027):"},{"line_number":8227,"context_line":"                deleted_insts +\u003d list(moved_insts)"},{"line_number":8228,"context_line":"            if action in (\u0027log\u0027, \u0027shutdown_unknown\u0027):"},{"line_number":8229,"context_line":"                deleted_insts +\u003d list(notracked_insts)"},{"line_number":8230,"context_line":""},{"line_number":8231,"context_line":"            for instance in deleted_insts:"},{"line_number":8232,"context_line":"                if action \u003d\u003d \"log\":"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_88795a94","line":8229,"range":{"start_line":8226,"start_character":10,"end_line":8229,"end_character":54},"updated":"2019-07-10 11:30:23.000000000","message":"im not sure this is correct.\n\nthe reap_unknown and shoutdown_unknown should only affect notracked_insts\n\nmoved_insts are known and have db recored that show they have been moved. \n\ngiven the early return if the action is noop\ni think you always want to append moved_inst to deleted\nand the second if should be\n\nif action in (\u0027log\u0027, \u0027reap_unknown\u0027, \u0027shutdown_unknown\u0027):\n deleted_insts +\u003d list(notracked_insts)\n\ni also dont think you need to convert notracked_insts to a list\n\ndeleted_insts is a set and notracked_insts is a set so you can just union the sets.\n\ne.g.\n\u003e\u003e\u003e {3,4} | {1,2,5}\nset([1, 2, 3, 4, 5])\n\nso that becomes\n\ndeleted_insts |\u003d moved_insts\nif action in (\u0027log\u0027, \u0027reap_unknown\u0027, \u0027shutdown_unknown\u0027):\n deleted_insts |\u003d notracked_insts\n\nthat will be more efficient in terms of both memory and performance","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8223,"context_line":"            insts_set \u003d self._running_deleted_instances(context)"},{"line_number":8224,"context_line":"            deleted_insts, notracked_insts, moved_insts \u003d insts_set"},{"line_number":8225,"context_line":""},{"line_number":8226,"context_line":"            if action in (\u0027log\u0027, \u0027reap_unknown\u0027, \u0027shutdown_unknown\u0027):"},{"line_number":8227,"context_line":"                deleted_insts +\u003d list(moved_insts)"},{"line_number":8228,"context_line":"            if action in (\u0027log\u0027, \u0027shutdown_unknown\u0027):"},{"line_number":8229,"context_line":"                deleted_insts +\u003d list(notracked_insts)"},{"line_number":8230,"context_line":""},{"line_number":8231,"context_line":"            for instance in deleted_insts:"},{"line_number":8232,"context_line":"                if action \u003d\u003d \"log\":"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_86d05821","line":8229,"range":{"start_line":8226,"start_character":10,"end_line":8229,"end_character":54},"in_reply_to":"7faddb67_88795a94","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"90a60e00494c384cff40bbad2d8d7cd6d083d7ab","unresolved":false,"context_lines":[{"line_number":8275,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8276,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8277,"context_line":""},{"line_number":8278,"context_line":"            if action \u003d\u003d \u0027reap_unknown\u0027:"},{"line_number":8279,"context_line":"                for instance in notracked_insts:"},{"line_number":8280,"context_line":"                    try:"},{"line_number":8281,"context_line":"                        nwinfo \u003d instance.get_network_info()"},{"line_number":8282,"context_line":"                        self.driver.destroy(context, instance, nwinfo)"},{"line_number":8283,"context_line":"                    except Exception as e:"},{"line_number":8284,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8285,"context_line":"                                    \"unkonw orphan instance: %s\","},{"line_number":8286,"context_line":"                                    e, instance\u003dinstance)"},{"line_number":8287,"context_line":""},{"line_number":8288,"context_line":"    def _running_deleted_instances(self, context):"},{"line_number":8289,"context_line":"        notracked_insts \u003d set()"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_c88c3281","line":8286,"range":{"start_line":8278,"start_character":11,"end_line":8286,"end_character":57},"updated":"2019-07-10 11:30:23.000000000","message":"rather then having a separate if for this you can handel this case with the reap action above and tehn in the except\nclause on line 8270 check if the instance is in the notracked_inst set to determine if you use the standard or orphan instance message.","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8275,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8276,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8277,"context_line":""},{"line_number":8278,"context_line":"            if action \u003d\u003d \u0027reap_unknown\u0027:"},{"line_number":8279,"context_line":"                for instance in notracked_insts:"},{"line_number":8280,"context_line":"                    try:"},{"line_number":8281,"context_line":"                        nwinfo \u003d instance.get_network_info()"},{"line_number":8282,"context_line":"                        self.driver.destroy(context, instance, nwinfo)"},{"line_number":8283,"context_line":"                    except Exception as e:"},{"line_number":8284,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8285,"context_line":"                                    \"unkonw orphan instance: %s\","},{"line_number":8286,"context_line":"                                    e, instance\u003dinstance)"},{"line_number":8287,"context_line":""},{"line_number":8288,"context_line":"    def _running_deleted_instances(self, context):"},{"line_number":8289,"context_line":"        notracked_insts \u003d set()"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_a6cb1470","line":8286,"range":{"start_line":8278,"start_character":11,"end_line":8286,"end_character":57},"in_reply_to":"7faddb67_c88c3281","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"90a60e00494c384cff40bbad2d8d7cd6d083d7ab","unresolved":false,"context_lines":[{"line_number":8318,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8319,"context_line":"        for instance in local_instances:"},{"line_number":8320,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8321,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8322,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8323,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8324,"context_line":"                    continue"},{"line_number":8325,"context_line":"                else:"},{"line_number":8326,"context_line":"                    moved_insts.add(instance)"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_a83536dc","line":8323,"range":{"start_line":8321,"start_character":16,"end_line":8323,"end_character":78},"updated":"2019-07-10 11:30:23.000000000","message":"do we also need to excplude shelved but not yet shelve offloaded instances here.\n\ni think we should be.","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8318,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8319,"context_line":"        for instance in local_instances:"},{"line_number":8320,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8321,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8322,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8323,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8324,"context_line":"                    continue"},{"line_number":8325,"context_line":"                else:"},{"line_number":8326,"context_line":"                    moved_insts.add(instance)"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_66c51c5b","line":8323,"range":{"start_line":8321,"start_character":16,"end_line":8323,"end_character":78},"in_reply_to":"7faddb67_a83536dc","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"90a60e00494c384cff40bbad2d8d7cd6d083d7ab","unresolved":false,"context_lines":[{"line_number":8330,"context_line":"                timeout \u003d CONF.running_deleted_instance_timeout"},{"line_number":8331,"context_line":"                if (not instance.obj_attr_is_set(\u0027id\u0027) and"},{"line_number":8332,"context_line":"                        self._deleted_old_enough(instance, timeout) and"},{"line_number":8333,"context_line":"                        instance.vm_state not in [vm_states.SOFT_DELETED]):"},{"line_number":8334,"context_line":"                    deleted_insts.add(instance)"},{"line_number":8335,"context_line":""},{"line_number":8336,"context_line":"        return deleted_insts, notracked_insts, moved_insts"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_ed5fc03e","line":8333,"range":{"start_line":8333,"start_character":23,"end_line":8333,"end_character":74},"updated":"2019-07-10 11:30:23.000000000","message":"you need to check that the instanace is deleted here.\n\nlocal_instances is the set of all instance on a host that is in the db so you need to filter this else to only append deleted instances.","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"4ea4c5ef818700c3c6bd2d4c5434019e8059c2a1","unresolved":false,"context_lines":[{"line_number":8330,"context_line":"                timeout \u003d CONF.running_deleted_instance_timeout"},{"line_number":8331,"context_line":"                if (not instance.obj_attr_is_set(\u0027id\u0027) and"},{"line_number":8332,"context_line":"                        self._deleted_old_enough(instance, timeout) and"},{"line_number":8333,"context_line":"                        instance.vm_state not in [vm_states.SOFT_DELETED]):"},{"line_number":8334,"context_line":"                    deleted_insts.add(instance)"},{"line_number":8335,"context_line":""},{"line_number":8336,"context_line":"        return deleted_insts, notracked_insts, moved_insts"}],"source_content_type":"text/x-python","patch_set":32,"id":"7faddb67_46ca606d","line":8333,"range":{"start_line":8333,"start_character":23,"end_line":8333,"end_character":74},"in_reply_to":"7faddb67_ed5fc03e","updated":"2019-07-11 07:20:26.000000000","message":"Done","commit_id":"41897e5031100662d6c477e20d0f5735960bfd90"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bb56d4bdd085dc2298d35a75a62c2b1f01f190e3","unresolved":false,"context_lines":[{"line_number":8423,"context_line":"        moved_insts \u003d set()"},{"line_number":8424,"context_line":"        deleted_insts \u003d set()"},{"line_number":8425,"context_line":""},{"line_number":8426,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8427,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8428,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8429,"context_line":""}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_a4dd3071","line":8426,"range":{"start_line":8426,"start_character":39,"end_line":8426,"end_character":58},"updated":"2019-07-30 23:05:42.000000000","message":"Looking at this in more detail, I realize this method is libvirt-only, so we would need something similar to _get_instances_on_driver\u0027s use of self.driver.list_instances() to be able to get a list of guests for other drivers.\n\nBut, list_instances() returns guest names, so drivers other than libvirt rely on a guest name to destroy an instance. And the \u0027name\u0027 on an objects.Instance is a property that cannot be set.\n\nBased on this, it will *not* be easy to add the ability to clean up orphan instances for any driver other than the libvirt driver. As far as I can tell, it would involve having to expose a new destroy method for drivers that takes only a guest name instead of a objects.Instance. That\u0027s not something we want to do and I don\u0027t have any alternate ideas right now.\n\nSo far, it seems like we would just have to ignore other drivers and leave the current behavior as-is for them (which, I think you are already doing indirectly with the verify_nova_namespace check).","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bb56d4bdd085dc2298d35a75a62c2b1f01f190e3","unresolved":false,"context_lines":[{"line_number":8428,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8429,"context_line":""},{"line_number":8430,"context_line":"        # Instances found on hypervisor but not in database are orphans."},{"line_number":8431,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8432,"context_line":"        # use self.driver.destroy()"},{"line_number":8433,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8434,"context_line":""},{"line_number":8435,"context_line":"        # construct instance objects for instance without a db entry"}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_4219cf77","line":8432,"range":{"start_line":8431,"start_character":8,"end_line":8432,"end_character":35},"updated":"2019-07-30 23:05:42.000000000","message":"This is inaccurate as this change *is* using self.driver.destroy()","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"d67cd75facc2588785e82c6c73030f907af9eb7f","unresolved":false,"context_lines":[{"line_number":8452,"context_line":"        for instance in local_instances:"},{"line_number":8453,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8454,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8455,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8456,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8457,"context_line":"                    continue"},{"line_number":8458,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_2d5718cd","line":8455,"range":{"start_line":8455,"start_character":36,"end_line":8455,"end_character":64},"updated":"2019-08-28 08:06:52.000000000","message":"Why only RESIZE_MIGRATING for resize? Could task_states.resizing_states help you? There are many intermediate migrating states, we should ensure they are all covered here.","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bb56d4bdd085dc2298d35a75a62c2b1f01f190e3","unresolved":false,"context_lines":[{"line_number":8432,"context_line":"        # use self.driver.destroy()"},{"line_number":8433,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8434,"context_line":""},{"line_number":8435,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8436,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8437,"context_line":"            kw \u003d {"},{"line_number":8438,"context_line":"                  \u0027uuid\u0027: uuid,"},{"line_number":8439,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8440,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8441,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8442,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8443,"context_line":"                  }"},{"line_number":8444,"context_line":"            inst \u003d objects.instance.Instance(**kw)"},{"line_number":8445,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8446,"context_line":"                notracked_insts.add(inst)"},{"line_number":8447,"context_line":""},{"line_number":8448,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8449,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8450,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8451,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8452,"context_line":"        for instance in local_instances:"},{"line_number":8453,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8454,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8455,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8456,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8457,"context_line":"                    continue"},{"line_number":8458,"context_line":"                else:"},{"line_number":8459,"context_line":"                    moved_insts.add(instance)"},{"line_number":8460,"context_line":"            else:"},{"line_number":8461,"context_line":"                # instances nova thinks is deleted, but the hypervisor"},{"line_number":8462,"context_line":"                # thinks is still running."}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_a76a1517","line":8459,"range":{"start_line":8435,"start_character":7,"end_line":8459,"end_character":45},"updated":"2019-07-30 23:05:42.000000000","message":"Can you give me an overview why we need to care about whether the guest is moving? I thought this would be much simpler, that we would only have two cases: (1) instances with deleted !\u003d 0 in the database but still running on the hypervisor and (2) instances that do not exist in the database but still running on the hypervisor. Regardless of their task_state. I don\u0027t understand why the task_state is important -- it only matters whether the guests found on the host have database records.","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":23598,"name":"Zhong Luyao","email":"luyao.zhong@intel.com","username":"ZhongLuyao"},"change_message_id":"d67cd75facc2588785e82c6c73030f907af9eb7f","unresolved":false,"context_lines":[{"line_number":8449,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8450,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8451,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8452,"context_line":"        for instance in local_instances:"},{"line_number":8453,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8454,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8455,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8456,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8457,"context_line":"                    continue"},{"line_number":8458,"context_line":"                else:"},{"line_number":8459,"context_line":"                    moved_insts.add(instance)"},{"line_number":8460,"context_line":"            else:"},{"line_number":8461,"context_line":"                # instances nova thinks is deleted, but the hypervisor"},{"line_number":8462,"context_line":"                # thinks is still running."}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_cd13e400","line":8459,"range":{"start_line":8452,"start_character":8,"end_line":8459,"end_character":45},"updated":"2019-08-28 08:06:52.000000000","message":"If an instance is in migrating and it is not deleted, it\u0027s OK to skip it. But if it is in migrating and it is deleted in db, I think it should be taken into consider, maybe we need a new moving_insts?","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"b902d7a7e5ae923ce4b1971fbf14ad09f64dd5eb","unresolved":false,"context_lines":[{"line_number":8432,"context_line":"        # use self.driver.destroy()"},{"line_number":8433,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8434,"context_line":""},{"line_number":8435,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8436,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8437,"context_line":"            kw \u003d {"},{"line_number":8438,"context_line":"                  \u0027uuid\u0027: uuid,"},{"line_number":8439,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8440,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8441,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8442,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8443,"context_line":"                  }"},{"line_number":8444,"context_line":"            inst \u003d objects.instance.Instance(**kw)"},{"line_number":8445,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8446,"context_line":"                notracked_insts.add(inst)"},{"line_number":8447,"context_line":""},{"line_number":8448,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8449,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8450,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8451,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8452,"context_line":"        for instance in local_instances:"},{"line_number":8453,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8454,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8455,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8456,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8457,"context_line":"                    continue"},{"line_number":8458,"context_line":"                else:"},{"line_number":8459,"context_line":"                    moved_insts.add(instance)"},{"line_number":8460,"context_line":"            else:"},{"line_number":8461,"context_line":"                # instances nova thinks is deleted, but the hypervisor"},{"line_number":8462,"context_line":"                # thinks is still running."}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_fb07acc8","line":8459,"range":{"start_line":8435,"start_character":7,"end_line":8459,"end_character":45},"in_reply_to":"7faddb67_a76a1517","updated":"2019-08-09 06:33:45.000000000","message":"Hi, Witt\n\nI might know what you are confused here. \n\nFirst of all, this snippet of code is trying to find the instance which running on this host but DB said it running on another host.  Here is nothing related with the state \"DELETED\", it\u0027s not intended to find a \"Deleted\" instance.\n\nAnd then, if A host is in \u0027moving\u0027 operation,  there is a time window in when it\u0027s  \"db.host\" !\u003d \"this host\", and these instance is nothing wrong. So, to exclude these \u0027moving\u0027 instance, we need checking that state.","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"6a53ea294b0cc4adcf4b96d773880d4329e6705a","unresolved":false,"context_lines":[{"line_number":8432,"context_line":"        # use self.driver.destroy()"},{"line_number":8433,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8434,"context_line":""},{"line_number":8435,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8436,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8437,"context_line":"            kw \u003d {"},{"line_number":8438,"context_line":"                  \u0027uuid\u0027: uuid,"},{"line_number":8439,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8440,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8441,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8442,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8443,"context_line":"                  }"},{"line_number":8444,"context_line":"            inst \u003d objects.instance.Instance(**kw)"},{"line_number":8445,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8446,"context_line":"                notracked_insts.add(inst)"},{"line_number":8447,"context_line":""},{"line_number":8448,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8449,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8450,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8451,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8452,"context_line":"        for instance in local_instances:"},{"line_number":8453,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8454,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8455,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8456,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8457,"context_line":"                    continue"},{"line_number":8458,"context_line":"                else:"},{"line_number":8459,"context_line":"                    moved_insts.add(instance)"},{"line_number":8460,"context_line":"            else:"},{"line_number":8461,"context_line":"                # instances nova thinks is deleted, but the hypervisor"},{"line_number":8462,"context_line":"                # thinks is still running."}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_b0518e10","line":8459,"range":{"start_line":8435,"start_character":7,"end_line":8459,"end_character":45},"in_reply_to":"7faddb67_a76a1517","updated":"2019-08-06 13:32:32.000000000","message":"this \u0027moving\u0027 action is ongoing, means such instances gonna deleted after move finished.\n\nAt this moment, there may have a window for the racing condition: moved instance marked deleted but not deleted yet right now, and we query that from db right that moment. \n\nfix me. @Jim Gauld may have more detail on this.","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"bcbf52c936208b1d38b6734ab0ac5a9d7554c55c","unresolved":false,"context_lines":[{"line_number":8432,"context_line":"        # use self.driver.destroy()"},{"line_number":8433,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8434,"context_line":""},{"line_number":8435,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8436,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8437,"context_line":"            kw \u003d {"},{"line_number":8438,"context_line":"                  \u0027uuid\u0027: uuid,"},{"line_number":8439,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8440,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8441,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8442,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8443,"context_line":"                  }"},{"line_number":8444,"context_line":"            inst \u003d objects.instance.Instance(**kw)"},{"line_number":8445,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8446,"context_line":"                notracked_insts.add(inst)"},{"line_number":8447,"context_line":""},{"line_number":8448,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8449,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8450,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8451,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8452,"context_line":"        for instance in local_instances:"},{"line_number":8453,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8454,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8455,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8456,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8457,"context_line":"                    continue"},{"line_number":8458,"context_line":"                else:"},{"line_number":8459,"context_line":"                    moved_insts.add(instance)"},{"line_number":8460,"context_line":"            else:"},{"line_number":8461,"context_line":"                # instances nova thinks is deleted, but the hypervisor"},{"line_number":8462,"context_line":"                # thinks is still running."}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_d57114aa","line":8459,"range":{"start_line":8435,"start_character":7,"end_line":8459,"end_character":45},"in_reply_to":"7faddb67_fb07acc8","updated":"2019-08-14 07:17:56.000000000","message":"We want to make sure we don\u0027t destroy instances that are in progress of migrating, since that is still valid. We only want the audit to catch lingering instances that nova doesn\u0027t know about anymore.\n\nAs an example, a live-migration will end up with a libvirt domain running on both source and destination until the migration finishes -- we do not want to interfere with this in progress migration.","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8377,"context_line":"        instance to still be running on a host machine (see bug"},{"line_number":8378,"context_line":"        https://bugs.launchpad.net/nova/+bug/911366)."},{"line_number":8379,"context_line":""},{"line_number":8380,"context_line":"        This task also cleans up instance which does not track by DB or"},{"line_number":8381,"context_line":"        instance has migrationed to destination machine but failed to deleted"},{"line_number":8382,"context_line":"        it on source host."},{"line_number":8383,"context_line":""},{"line_number":8384,"context_line":"        This cleanup task is a cross-hypervisor utility for finding these"},{"line_number":8385,"context_line":"        zombied instances and either logging the discrepancy (likely what you"}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_cbd9e9f4","line":8382,"range":{"start_line":8380,"start_character":69,"end_line":8382,"end_character":26},"updated":"2019-09-06 00:08:17.000000000","message":"I think this is out-of-scope of what I thought was the goal of this patch. That should be proposed as a separate patch, IMHO.\n\nThis is a complicated change and at least for me, mixing the two behaviors made it much more difficult to review. I think it would help to separate it to its own bug and patch.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8377,"context_line":"        instance to still be running on a host machine (see bug"},{"line_number":8378,"context_line":"        https://bugs.launchpad.net/nova/+bug/911366)."},{"line_number":8379,"context_line":""},{"line_number":8380,"context_line":"        This task also cleans up instance which does not track by DB or"},{"line_number":8381,"context_line":"        instance has migrationed to destination machine but failed to deleted"},{"line_number":8382,"context_line":"        it on source host."},{"line_number":8383,"context_line":""},{"line_number":8384,"context_line":"        This cleanup task is a cross-hypervisor utility for finding these"},{"line_number":8385,"context_line":"        zombied instances and either logging the discrepancy (likely what you"}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_75b767da","line":8382,"range":{"start_line":8380,"start_character":69,"end_line":8382,"end_character":26},"in_reply_to":"5faad753_cbd9e9f4","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8456,"context_line":"        moved_insts \u003d set()"},{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_e8adcb31","line":8459,"range":{"start_line":8459,"start_character":8,"end_line":8459,"end_character":24},"updated":"2019-09-06 00:08:17.000000000","message":"I think this should be named driver_inst_uuids because it\u0027s a list, to be easier to understand.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8456,"context_line":"        moved_insts \u003d set()"},{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_28bc4368","line":8459,"range":{"start_line":8459,"start_character":39,"end_line":8459,"end_character":58},"updated":"2019-09-06 00:08:17.000000000","message":"Sorry if I wasn\u0027t clear in my comment on PS36, but this will raise NotImplementedError for any driver other than the libvirt driver. So we would need to handle that.\n\nI would suggest try-except and set driver_inst_uuids \u003d [] if NotImplementedError is caught.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"9d98dbb304d5b2988829dac365c5afc1e4668da6","unresolved":false,"context_lines":[{"line_number":8456,"context_line":"        moved_insts \u003d set()"},{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_4bef3987","line":8459,"range":{"start_line":8459,"start_character":39,"end_line":8459,"end_character":58},"in_reply_to":"5faad753_28bc4368","updated":"2019-09-06 00:09:22.000000000","message":"-1 for not handling NotImplementedError here","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8456,"context_line":"        moved_insts \u003d set()"},{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_35ffaf68","line":8459,"range":{"start_line":8459,"start_character":39,"end_line":8459,"end_character":58},"in_reply_to":"5faad753_28bc4368","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8456,"context_line":"        moved_insts \u003d set()"},{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_f5f8377d","line":8459,"range":{"start_line":8459,"start_character":39,"end_line":8459,"end_character":58},"in_reply_to":"5faad753_4bef3987","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8456,"context_line":"        moved_insts \u003d set()"},{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_55eb4baf","line":8459,"range":{"start_line":8459,"start_character":8,"end_line":8459,"end_character":24},"in_reply_to":"5faad753_e8adcb31","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""},{"line_number":8463,"context_line":"        # Instances found on hypervisor but not in database are orphans."}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_8b49b161","line":8460,"range":{"start_line":8460,"start_character":8,"end_line":8460,"end_character":23},"updated":"2019-09-06 00:08:17.000000000","message":"I think this would be better named db_instances to make it more obvious these are instances that are found in the db.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8457,"context_line":"        deleted_insts \u003d set()"},{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""},{"line_number":8463,"context_line":"        # Instances found on hypervisor but not in database are orphans."}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_35348f4a","line":8460,"range":{"start_line":8460,"start_character":8,"end_line":8460,"end_character":23},"in_reply_to":"5faad753_8b49b161","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""},{"line_number":8463,"context_line":"        # Instances found on hypervisor but not in database are orphans."},{"line_number":8464,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_2b5bdd2e","line":8461,"range":{"start_line":8461,"start_character":8,"end_line":8461,"end_character":24},"updated":"2019-09-06 00:08:17.000000000","message":"db_inst_uuids because this is a list","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8458,"context_line":""},{"line_number":8459,"context_line":"        driver_inst_uuid \u003d self.driver.list_instance_uuids()"},{"line_number":8460,"context_line":"        local_instances \u003d self._get_instances_on_driver(context)"},{"line_number":8461,"context_line":"        local_insts_uuid \u003d [i.uuid for i in local_instances]"},{"line_number":8462,"context_line":""},{"line_number":8463,"context_line":"        # Instances found on hypervisor but not in database are orphans."},{"line_number":8464,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_f53d972c","line":8461,"range":{"start_line":8461,"start_character":8,"end_line":8461,"end_character":24},"in_reply_to":"5faad753_2b5bdd2e","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"80a04995b8bdbdc83c469375b53a1012ea27b23d","unresolved":false,"context_lines":[{"line_number":8463,"context_line":"        # Instances found on hypervisor but not in database are orphans."},{"line_number":8464,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8465,"context_line":"        # use self.driver.destroy()"},{"line_number":8466,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8467,"context_line":""},{"line_number":8468,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8469,"context_line":"        for uuid in notracked_insts_uuids:"}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_f9aa7fd0","line":8466,"updated":"2019-09-06 02:15:29.000000000","message":"Note: I am worried about the fact that \"local instances\" are only for self.host from _get_instances_on_driver. A bad case would be if it\u0027s possible for a libvirt guest to be on the host but not yet have its instance.host set to self.host yet. That case would result in the libvirt guest being destroyed when it should not be.\n\nI checked the resize and revert_resize paths and they look safe because instance.host is set to the new host *before* the libvirt guest is spawned. However, on the live migration path I see that the instance.host is set to the new host *after* the libvirt guest has migrated to the destination. That means there\u0027s a window during which there will be a libvirt guest on the destination and no instance record from the database will be returned from _get_instances_on_driver. This will make it look like a non-tracked instance.\n\nI don\u0027t know whether the post_live_migration_at_destination routine can be changed to move the instance.host update before self.driver.post_live_migration_at_destination. Would need to check with mriedem or gibi or another live migration expert.\n\nAnd I don\u0027t know how else to be completely safe about this without querying *all* instances, not only ones for self.host. But I don\u0027t think that\u0027s a good idea as nova-compute should not be looking at instances that do not belong to its self.host.\n\nI\u0027m sorry this review is going on for so long but this is a complicated and dangerous change (when config is set to reap_unknown). If a libvirt guest gets erroneously reaped, I think in the resize case it could be recovered via a hard reboot. What about a live migration?","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8463,"context_line":"        # Instances found on hypervisor but not in database are orphans."},{"line_number":8464,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8465,"context_line":"        # use self.driver.destroy()"},{"line_number":8466,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuid) - set(local_insts_uuid)"},{"line_number":8467,"context_line":""},{"line_number":8468,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8469,"context_line":"        for uuid in notracked_insts_uuids:"}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_5587cbd8","line":8466,"in_reply_to":"5faad753_f9aa7fd0","updated":"2019-09-17 08:07:16.000000000","message":"Not sure how to handle this. -:) Leave it for the next revision.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8470,"context_line":"            kw \u003d {"},{"line_number":8471,"context_line":"                  \u0027uuid\u0027: uuid,"},{"line_number":8472,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8473,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8474,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8475,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8476,"context_line":"                  }"}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_8b1bf171","line":8473,"range":{"start_line":8473,"start_character":32,"end_line":8473,"end_character":49},"updated":"2019-09-06 00:08:17.000000000","message":"I\u0027d rather name this \u0027unknown-project-id\u0027. But do we need it? I didn\u0027t see where \u0027project_id\u0027 is used in the self.driver.destroy path.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8470,"context_line":"            kw \u003d {"},{"line_number":8471,"context_line":"                  \u0027uuid\u0027: uuid,"},{"line_number":8472,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8473,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8474,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8475,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8476,"context_line":"                  }"}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_35aa4f85","line":8473,"range":{"start_line":8473,"start_character":32,"end_line":8473,"end_character":49},"in_reply_to":"5faad753_8b1bf171","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8472,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8473,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8474,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8475,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8476,"context_line":"                  }"},{"line_number":8477,"context_line":"            inst \u003d objects.instance.Instance(**kw)"},{"line_number":8478,"context_line":"            if self.driver.verify_nova_namespace(inst):"}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_2b267db9","line":8475,"updated":"2019-09-06 00:08:17.000000000","message":"This indent is off by one","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8472,"context_line":"                  \u0027host\u0027: \u0027host\u0027,"},{"line_number":8473,"context_line":"                  \u0027project_id\u0027: \u0027fake-project-id\u0027,"},{"line_number":8474,"context_line":"                  \u0027info_cache\u0027: None,"},{"line_number":8475,"context_line":"                   \u0027vm_state\u0027: vm_states.ACTIVE,"},{"line_number":8476,"context_line":"                  }"},{"line_number":8477,"context_line":"            inst \u003d objects.instance.Instance(**kw)"},{"line_number":8478,"context_line":"            if self.driver.verify_nova_namespace(inst):"}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_d59adb6c","line":8475,"in_reply_to":"5faad753_2b267db9","updated":"2019-09-17 08:07:16.000000000","message":"Done","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"cdee5b94fbc20b7c471b63ec446a3bb3d1860d59","unresolved":false,"context_lines":[{"line_number":8478,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8479,"context_line":"                notracked_insts.add(inst)"},{"line_number":8480,"context_line":""},{"line_number":8481,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8482,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8483,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8484,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8485,"context_line":"        for instance in local_instances:"},{"line_number":8486,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8487,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8488,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8489,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8490,"context_line":"                    continue"},{"line_number":8491,"context_line":"                else:"},{"line_number":8492,"context_line":"                    moved_insts.add(instance)"},{"line_number":8493,"context_line":"            else:"},{"line_number":8494,"context_line":"                # instances nova thinks is deleted, but the hypervisor"},{"line_number":8495,"context_line":"                # thinks is still running."},{"line_number":8496,"context_line":"                timeout \u003d CONF.running_deleted_instance_timeout"},{"line_number":8497,"context_line":"                if (instance.vm_state \u003d\u003d vm_states.DELETED and"},{"line_number":8498,"context_line":"                        self._deleted_old_enough(instance, timeout)):"},{"line_number":8499,"context_line":"                    deleted_insts.add(instance)"},{"line_number":8500,"context_line":""},{"line_number":8501,"context_line":"        return deleted_insts, notracked_insts, moved_insts"},{"line_number":8502,"context_line":""},{"line_number":8503,"context_line":"    def _deleted_old_enough(self, instance, timeout):"},{"line_number":8504,"context_line":"        deleted_at \u003d instance.deleted_at"}],"source_content_type":"text/x-python","patch_set":37,"id":"5faad753_0b0dc18f","line":8501,"range":{"start_line":8481,"start_character":8,"end_line":8501,"end_character":58},"updated":"2019-09-06 00:08:17.000000000","message":"Sorry if I\u0027m being dense but I still don\u0027t understand why we need this code. We already identified the set of notracked_insts earlier and we have the list of local_instances (all instances on self.host in the database). Why isn\u0027t the code here simply:\n\n for instance in local_instances:\n     if instance.deleted:\n         deleted_insts.add(instance)\n\n return deleted_insts, notracked_insts\n\nI read your replies on PS36 (thank you) about the migrations but to me it sounds like avoiding reap/shutdown of migrating instances is out of the scope of this bug/patch. The current code today for reaping deleted running instances does not take migrating state into account. If the instance is found running and is also deleted\u003d\u003cid\u003e in the database, it is reaped.\n\nWe could consider changing that behavior, but it would be a larger discussion with the community and is a separate issue from reaping \"unknown\" instances. That is, the aim in this patch should be to add the notracked_insts behavior, not change the existing behavior of reaping the deleted instances.\n\nIf I am wrong and have missed something, please let me know.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"1b3b319f6a99419e1a530bac3b7702f8a6e33028","unresolved":false,"context_lines":[{"line_number":8478,"context_line":"            if self.driver.verify_nova_namespace(inst):"},{"line_number":8479,"context_line":"                notracked_insts.add(inst)"},{"line_number":8480,"context_line":""},{"line_number":8481,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8482,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8483,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8484,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8485,"context_line":"        for instance in local_instances:"},{"line_number":8486,"context_line":"            if instance.host !\u003d self.host:"},{"line_number":8487,"context_line":"                if (instance.task_state in [task_states.MIGRATING,"},{"line_number":8488,"context_line":"                                    task_states.RESIZE_MIGRATING] or"},{"line_number":8489,"context_line":"                                    instance.vm_state in [vm_states.RESIZED]):"},{"line_number":8490,"context_line":"                    continue"},{"line_number":8491,"context_line":"                else:"},{"line_number":8492,"context_line":"                    moved_insts.add(instance)"},{"line_number":8493,"context_line":"            else:"},{"line_number":8494,"context_line":"                # instances nova thinks is deleted, but the hypervisor"},{"line_number":8495,"context_line":"                # thinks is still running."},{"line_number":8496,"context_line":"                timeout \u003d CONF.running_deleted_instance_timeout"},{"line_number":8497,"context_line":"                if (instance.vm_state \u003d\u003d vm_states.DELETED and"},{"line_number":8498,"context_line":"                        self._deleted_old_enough(instance, timeout)):"},{"line_number":8499,"context_line":"                    deleted_insts.add(instance)"},{"line_number":8500,"context_line":""},{"line_number":8501,"context_line":"        return deleted_insts, notracked_insts, moved_insts"},{"line_number":8502,"context_line":""},{"line_number":8503,"context_line":"    def _deleted_old_enough(self, instance, timeout):"},{"line_number":8504,"context_line":"        deleted_at \u003d instance.deleted_at"}],"source_content_type":"text/x-python","patch_set":37,"id":"3fa7e38b_b5ab9f73","line":8501,"range":{"start_line":8481,"start_character":8,"end_line":8501,"end_character":58},"in_reply_to":"5faad753_0b0dc18f","updated":"2019-09-17 08:07:16.000000000","message":"Done. \nThen I better leave the moved instances alone in this fix.","commit_id":"21fc1bf97ece04e3607bec49ec9e199ea983ba1b"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"cc5b5b8c5c1f43ba88a4e64490ccbdfe1f254d68","unresolved":false,"context_lines":[{"line_number":8574,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8575,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8576,"context_line":"            try:"},{"line_number":8577,"context_line":"                insts_set \u003d self._running_deleted_instances(context)"},{"line_number":8578,"context_line":"                deleted_insts, notracked_insts \u003d insts_set"},{"line_number":8579,"context_line":"            except exception.VirtDriverNotReady:"},{"line_number":8580,"context_line":"                # Since this task runs immediately on startup, if the"},{"line_number":8581,"context_line":"                # hypervisor is not yet ready handle it gracefully."}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_e28706d7","line":8578,"range":{"start_line":8577,"start_character":16,"end_line":8578,"end_character":58},"updated":"2019-09-18 10:22:23.000000000","message":"Why not use \"deleted_insts, notracked_insts \u003d self._running_deleted_instances(context)\" ? \u0027insts_set\u0027 is not used in the code below.","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"123552c29bc62b7bc4cffe4e1373930279eba186","unresolved":false,"context_lines":[{"line_number":8574,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8575,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8576,"context_line":"            try:"},{"line_number":8577,"context_line":"                insts_set \u003d self._running_deleted_instances(context)"},{"line_number":8578,"context_line":"                deleted_insts, notracked_insts \u003d insts_set"},{"line_number":8579,"context_line":"            except exception.VirtDriverNotReady:"},{"line_number":8580,"context_line":"                # Since this task runs immediately on startup, if the"},{"line_number":8581,"context_line":"                # hypervisor is not yet ready handle it gracefully."}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_c86fe428","line":8578,"range":{"start_line":8577,"start_character":16,"end_line":8578,"end_character":58},"in_reply_to":"3fa7e38b_e28706d7","updated":"2019-09-27 08:22:52.000000000","message":"Line too long.","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"cc5b5b8c5c1f43ba88a4e64490ccbdfe1f254d68","unresolved":false,"context_lines":[{"line_number":8632,"context_line":"                                              detach\u003dFalse)"},{"line_number":8633,"context_line":"                    except Exception as e:"},{"line_number":8634,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8635,"context_line":"                                        \"instance: %s\","},{"line_number":8636,"context_line":"                                        e, instance\u003dinstance)"},{"line_number":8637,"context_line":"                else:"},{"line_number":8638,"context_line":"                    raise Exception(_(\"Unrecognized value \u0027%s\u0027\""}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_a2858eaf","line":8635,"range":{"start_line":8635,"start_character":36,"end_line":8635,"end_character":40},"updated":"2019-09-18 10:22:23.000000000","message":"Indentation is not standardized.","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"123552c29bc62b7bc4cffe4e1373930279eba186","unresolved":false,"context_lines":[{"line_number":8632,"context_line":"                                              detach\u003dFalse)"},{"line_number":8633,"context_line":"                    except Exception as e:"},{"line_number":8634,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8635,"context_line":"                                        \"instance: %s\","},{"line_number":8636,"context_line":"                                        e, instance\u003dinstance)"},{"line_number":8637,"context_line":"                else:"},{"line_number":8638,"context_line":"                    raise Exception(_(\"Unrecognized value \u0027%s\u0027\""}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_08b17ce1","line":8635,"range":{"start_line":8635,"start_character":36,"end_line":8635,"end_character":40},"in_reply_to":"3fa7e38b_a2858eaf","updated":"2019-09-27 08:22:52.000000000","message":"Done","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"cc5b5b8c5c1f43ba88a4e64490ccbdfe1f254d68","unresolved":false,"context_lines":[{"line_number":8633,"context_line":"                    except Exception as e:"},{"line_number":8634,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8635,"context_line":"                                        \"instance: %s\","},{"line_number":8636,"context_line":"                                        e, instance\u003dinstance)"},{"line_number":8637,"context_line":"                else:"},{"line_number":8638,"context_line":"                    raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8639,"context_line":"                                      \" for CONF.running_deleted_\""}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_628f96cc","line":8636,"range":{"start_line":8636,"start_character":36,"end_line":8636,"end_character":40},"updated":"2019-09-18 10:22:23.000000000","message":"same","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"123552c29bc62b7bc4cffe4e1373930279eba186","unresolved":false,"context_lines":[{"line_number":8633,"context_line":"                    except Exception as e:"},{"line_number":8634,"context_line":"                        LOG.warning(\"Periodic cleanup failed to delete \""},{"line_number":8635,"context_line":"                                        \"instance: %s\","},{"line_number":8636,"context_line":"                                        e, instance\u003dinstance)"},{"line_number":8637,"context_line":"                else:"},{"line_number":8638,"context_line":"                    raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8639,"context_line":"                                      \" for CONF.running_deleted_\""}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_28b478d0","line":8636,"range":{"start_line":8636,"start_character":36,"end_line":8636,"end_character":40},"in_reply_to":"3fa7e38b_628f96cc","updated":"2019-09-27 08:22:52.000000000","message":"Done","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"cc5b5b8c5c1f43ba88a4e64490ccbdfe1f254d68","unresolved":false,"context_lines":[{"line_number":8636,"context_line":"                                        e, instance\u003dinstance)"},{"line_number":8637,"context_line":"                else:"},{"line_number":8638,"context_line":"                    raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8639,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8640,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8641,"context_line":""},{"line_number":8642,"context_line":"    def _running_deleted_instances(self, context):"}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_624c76c7","line":8639,"range":{"start_line":8639,"start_character":65,"end_line":8639,"end_character":66},"updated":"2019-09-18 10:22:23.000000000","message":"space","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"123552c29bc62b7bc4cffe4e1373930279eba186","unresolved":false,"context_lines":[{"line_number":8636,"context_line":"                                        e, instance\u003dinstance)"},{"line_number":8637,"context_line":"                else:"},{"line_number":8638,"context_line":"                    raise Exception(_(\"Unrecognized value \u0027%s\u0027\""},{"line_number":8639,"context_line":"                                      \" for CONF.running_deleted_\""},{"line_number":8640,"context_line":"                                      \"instance_action\") % action)"},{"line_number":8641,"context_line":""},{"line_number":8642,"context_line":"    def _running_deleted_instances(self, context):"}],"source_content_type":"text/x-python","patch_set":39,"id":"3fa7e38b_88f24c99","line":8639,"range":{"start_line":8639,"start_character":65,"end_line":8639,"end_character":66},"in_reply_to":"3fa7e38b_624c76c7","updated":"2019-09-27 08:22:52.000000000","message":"No space, they are one word I suppose.","commit_id":"cfb561a0e1ad41a7ed7a41bc408ef2de52ca3c61"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"06c0d799b6e3512ecb910bd16a1489b3595a6a1a","unresolved":false,"context_lines":[{"line_number":8812,"context_line":"        appropriate for dev environments)."},{"line_number":8813,"context_line":"        \"\"\""},{"line_number":8814,"context_line":"        action \u003d CONF.running_deleted_instance_action"},{"line_number":8815,"context_line":""},{"line_number":8816,"context_line":"        if action \u003d\u003d \"noop\":"},{"line_number":8817,"context_line":"            return"},{"line_number":8818,"context_line":""}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_7fcb1d1c","side":"PARENT","line":8815,"updated":"2019-11-20 16:43:21.000000000","message":"Random whitespace damage.","commit_id":"845bf47546348b9b88d1831b5bba2ab924beae93"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"06c0d799b6e3512ecb910bd16a1489b3595a6a1a","unresolved":false,"context_lines":[{"line_number":8818,"context_line":""},{"line_number":8819,"context_line":"        # NOTE(sirp): admin contexts don\u0027t ordinarily return deleted records"},{"line_number":8820,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\"yes\"):"},{"line_number":8821,"context_line":""},{"line_number":8822,"context_line":"            try:"},{"line_number":8823,"context_line":"                instances \u003d self._running_deleted_instances(context)"},{"line_number":8824,"context_line":"            except exception.VirtDriverNotReady:"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_3fd925f3","side":"PARENT","line":8821,"updated":"2019-11-20 16:43:21.000000000","message":"here too.","commit_id":"845bf47546348b9b88d1831b5bba2ab924beae93"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b269f5945f7c48d0ad0cb004e283c2927229d582","unresolved":false,"context_lines":[{"line_number":641,"context_line":"        driver_instances \u003d self.driver.list_instances()"},{"line_number":642,"context_line":"        # NOTE(mjozefcz): In this case we need to apply host filter."},{"line_number":643,"context_line":"        # Without this all instance data would be fetched from db."},{"line_number":644,"context_line":"        filters[\u0027host\u0027] \u003d self.host"},{"line_number":645,"context_line":"        instances \u003d objects.InstanceList.get_by_filters(context, filters,"},{"line_number":646,"context_line":"                                                        use_slave\u003dTrue)"},{"line_number":647,"context_line":"        name_map \u003d {instance.name: instance for instance in instances}"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_3f2e428c","line":644,"updated":"2019-11-15 05:31:41.000000000","message":"Looks like, all the drivers implement self.driver.list_instance_uuids(), so we nerver reach at here. And the strange thing is the line 632 doens\u0027t filter by host.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2b7ffd6fd61026d8830a1a6928ac3154f6f0d237","unresolved":false,"context_lines":[{"line_number":641,"context_line":"        driver_instances \u003d self.driver.list_instances()"},{"line_number":642,"context_line":"        # NOTE(mjozefcz): In this case we need to apply host filter."},{"line_number":643,"context_line":"        # Without this all instance data would be fetched from db."},{"line_number":644,"context_line":"        filters[\u0027host\u0027] \u003d self.host"},{"line_number":645,"context_line":"        instances \u003d objects.InstanceList.get_by_filters(context, filters,"},{"line_number":646,"context_line":"                                                        use_slave\u003dTrue)"},{"line_number":647,"context_line":"        name_map \u003d {instance.name: instance for instance in instances}"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_a942ceaa","line":644,"in_reply_to":"3fa7e38b_170ea98b","updated":"2019-11-20 02:43:11.000000000","message":"oops, sorry, my stupid, I only check the response of my ide tell me, hyperv, xen, libvirt, vmware, then I think they are all.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ad5d9d550d2b0bbb82e0c49daa6fe65914ba828","unresolved":false,"context_lines":[{"line_number":641,"context_line":"        driver_instances \u003d self.driver.list_instances()"},{"line_number":642,"context_line":"        # NOTE(mjozefcz): In this case we need to apply host filter."},{"line_number":643,"context_line":"        # Without this all instance data would be fetched from db."},{"line_number":644,"context_line":"        filters[\u0027host\u0027] \u003d self.host"},{"line_number":645,"context_line":"        instances \u003d objects.InstanceList.get_by_filters(context, filters,"},{"line_number":646,"context_line":"                                                        use_slave\u003dTrue)"},{"line_number":647,"context_line":"        name_map \u003d {instance.name: instance for instance in instances}"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_a14c373f","line":644,"in_reply_to":"3fa7e38b_3f2e428c","updated":"2019-11-19 00:22:53.000000000","message":"Most of the drivers do, but I just checked again and I\u0027m seeing that powervm and zvm drivers do not implement list_instance_uuids:\n\nhttps://github.com/openstack/nova/blob/master/nova/virt/powervm/driver.py\nhttps://github.com/openstack/nova/blob/master/nova/virt/zvm/driver.py","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"80dc363b633c64ef7de1a3ff9c7753aecd1bead9","unresolved":false,"context_lines":[{"line_number":641,"context_line":"        driver_instances \u003d self.driver.list_instances()"},{"line_number":642,"context_line":"        # NOTE(mjozefcz): In this case we need to apply host filter."},{"line_number":643,"context_line":"        # Without this all instance data would be fetched from db."},{"line_number":644,"context_line":"        filters[\u0027host\u0027] \u003d self.host"},{"line_number":645,"context_line":"        instances \u003d objects.InstanceList.get_by_filters(context, filters,"},{"line_number":646,"context_line":"                                                        use_slave\u003dTrue)"},{"line_number":647,"context_line":"        name_map \u003d {instance.name: instance for instance in instances}"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_170ea98b","line":644,"in_reply_to":"3fa7e38b_97fa99b7","updated":"2019-11-19 06:09:09.000000000","message":"They are not out of tree drivers -- the links I pasted are from our tree.\n\nI think we should filter by host because a compute host should not be accessing instances that are not associated with it. I think that is why it is like that today.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"8f99222c5c0823cb3433ebff148cc8d5539c06b3","unresolved":false,"context_lines":[{"line_number":641,"context_line":"        driver_instances \u003d self.driver.list_instances()"},{"line_number":642,"context_line":"        # NOTE(mjozefcz): In this case we need to apply host filter."},{"line_number":643,"context_line":"        # Without this all instance data would be fetched from db."},{"line_number":644,"context_line":"        filters[\u0027host\u0027] \u003d self.host"},{"line_number":645,"context_line":"        instances \u003d objects.InstanceList.get_by_filters(context, filters,"},{"line_number":646,"context_line":"                                                        use_slave\u003dTrue)"},{"line_number":647,"context_line":"        name_map \u003d {instance.name: instance for instance in instances}"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_97fa99b7","line":644,"in_reply_to":"3fa7e38b_a14c373f","updated":"2019-11-19 05:02:18.000000000","message":"Thanks, I didn\u0027t check the out of tree driver. I guess we should make them to have consistent behaviour. I guess we shouldn\u0027t filter by host, see my below comment reply.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"06c0d799b6e3512ecb910bd16a1489b3595a6a1a","unresolved":false,"context_lines":[{"line_number":8806,"context_line":"        instance to still be running on a host machine (see bug"},{"line_number":8807,"context_line":"        https://bugs.launchpad.net/nova/+bug/911366)."},{"line_number":8808,"context_line":""},{"line_number":8809,"context_line":"        This task also cleans up instance which does not track by DB."},{"line_number":8810,"context_line":""},{"line_number":8811,"context_line":"        This cleanup task is a cross-hypervisor utility for finding these"},{"line_number":8812,"context_line":"        zombied instances and either logging the discrepancy (likely what you"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_ff494db7","line":8809,"updated":"2019-11-20 16:43:21.000000000","message":"This is not proper english and makes it hard to determine what the goal is. I think you mean:\n\n \"This task also cleans up instances which are no longer in the database\"","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"06c0d799b6e3512ecb910bd16a1489b3595a6a1a","unresolved":false,"context_lines":[{"line_number":8900,"context_line":"        # Instances found on hypervisor but not in database are orphans."},{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_dff33172","line":8903,"updated":"2019-11-20 16:43:21.000000000","message":"This is actually not a list of *instances* that are running but not tracked, but instead it\u0027s a list of *vms* that are running but which we don\u0027t know about, right?","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"051658ed72e5fc6da3269bd8a5b7c9ff9e47efff","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_c4717a79","line":8904,"updated":"2019-11-14 00:44:35.000000000","message":"Based on my comments on a previous PS, I think we need one more step in here, to remove migrating instances from notracked_insts_uuids. We want to avoid destroying a guest on the hypervisor that is not an orphan and is in the middle of migrating to/from this host.\n\nThere is already a method for retrieving a list of migrations that involve a specified host and node, as mentioned in the recent ML thread [1]:\n\nhttps://github.com/openstack/nova/blob/1c7a3d59080e5de50615bd2408b10d372ec30861/nova/compute/resource_tracker.py#L935\n\nSo I think what we could do here is get the list of migrations for the host/node and then remove those instance_uuid from notracked_insts_uuids. That way we will not touch any guest that is in the middle of a migration.\n\n[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-November/010800.html","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ad5d9d550d2b0bbb82e0c49daa6fe65914ba828","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_a1b75721","line":8904,"in_reply_to":"3fa7e38b_4c27dec8","updated":"2019-11-19 00:22:53.000000000","message":"Note that self._get_instances_on_driver filters the query on host\u003dself.host to get only records for this compute host for the powervm and zvm drivers (which is appropriate, a compute host should not be querying instances that are not related to it).\n\nBecause the query filters on only host\u003dself.host, it is possible for instances in the middle of migration to be excluded from the query when they are not actually orphans. See my comments on PS37 for more details.\n\nBecause the set of \"virt guests on this host\" - \"db instance records with host\u003dself.host\" might include instances that a mid-migration, I think we need to exclude them and I think excluding all \"in-progress\" for the host is simpler. Once the migrations are completed, the cleanup will take care of it at the next interval.\n\nIn general, and unrelated to the the powervm and zvm driver behavior (gets instances with host\u003dself.host), I think it probably would not be the best idea to destroy virt guests for non-deleted instances that are in the middle of migration anyway because nova-compute migration methods will expect to handle create/destroy of virt guests during migration. If this cleanup routine destroys guests out from underneath the migration methods, errors or other failure may result.\n\nIn this patch, I think we should really stick to only destroying virt guests that are either (1) deleted or (2) tracked anywhere in the database. If a non-deleted instance still has migration records, it is still being tracked in the database as far as I understand.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2b7ffd6fd61026d8830a1a6928ac3154f6f0d237","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_691296b6","line":8904,"in_reply_to":"3fa7e38b_577d01e5","updated":"2019-11-20 02:43:11.000000000","message":"I think we have same goal, but different on the implement.\n\nIf we didn\u0027t filter by host, then we needn\u0027t another db call to check the migration which dest is our host.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"8800041ff326026a7ad524847855ee5df369ebe6","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_b429b7f2","line":8904,"in_reply_to":"3fa7e38b_691296b6","updated":"2019-11-20 18:27:54.000000000","message":"I understand. I just think that removing filters by host for a compute node querying instances is opening the door for additional problems down the road. I think it\u0027s an issue of being more error-prone and would provide a path for introducing bugs where a compute node mutates or reads data from instances that do not belong to it.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"89d8e486f486a161c639251eab99ff31ac7b806b","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_618e3f2f","line":8904,"in_reply_to":"3fa7e38b_a1b75721","updated":"2019-11-19 00:25:55.000000000","message":"\u003e In this patch, I think we should really stick to only destroying\n \u003e virt guests that are either (1) deleted or (2) tracked anywhere in\n \u003e the database. If a non-deleted instance still has migration\n \u003e records, it is still being tracked in the database as far as I\n \u003e understand.\n\nThis ^ should say \"(2) NOT tracked\". Apologies.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"8f99222c5c0823cb3433ebff148cc8d5539c06b3","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_b772357b","line":8904,"in_reply_to":"3fa7e38b_a1b75721","updated":"2019-11-19 05:02:18.000000000","message":"\u003e Note that self._get_instances_on_driver filters the query on\n \u003e host\u003dself.host to get only records for this compute host for the\n \u003e powervm and zvm drivers (which is appropriate, a compute host\n \u003e should not be querying instances that are not related to it).\n \u003e \n \u003e Because the query filters on only host\u003dself.host, it is possible\n \u003e for instances in the middle of migration to be excluded from the\n \u003e query when they are not actually orphans. See my comments on PS37\n \u003e for more details.\n \u003e \n \u003e Because the set of \"virt guests on this host\" - \"db instance\n \u003e records with host\u003dself.host\" might include instances that a\n \u003e mid-migration, I think we need to exclude them and I think\n \u003e excluding all \"in-progress\" for the host is simpler. Once the\n \u003e migrations are completed, the cleanup will take care of it at the\n \u003e next interval.\n \u003e \n \u003e In general, and unrelated to the the powervm and zvm driver\n \u003e behavior (gets instances with host\u003dself.host), I think it probably\n \u003e would not be the best idea to destroy virt guests for non-deleted\n \u003e instances that are in the middle of migration anyway because\n \u003e nova-compute migration methods will expect to handle create/destroy\n \u003e of virt guests during migration. If this cleanup routine destroys\n \u003e guests out from underneath the migration methods, errors or other\n \u003e failure may result.\n\nSo (1) we shouldn\u0027t filter by the host at line 644. Ensure the virt guests is real non-tracked instance. (2) Then filter the host \u003d\u003d self.host at line 9824 to ensure the deleted_instances only include the instances are on this host.\n\n\n \u003e \n \u003e In this patch, I think we should really stick to only destroying\n \u003e virt guests that are either (1) deleted or (2) tracked anywhere in\n \u003e the database. If a non-deleted instance still has migration\n \u003e records, it is still being tracked in the database as far as I\n \u003e understand.\n++, or more clear to say for (1) deleted and host \u003d\u003d self.host, whatever it is deleted in the mid of migration. The target side is cleanup by _incompelete_migration_cleanup.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"80dc363b633c64ef7de1a3ff9c7753aecd1bead9","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_577d01e5","line":8904,"in_reply_to":"3fa7e38b_b772357b","updated":"2019-11-19 06:09:09.000000000","message":"I disagree, I think the filter by host at L644 is appropriate for the compute host to inspect only instances that are associated with it. It does not seem like a good idea to have a compute host access instance records owned by other compute hosts in a cell.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"d8abe8676545431a71ff823b3334a0fb6177c7c1","unresolved":false,"context_lines":[{"line_number":8901,"context_line":"        # We want to destroy them, but they have no DB entry so we can\u0027t"},{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_4c27dec8","line":8904,"in_reply_to":"3fa7e38b_c4717a79","updated":"2019-11-15 05:05:30.000000000","message":"As my understand, the notracked_insts_uuids is a list of instance without any DB record. If the instance is in the middle of the migration, it must have an instance record in the db, right? So it sounds right at here.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"06c0d799b6e3512ecb910bd16a1489b3595a6a1a","unresolved":false,"context_lines":[{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"},{"line_number":8908,"context_line":"                  \u0027uuid\u0027: uuid,"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_df98111c","line":8905,"updated":"2019-11-20 16:43:21.000000000","message":"This seems like a really terrible idea to me. This is going to treat any vm running in the hypervisor as if it was an instance at some point right?\n\nIf I create a vm in my hypervisor right now, underneath nova, nova will ignore it because it doesn\u0027t know anything about it. That may be a bad idea, but it\u0027s possible. Even though the reaping of these things is opt-in, you\u0027re adding logic to nova to consider those things *are* or *were* nova instances, which seems like a very dangerous direction to go in.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"3229a85a986fdef1a9dfa0a096ff279f1012e021","unresolved":false,"context_lines":[{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"},{"line_number":8908,"context_line":"                  \u0027uuid\u0027: uuid,"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_c766072a","line":8905,"in_reply_to":"3fa7e38b_9434bb4a","updated":"2019-11-20 19:38:25.000000000","message":"I can appreciate the unifying nature of faking some instance records to smooth things out for the higher layers. I just think it\u0027s a dangerous thing to do, especially in the future when someone messes with the periodic task without grasping the fact that this inner method is fibbing things. This instance can\u0027t load anything from the database, doesn\u0027t have BDMs, etc, so special handling is required anyway, as this patch already does. Since testing of periodics is pretty sketchy anyway, hate to add more obscurity.\n\nAnyway, it\u0027s all moot if the general idea of this patch is not going to pan  out altogether :)","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7e7c9d53b954c0de6c9b6102efa52c04972892cf","unresolved":false,"context_lines":[{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"},{"line_number":8908,"context_line":"                  \u0027uuid\u0027: uuid,"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_ea5d0a16","line":8905,"in_reply_to":"3fa7e38b_c766072a","updated":"2019-11-20 20:00:03.000000000","message":"Yep, understood. I didn\u0027t really like my idea either, it was like choosing between two bad things.\n\nThat is why I struggled to support this patch, because at nearly every turn it needs to do something risky or convoluted to make it work. And I don\u0027t think it is overall worth the effort given the ability to avoid the situation with \u0027nova-manage db archive_deleted_rows --before \u003cdate\u003e\u0027.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"8800041ff326026a7ad524847855ee5df369ebe6","unresolved":false,"context_lines":[{"line_number":8902,"context_line":"        # use self.driver.destroy()"},{"line_number":8903,"context_line":"        notracked_insts_uuids \u003d set(driver_inst_uuids) - set(db_insts_uuids)"},{"line_number":8904,"context_line":""},{"line_number":8905,"context_line":"        # construct instance objects for instance without a db entry"},{"line_number":8906,"context_line":"        for uuid in notracked_insts_uuids:"},{"line_number":8907,"context_line":"            kw \u003d {"},{"line_number":8908,"context_line":"                  \u0027uuid\u0027: uuid,"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_9434bb4a","line":8905,"in_reply_to":"3fa7e38b_df98111c","updated":"2019-11-20 18:27:54.000000000","message":"Full disclosure, this was my idea, not the author\u0027s.\n\nOriginally, the patch underneath this one was adding a new destroy method to the libvirt driver to be able to destroy a virt domain by name instead of by instance object. The new driver destroy method was complicated, so I suggested creating shell instance objects to be able to re-use the existing driver destroy method instead. And maybe that was my mistake to think that was better.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"051658ed72e5fc6da3269bd8a5b7c9ff9e47efff","unresolved":false,"context_lines":[{"line_number":8916,"context_line":"                notracked_insts.add(inst)"},{"line_number":8917,"context_line":""},{"line_number":8918,"context_line":"        # Now find instances that are in the nova DB but aren\u0027t"},{"line_number":8919,"context_line":"        # supposed to be running on this host.  Ignore ones that are"},{"line_number":8920,"context_line":"        # migrating/resizing or waiting for migrate/resize confirmation."},{"line_number":8921,"context_line":"        # task_state of RESIZE_MIGRATED/RESIZE_FINISH is fair game."},{"line_number":8922,"context_line":"        for instance in db_instances:"},{"line_number":8923,"context_line":"            timeout \u003d CONF.running_deleted_instance_timeout"},{"line_number":8924,"context_line":"            if (instance.deleted and"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_04b472f1","line":8921,"range":{"start_line":8919,"start_character":46,"end_line":8921,"end_character":67},"updated":"2019-11-14 00:44:35.000000000","message":"This part of the comment is outdated and should be removed.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"b269f5945f7c48d0ad0cb004e283c2927229d582","unresolved":false,"context_lines":[{"line_number":8925,"context_line":"                self._deleted_old_enough(instance, timeout)):"},{"line_number":8926,"context_line":"                deleted_insts.add(instance)"},{"line_number":8927,"context_line":""},{"line_number":8928,"context_line":"        return deleted_insts, notracked_insts"},{"line_number":8929,"context_line":""},{"line_number":8930,"context_line":"    def _deleted_old_enough(self, instance, timeout):"},{"line_number":8931,"context_line":"        deleted_at \u003d instance.deleted_at"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_3f43a241","line":8928,"range":{"start_line":8928,"start_character":15,"end_line":8928,"end_character":28},"updated":"2019-11-15 05:31:41.000000000","message":"This includes the mid-migration instance but the instance db already deleted, right?\n\nThe \u0027_cleanup_incomplete_migrations\u0027 only include the error migration, but the instance db record isn\u0027t deleted yet.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ad5d9d550d2b0bbb82e0c49daa6fe65914ba828","unresolved":false,"context_lines":[{"line_number":8925,"context_line":"                self._deleted_old_enough(instance, timeout)):"},{"line_number":8926,"context_line":"                deleted_insts.add(instance)"},{"line_number":8927,"context_line":""},{"line_number":8928,"context_line":"        return deleted_insts, notracked_insts"},{"line_number":8929,"context_line":""},{"line_number":8930,"context_line":"    def _deleted_old_enough(self, instance, timeout):"},{"line_number":8931,"context_line":"        deleted_at \u003d instance.deleted_at"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_e16f8f8f","line":8928,"range":{"start_line":8928,"start_character":15,"end_line":8928,"end_character":28},"in_reply_to":"3fa7e38b_3f43a241","updated":"2019-11-19 00:22:53.000000000","message":"Yes, this will be any instance marked as \u0027deleted\u0027 in the database. And the _cleanup_incomplete_migrations cleans up only for deleted instances. See my comment on L9413.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ad5d9d550d2b0bbb82e0c49daa6fe65914ba828","unresolved":false,"context_lines":[{"line_number":9391,"context_line":"                    instance.save()"},{"line_number":9392,"context_line":""},{"line_number":9393,"context_line":"    @periodic_task.periodic_task(spacing\u003dCONF.instance_delete_interval)"},{"line_number":9394,"context_line":"    def _cleanup_incomplete_migrations(self, context):"},{"line_number":9395,"context_line":"        \"\"\"Delete instance files on failed resize/revert-resize operation"},{"line_number":9396,"context_line":""},{"line_number":9397,"context_line":"        During resize/revert-resize operation, if that instance gets deleted"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_412d4344","line":9394,"updated":"2019-11-19 00:22:53.000000000","message":"_cleanup_incomplete_migrations","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ad5d9d550d2b0bbb82e0c49daa6fe65914ba828","unresolved":false,"context_lines":[{"line_number":9410,"context_line":"        inst_uuid_from_migrations \u003d set([migration.instance_uuid for migration"},{"line_number":9411,"context_line":"                                         in migrations])"},{"line_number":9412,"context_line":""},{"line_number":9413,"context_line":"        inst_filters \u003d {\u0027deleted\u0027: True, \u0027soft_deleted\u0027: False,"},{"line_number":9414,"context_line":"                        \u0027uuid\u0027: inst_uuid_from_migrations}"},{"line_number":9415,"context_line":"        attrs \u003d [\u0027info_cache\u0027, \u0027security_groups\u0027, \u0027system_metadata\u0027]"},{"line_number":9416,"context_line":"        with utils.temporary_mutation(context, read_deleted\u003d\u0027yes\u0027):"}],"source_content_type":"text/x-python","patch_set":42,"id":"3fa7e38b_210fe7e0","line":9413,"range":{"start_line":9413,"start_character":24,"end_line":9413,"end_character":39},"updated":"2019-11-19 00:22:53.000000000","message":"Here we will only get instances that are deleted in _cleanup_incomplete_migrations.","commit_id":"2b1cec8af4685dffdc7b6b2d80a4b04783dd88a2"}],"nova/conf/compute.py":[{"author":{"_account_id":28715,"name":"Jim Gauld","email":"James.Gauld@windriver.com","username":"jgauld"},"change_message_id":"1edee150363a23927a14e80eaba998e79632795e","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1218,"context_line":"\"\"\"),"},{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"log\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Powers down the instances and deletes them\u0027),"},{"line_number":1223,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down Orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_9b09ee96","line":1220,"range":{"start_line":1220,"start_character":6,"end_line":1220,"end_character":22},"updated":"2019-03-19 14:58:41.000000000","message":"My preference would be default\u003d\"reap\".\n\nAnyone who would be managing VMs on the same host, outside\nof nova\u0027s knowledge is not really expected, and resources not properly tracked, etc.   Running out of memory is much easier to do when one uses hugepages, so we rely on exact accounting. The reason I discovered orphans in the first place was because I was hitting OOM Killer due to untracked memory.  This option gives someone the ability to change from the default.","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"e698a128c0a46e92e0a7ff5a8977e4a2ca603ef5","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1218,"context_line":"\"\"\"),"},{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"log\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Powers down the instances and deletes them\u0027),"},{"line_number":1223,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down Orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_38cf9258","line":1220,"range":{"start_line":1220,"start_character":6,"end_line":1220,"end_character":22},"in_reply_to":"5fc1f717_9b09ee96","updated":"2019-03-20 02:23:33.000000000","message":"Done","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"40a3e944135e09428f521170fed5ddc81d55bd62","unresolved":false,"context_lines":[{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1218,"context_line":"\"\"\"),"},{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"log\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Powers down the instances and deletes them\u0027),"},{"line_number":1223,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down Orphan instances\u0027),"},{"line_number":1224,"context_line":"            (\u0027log\u0027, \u0027Logs warning message about deletion of the resource\u0027),"},{"line_number":1225,"context_line":"            (\u0027noop\u0027, \u0027Takes no action\u0027),"},{"line_number":1226,"context_line":"        ],"},{"line_number":1227,"context_line":"        help\u003d\"\"\""},{"line_number":1228,"context_line":"The compute service periodically checks for instances that have not been"},{"line_number":1229,"context_line":"enrolled in the database but remain running on the compute node. The"},{"line_number":1230,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"Related options:"},{"line_number":1233,"context_line":""},{"line_number":1234,"context_line":"* ``instance_delete_interval``"},{"line_number":1235,"context_line":"\"\"\"),"},{"line_number":1236,"context_line":"]"},{"line_number":1237,"context_line":""},{"line_number":1238,"context_line":"instance_cleaning_opts \u003d ["}],"source_content_type":"text/x-python","patch_set":6,"id":"5fc1f717_8750ba0c","line":1235,"range":{"start_line":1219,"start_character":0,"end_line":1235,"end_character":5},"updated":"2019-03-19 08:52:26.000000000","message":"looks good :)","commit_id":"ecbe928dd36ca125ef7832848e9f8669ea394926"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1218,"context_line":"\"\"\"),"},{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"reap\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the Orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_e985075b","line":1219,"range":{"start_line":1219,"start_character":16,"end_line":1219,"end_character":46},"updated":"2019-03-27 14:24:53.000000000","message":"You should also mention this as a related option from the help for instance_delete_interval.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1216,"context_line":""},{"line_number":1217,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1218,"context_line":"\"\"\"),"},{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"reap\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the Orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_3fcd7365","line":1219,"range":{"start_line":1219,"start_character":16,"end_line":1219,"end_character":46},"in_reply_to":"5fc1f717_e985075b","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"09aa2129c38ce3aa0814916226bb75c28521bcc5","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1218,"context_line":"\"\"\"),"},{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"reap\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the Orphan instances\u0027),"},{"line_number":1223,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs Orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_dd1b257e","line":1220,"updated":"2019-03-27 17:05:03.000000000","message":"Note that defaulting this to \"reap\" is a big shift from the existing behavior of nova not touching guests that might have been created out-of-band for testing or operator monitoring systems, etc. In the worst case, an operator could upgrade nova and then have their guests (doing work outside nova) destroyed suddenly.\n\nAt the very least, we should have a big fat release note on this change, in the upgrade section.\n\nIf we wanted to be extra careful, we would default to \"log\" but maybe that\u0027s too conservative, considering I think most operators probably do not run virtual machines outside of nova on compute hosts.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1217,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1218,"context_line":"\"\"\"),"},{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"reap\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the Orphan instances\u0027),"},{"line_number":1223,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs Orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_ffc28b33","line":1220,"in_reply_to":"5fc1f717_dd1b257e","updated":"2019-03-28 08:15:43.000000000","message":"\u0027log\u0027 might be less impact.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"reap\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the Orphan instances\u0027),"},{"line_number":1223,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs Orphan instances\u0027),"},{"line_number":1224,"context_line":"            (\u0027log\u0027, \u0027Logs warning message of the Orphan instances\u0027),"},{"line_number":1225,"context_line":"            (\u0027noop\u0027, \u0027Takes no action\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_a97b7f78","line":1222,"range":{"start_line":1222,"start_character":42,"end_line":1222,"end_character":48},"updated":"2019-03-27 14:24:53.000000000","message":"This doesn\u0027t need to be capitalized - here and elsewhere.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1219,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1220,"context_line":"        default\u003d\"reap\","},{"line_number":1221,"context_line":"        choices\u003d["},{"line_number":1222,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the Orphan instances\u0027),"},{"line_number":1223,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs Orphan instances\u0027),"},{"line_number":1224,"context_line":"            (\u0027log\u0027, \u0027Logs warning message of the Orphan instances\u0027),"},{"line_number":1225,"context_line":"            (\u0027noop\u0027, \u0027Takes no action\u0027),"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_1fbe77ad","line":1222,"range":{"start_line":1222,"start_character":42,"end_line":1222,"end_character":48},"in_reply_to":"5fc1f717_a97b7f78","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        ],"},{"line_number":1227,"context_line":"        help\u003d\"\"\""},{"line_number":1228,"context_line":"The compute service periodically checks for instances that have not been"},{"line_number":1229,"context_line":"enrolled in the database but remain running on the compute node. The"},{"line_number":1230,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"Related options:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_09ee5321","line":1229,"range":{"start_line":1229,"start_character":0,"end_line":1229,"end_character":8},"updated":"2019-03-27 14:24:53.000000000","message":"enrolled is a bit confusing, I\u0027d say \"tracked\".\n\nNote that this could affect any guests created outside of nova, but maybe that\u0027s obvious.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"        ],"},{"line_number":1227,"context_line":"        help\u003d\"\"\""},{"line_number":1228,"context_line":"The compute service periodically checks for instances that have not been"},{"line_number":1229,"context_line":"enrolled in the database but remain running on the compute node. The"},{"line_number":1230,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"Related options:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_bfde430e","line":1229,"range":{"start_line":1229,"start_character":0,"end_line":1229,"end_character":8},"in_reply_to":"5fc1f717_09ee5321","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1228,"context_line":"The compute service periodically checks for instances that have not been"},{"line_number":1229,"context_line":"enrolled in the database but remain running on the compute node. The"},{"line_number":1230,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"Related options:"},{"line_number":1233,"context_line":""},{"line_number":1234,"context_line":"* ``instance_delete_interval``"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_c9f36b08","line":1231,"updated":"2019-03-27 14:24:53.000000000","message":"Shouldn\u0027t this also mention which virt drivers support it?","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1228,"context_line":"The compute service periodically checks for instances that have not been"},{"line_number":1229,"context_line":"enrolled in the database but remain running on the compute node. The"},{"line_number":1230,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"Related options:"},{"line_number":1233,"context_line":""},{"line_number":1234,"context_line":"* ``instance_delete_interval``"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_bf072382","line":1231,"in_reply_to":"5fc1f717_c9f36b08","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b1932ba95945cf0e63e1343c3b8d68ea9825b51","unresolved":false,"context_lines":[{"line_number":1246,"context_line":"        ],"},{"line_number":1247,"context_line":"        help\u003d\"\"\""},{"line_number":1248,"context_line":"The compute service periodically checks for instances that have not been"},{"line_number":1249,"context_line":"tracked in the database but remain running on the compute node. The"},{"line_number":1250,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"Virt driver supported this feature:"},{"line_number":1253,"context_line":"* ``libvirt``"}],"source_content_type":"text/x-python","patch_set":16,"id":"5fc1f717_f50a271e","line":1250,"range":{"start_line":1249,"start_character":64,"end_line":1250,"end_character":12},"updated":"2019-04-04 13:12:22.000000000","message":"This option","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"ac5ab040f70f78a077d3ec27b5885684266d45ed","unresolved":false,"context_lines":[{"line_number":1246,"context_line":"        ],"},{"line_number":1247,"context_line":"        help\u003d\"\"\""},{"line_number":1248,"context_line":"The compute service periodically checks for instances that have not been"},{"line_number":1249,"context_line":"tracked in the database but remain running on the compute node. The"},{"line_number":1250,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"Virt driver supported this feature:"},{"line_number":1253,"context_line":"* ``libvirt``"}],"source_content_type":"text/x-python","patch_set":16,"id":"5fc1f717_542bcfe9","line":1250,"range":{"start_line":1249,"start_character":64,"end_line":1250,"end_character":12},"in_reply_to":"5fc1f717_f50a271e","updated":"2019-04-08 07:33:10.000000000","message":"Done","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b1932ba95945cf0e63e1343c3b8d68ea9825b51","unresolved":false,"context_lines":[{"line_number":1250,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"Virt driver supported this feature:"},{"line_number":1253,"context_line":"* ``libvirt``"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"Related options:"},{"line_number":1256,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"5fc1f717_b50c9f39","line":1253,"updated":"2019-04-04 13:12:22.000000000","message":"Need a blank line before the bullet list for formatting.","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"ac5ab040f70f78a077d3ec27b5885684266d45ed","unresolved":false,"context_lines":[{"line_number":1250,"context_line":"above option enables action to be taken when such instances are identified."},{"line_number":1251,"context_line":""},{"line_number":1252,"context_line":"Virt driver supported this feature:"},{"line_number":1253,"context_line":"* ``libvirt``"},{"line_number":1254,"context_line":""},{"line_number":1255,"context_line":"Related options:"},{"line_number":1256,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"5fc1f717_1431c759","line":1253,"in_reply_to":"5fc1f717_b50c9f39","updated":"2019-04-08 07:33:10.000000000","message":"Done","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":1236,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1237,"context_line":"\"\"\"),"},{"line_number":1238,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1239,"context_line":"        default\u003d\"log\","},{"line_number":1240,"context_line":"        choices\u003d["},{"line_number":1241,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the orphan instances\u0027),"},{"line_number":1242,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_0bcb0b1e","line":1239,"updated":"2019-04-26 13:52:35.000000000","message":"I think this default will result in periodic logging with the same message. So I think it will spam the logs.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":1236,"context_line":"* \"running_deleted_instance_action\""},{"line_number":1237,"context_line":"\"\"\"),"},{"line_number":1238,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1239,"context_line":"        default\u003d\"log\","},{"line_number":1240,"context_line":"        choices\u003d["},{"line_number":1241,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the orphan instances\u0027),"},{"line_number":1242,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs orphan instances\u0027),"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_aa0c0ba5","line":1239,"in_reply_to":"ffb9cba7_0bcb0b1e","updated":"2019-04-30 05:58:08.000000000","message":"Done","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"9bd32014662ad19398bedcba16221562ae909056","unresolved":false,"context_lines":[{"line_number":1238,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1239,"context_line":"        default\u003d\"log\","},{"line_number":1240,"context_line":"        choices\u003d["},{"line_number":1241,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the orphan instances\u0027),"},{"line_number":1242,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs orphan instances\u0027),"},{"line_number":1243,"context_line":"            (\u0027log\u0027, \u0027Logs warning message of the orphan instances\u0027),"},{"line_number":1244,"context_line":"            (\u0027noop\u0027, \u0027Takes no action\u0027),"},{"line_number":1245,"context_line":"        ],"},{"line_number":1246,"context_line":"        help\u003d\"\"\""},{"line_number":1247,"context_line":"The compute service periodically checks for instances that have not been"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_b61b5f19","line":1244,"range":{"start_line":1241,"start_character":12,"end_line":1244,"end_character":40},"updated":"2019-04-25 08:13:38.000000000","message":"++","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"0dbfecd1d801b237c46690bd7a4dc8beebecb99f","unresolved":false,"context_lines":[{"line_number":1238,"context_line":"    cfg.StrOpt(\"running_orphan_instance_action\","},{"line_number":1239,"context_line":"        default\u003d\"log\","},{"line_number":1240,"context_line":"        choices\u003d["},{"line_number":1241,"context_line":"            (\u0027reap\u0027, \u0027Delete and logs the orphan instances\u0027),"},{"line_number":1242,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down and logs orphan instances\u0027),"},{"line_number":1243,"context_line":"            (\u0027log\u0027, \u0027Logs warning message of the orphan instances\u0027),"},{"line_number":1244,"context_line":"            (\u0027noop\u0027, \u0027Takes no action\u0027),"},{"line_number":1245,"context_line":"        ],"},{"line_number":1246,"context_line":"        help\u003d\"\"\""},{"line_number":1247,"context_line":"The compute service periodically checks for instances that have not been"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_eaed23b7","line":1244,"range":{"start_line":1241,"start_character":12,"end_line":1244,"end_character":40},"in_reply_to":"ffb9cba7_b61b5f19","updated":"2019-04-30 05:58:08.000000000","message":"let us use noop.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bb56d4bdd085dc2298d35a75a62c2b1f01f190e3","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down instances and marks them as \u0027"},{"line_number":1194,"context_line":"             \u0027non-bootable which can be later used for debugging/analysis\u0027),"},{"line_number":1195,"context_line":"            (\u0027shutdown_unknown\u0027, \u0027Power down instances which marked deleted\u0027"},{"line_number":1196,"context_line":"              \u0027or a orphan instance.\u0027),"},{"line_number":1197,"context_line":"            (\u0027reap_unknown\u0027, \u0027Power down and deleted instances which marked\u0027"},{"line_number":1198,"context_line":"              \u0027deleted or a orphan instance.\u0027),"},{"line_number":1199,"context_line":"            (\u0027noop\u0027, \u0027Takes no action\u0027),"}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_e43d688e","line":1196,"updated":"2019-07-30 23:05:42.000000000","message":"I\u0027m not sure whether we really want/need this option, but I understand why you added it.","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"6a53ea294b0cc4adcf4b96d773880d4329e6705a","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"            (\u0027shutdown\u0027, \u0027Powers down instances and marks them as \u0027"},{"line_number":1194,"context_line":"             \u0027non-bootable which can be later used for debugging/analysis\u0027),"},{"line_number":1195,"context_line":"            (\u0027shutdown_unknown\u0027, \u0027Power down instances which marked deleted\u0027"},{"line_number":1196,"context_line":"              \u0027or a orphan instance.\u0027),"},{"line_number":1197,"context_line":"            (\u0027reap_unknown\u0027, \u0027Power down and deleted instances which marked\u0027"},{"line_number":1198,"context_line":"              \u0027deleted or a orphan instance.\u0027),"},{"line_number":1199,"context_line":"            (\u0027noop\u0027, \u0027Takes no action\u0027),"}],"source_content_type":"text/x-python","patch_set":36,"id":"7faddb67_b07aee84","line":1196,"in_reply_to":"7faddb67_e43d688e","updated":"2019-08-06 13:32:32.000000000","message":"This much safe than add an extra action to the current shutdown or reap. And we want to shutdown instead of reaping them also.","commit_id":"1fb47ad0094643732fa876c744d40f8e05667308"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8556,"context_line":""},{"line_number":8557,"context_line":"    def _mock_orphan_instances(self,"},{"line_number":8558,"context_line":"                               fake_name,"},{"line_number":8559,"context_line":"                               instance_get_by_filters_mock,"},{"line_number":8560,"context_line":"                               list_instances_mock,"},{"line_number":8561,"context_line":"                               list_instance_uuids_mock):"},{"line_number":8562,"context_line":"        instance \u003d self._create_fake_instance_obj({\u0027host\u0027: \u0027dummyhost\u0027})"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_b1b6f0f9","line":8559,"range":{"start_line":8559,"start_character":31,"end_line":8559,"end_character":59},"updated":"2019-04-26 13:52:35.000000000","message":"most of the nova test code uses mock_\u003cvariable name\u003e instead of \u003cvariable name\u003e_mock format","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8573,"context_line":"    @mock.patch.object(nova.virt.fake.FakeDriver, \u0027list_instance_uuids\u0027)"},{"line_number":8574,"context_line":"    @mock.patch.object(nova.virt.fake.FakeDriver, \"list_instances\")"},{"line_number":8575,"context_line":"    @mock.patch.object(objects.InstanceList, \"get_by_filters\")"},{"line_number":8576,"context_line":"    def test_cleanup_orphan_domain_reap(self, instance_get_by_filters_mock,"},{"line_number":8577,"context_line":"                                        list_instances_mock,"},{"line_number":8578,"context_line":"                                        list_instance_uuids_mock,"},{"line_number":8579,"context_line":"                                        destroy_by_name_mock,"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_f1d30837","line":8576,"range":{"start_line":8576,"start_character":28,"end_line":8576,"end_character":34},"updated":"2019-04-26 13:52:35.000000000","message":"you used instance everywhere else, please keep the terminology consistent.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8592,"context_line":"        # testing suspected instances branch"},{"line_number":8593,"context_line":"        self.compute._destroy_orphan_instances(self.context)"},{"line_number":8594,"context_line":"        destroy_mock.assert_called_once_with(self.context, instance,"},{"line_number":8595,"context_line":"                                             mock.ANY, mock.ANY, mock.ANY)"},{"line_number":8596,"context_line":""},{"line_number":8597,"context_line":"    @mock.patch.object(nova.virt.fake.FakeDriver, \u0027power_off_by_name\u0027)"},{"line_number":8598,"context_line":"    @mock.patch.object(nova.virt.fake.FakeDriver, \u0027power_off\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_91908c50","line":8595,"updated":"2019-04-26 13:52:35.000000000","message":"It is pretty confusing that this test destroys the same instance twice. Can we have to separate instance for the test, one that is an orphan and one that is suspected.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"325316a142c86c5ad7cfdec08b725e5680e6001c","unresolved":false,"context_lines":[{"line_number":8709,"context_line":"                                            list_instance_uuids_mock,"},{"line_number":8710,"context_line":"                                            destroy_by_name_mock,"},{"line_number":8711,"context_line":"                                            destroy_mock,"},{"line_number":8712,"context_line":"                                            calling_check\u003dFalse)"},{"line_number":8713,"context_line":""},{"line_number":8714,"context_line":"    @mock.patch.object(nova.virt.fake.FakeDriver, \u0027power_off_by_name\u0027)"},{"line_number":8715,"context_line":"    @mock.patch.object(nova.virt.fake.FakeDriver, \u0027destroy\u0027)"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_31ad2088","line":8712,"updated":"2019-04-26 13:52:35.000000000","message":"This feels like 3 separate test cases to me.","commit_id":"3f7d55cf6218939826cf8c86f3e451cdb55ea31a"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"7a8881055d4aee534a3d0d672ea3b7a6f12b38b2","unresolved":false,"context_lines":[{"line_number":49,"context_line":"from oslo_service import loopingcall"},{"line_number":50,"context_line":"from oslo_utils import fileutils"},{"line_number":51,"context_line":"from oslo_utils import fixture as utils_fixture"},{"line_number":52,"context_line":"from oslo_utils.fixture import uuidsentinel as uuids"},{"line_number":53,"context_line":"from oslo_utils import units"},{"line_number":54,"context_line":"from oslo_utils import uuidutils"},{"line_number":55,"context_line":"from oslo_utils import versionutils"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_fcc64768","line":52,"range":{"start_line":52,"start_character":0,"end_line":52,"end_character":52},"updated":"2019-01-30 07:04:52.000000000","message":"Here","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"7b75f3635b30108d3ea160960fcc57cd4289b229","unresolved":false,"context_lines":[{"line_number":49,"context_line":"from oslo_service import loopingcall"},{"line_number":50,"context_line":"from oslo_utils import fileutils"},{"line_number":51,"context_line":"from oslo_utils import fixture as utils_fixture"},{"line_number":52,"context_line":"from oslo_utils.fixture import uuidsentinel as uuids"},{"line_number":53,"context_line":"from oslo_utils import units"},{"line_number":54,"context_line":"from oslo_utils import uuidutils"},{"line_number":55,"context_line":"from oslo_utils import versionutils"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_95811afe","line":52,"range":{"start_line":52,"start_character":0,"end_line":52,"end_character":52},"in_reply_to":"9fdfeff1_fcc64768","updated":"2019-03-14 08:35:10.000000000","message":"Done","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"7a8881055d4aee534a3d0d672ea3b7a6f12b38b2","unresolved":false,"context_lines":[{"line_number":20902,"context_line":"\u0027\u0027\u0027], 1)"},{"line_number":20903,"context_line":""},{"line_number":20904,"context_line":"    def test_virt_destroy_name(self):"},{"line_number":20905,"context_line":"        uuid \u003d uuidutils.generate_uuid()"},{"line_number":20906,"context_line":"        conn \u003d self.drvr._host.get_connection()"},{"line_number":20907,"context_line":"        xml \u003d test_fakelibvirt.get_vm_xml(name\u003d\"destroybyname\", uuid\u003duuid)"},{"line_number":20908,"context_line":"        conn.defineXML(xml)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_1cc46b5e","line":20905,"range":{"start_line":20905,"start_character":15,"end_line":20905,"end_character":40},"updated":"2019-01-30 07:04:52.000000000","message":"Use uuids (oslo_utils.fixture.uuidsentinel)","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"7b75f3635b30108d3ea160960fcc57cd4289b229","unresolved":false,"context_lines":[{"line_number":20902,"context_line":"\u0027\u0027\u0027], 1)"},{"line_number":20903,"context_line":""},{"line_number":20904,"context_line":"    def test_virt_destroy_name(self):"},{"line_number":20905,"context_line":"        uuid \u003d uuidutils.generate_uuid()"},{"line_number":20906,"context_line":"        conn \u003d self.drvr._host.get_connection()"},{"line_number":20907,"context_line":"        xml \u003d test_fakelibvirt.get_vm_xml(name\u003d\"destroybyname\", uuid\u003duuid)"},{"line_number":20908,"context_line":"        conn.defineXML(xml)"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_b5869612","line":20905,"range":{"start_line":20905,"start_character":15,"end_line":20905,"end_character":40},"in_reply_to":"9fdfeff1_1cc46b5e","updated":"2019-03-14 08:35:10.000000000","message":"Done","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"7a8881055d4aee534a3d0d672ea3b7a6f12b38b2","unresolved":false,"context_lines":[{"line_number":20913,"context_line":"        try:"},{"line_number":20914,"context_line":"            dom \u003d conn.lookupByName(\"destroybyname\")"},{"line_number":20915,"context_line":"        except Exception as e:"},{"line_number":20916,"context_line":"            self.assertFalse(isinstance(e, exception.InstanceNotFound))"},{"line_number":20917,"context_line":""},{"line_number":20918,"context_line":""},{"line_number":20919,"context_line":"class LibvirtVolumeUsageTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_5c20b348","line":20916,"range":{"start_line":20916,"start_character":17,"end_line":20916,"end_character":71},"updated":"2019-01-30 07:04:52.000000000","message":"assertNotIsInstance(e, exception.InstanceNotFound)","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"7b75f3635b30108d3ea160960fcc57cd4289b229","unresolved":false,"context_lines":[{"line_number":20913,"context_line":"        try:"},{"line_number":20914,"context_line":"            dom \u003d conn.lookupByName(\"destroybyname\")"},{"line_number":20915,"context_line":"        except Exception as e:"},{"line_number":20916,"context_line":"            self.assertFalse(isinstance(e, exception.InstanceNotFound))"},{"line_number":20917,"context_line":""},{"line_number":20918,"context_line":""},{"line_number":20919,"context_line":"class LibvirtVolumeUsageTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_35c4e65e","line":20916,"range":{"start_line":20916,"start_character":17,"end_line":20916,"end_character":71},"in_reply_to":"9fdfeff1_5c20b348","updated":"2019-03-14 08:35:10.000000000","message":"Done","commit_id":"0df759655930e8c9df975c16217b22f4ca3df9f1"}],"nova/virt/driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1844,"context_line":"        return instance.get(\u0027host\u0027)"},{"line_number":1845,"context_line":""},{"line_number":1846,"context_line":"    def destroy_instance_by_name(self, instance_name):"},{"line_number":1847,"context_line":"        \"\"\"Destroy an instance domain if we only know \u0027name\u0027 and not the full"},{"line_number":1848,"context_line":"        instance (i.e., we lost instance object and it is not in Database)."},{"line_number":1849,"context_line":"        Using this routine is a last resort to reap instances, the preferred"},{"line_number":1850,"context_line":"        method is to use self.destroy(instance)."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_29aa2f70","line":1847,"range":{"start_line":1847,"start_character":31,"end_line":1847,"end_character":37},"updated":"2019-03-27 14:24:53.000000000","message":"nit: this is a libvirt specific term that wouldn\u0027t apply to other hypervisors, just say instance or guest.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1844,"context_line":"        return instance.get(\u0027host\u0027)"},{"line_number":1845,"context_line":""},{"line_number":1846,"context_line":"    def destroy_instance_by_name(self, instance_name):"},{"line_number":1847,"context_line":"        \"\"\"Destroy an instance domain if we only know \u0027name\u0027 and not the full"},{"line_number":1848,"context_line":"        instance (i.e., we lost instance object and it is not in Database)."},{"line_number":1849,"context_line":"        Using this routine is a last resort to reap instances, the preferred"},{"line_number":1850,"context_line":"        method is to use self.destroy(instance)."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_3ffb3379","line":1847,"range":{"start_line":1847,"start_character":31,"end_line":1847,"end_character":37},"in_reply_to":"5fc1f717_29aa2f70","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1847,"context_line":"        \"\"\"Destroy an instance domain if we only know \u0027name\u0027 and not the full"},{"line_number":1848,"context_line":"        instance (i.e., we lost instance object and it is not in Database)."},{"line_number":1849,"context_line":"        Using this routine is a last resort to reap instances, the preferred"},{"line_number":1850,"context_line":"        method is to use self.destroy(instance)."},{"line_number":1851,"context_line":""},{"line_number":1852,"context_line":"        This does not unplug VIFs, destroy block devices, or destroy disks."},{"line_number":1853,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_e9b987cb","line":1850,"range":{"start_line":1850,"start_character":25,"end_line":1850,"end_character":48},"updated":"2019-03-27 14:24:53.000000000","message":"Just say \"the ``destroy`` method.\"","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1847,"context_line":"        \"\"\"Destroy an instance domain if we only know \u0027name\u0027 and not the full"},{"line_number":1848,"context_line":"        instance (i.e., we lost instance object and it is not in Database)."},{"line_number":1849,"context_line":"        Using this routine is a last resort to reap instances, the preferred"},{"line_number":1850,"context_line":"        method is to use self.destroy(instance)."},{"line_number":1851,"context_line":""},{"line_number":1852,"context_line":"        This does not unplug VIFs, destroy block devices, or destroy disks."},{"line_number":1853,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_fff04b93","line":1850,"range":{"start_line":1850,"start_character":25,"end_line":1850,"end_character":48},"in_reply_to":"5fc1f717_e9b987cb","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1854,"context_line":"        raise NotImplementedError()"},{"line_number":1855,"context_line":""},{"line_number":1856,"context_line":"    def power_off_by_name(self, instance_name):"},{"line_number":1857,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_89c80355","line":1857,"range":{"start_line":1857,"start_character":23,"end_line":1857,"end_character":29},"updated":"2019-03-27 14:24:53.000000000","message":"same","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1854,"context_line":"        raise NotImplementedError()"},{"line_number":1855,"context_line":""},{"line_number":1856,"context_line":"    def power_off_by_name(self, instance_name):"},{"line_number":1857,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_bf2c0302","line":1857,"range":{"start_line":1857,"start_character":23,"end_line":1857,"end_character":29},"in_reply_to":"5fc1f717_89c80355","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"    def power_off_by_name(self, instance_name):"},{"line_number":1857,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":1861,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":1862,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_29c30f3a","line":1859,"range":{"start_line":1859,"start_character":20,"end_line":1859,"end_character":26},"updated":"2019-03-27 14:24:53.000000000","message":"same","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1856,"context_line":"    def power_off_by_name(self, instance_name):"},{"line_number":1857,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":1861,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":1862,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_7f321b60","line":1859,"range":{"start_line":1859,"start_character":20,"end_line":1859,"end_character":26},"in_reply_to":"5fc1f717_29c30f3a","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1857,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":1861,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":1862,"context_line":""},{"line_number":1863,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_a9e4dfe0","line":1860,"range":{"start_line":1860,"start_character":24,"end_line":1860,"end_character":31},"updated":"2019-03-27 14:24:53.000000000","message":"We aren\u0027t destroying the guest with this method.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1857,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":1861,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":1862,"context_line":""},{"line_number":1863,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_9f358747","line":1860,"range":{"start_line":1860,"start_character":24,"end_line":1860,"end_character":31},"in_reply_to":"5fc1f717_a9e4dfe0","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":1861,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":1862,"context_line":""},{"line_number":1863,"context_line":"        \"\"\""},{"line_number":1864,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_29d8ef1b","line":1861,"range":{"start_line":1861,"start_character":21,"end_line":1861,"end_character":27},"updated":"2019-03-27 14:24:53.000000000","message":"DB; the instance...","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1858,"context_line":""},{"line_number":1859,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":1860,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":1861,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":1862,"context_line":""},{"line_number":1863,"context_line":"        \"\"\""},{"line_number":1864,"context_line":"        raise NotImplementedError()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_3f4013a5","line":1861,"range":{"start_line":1861,"start_character":21,"end_line":1861,"end_character":27},"in_reply_to":"5fc1f717_29d8ef1b","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"}],"nova/virt/fake.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":664,"context_line":"    def unquiesce(self, context, instance, image_meta):"},{"line_number":665,"context_line":"        pass"},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"    def power_off_by_name(self, instance_name):"},{"line_number":668,"context_line":"        pass"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def destroy_instance_by_name(self, instance_name):"},{"line_number":671,"context_line":"        pass"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":""},{"line_number":674,"context_line":"class FakeVirtAPI(virtapi.VirtAPI):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_291f8fb7","line":671,"range":{"start_line":667,"start_character":4,"end_line":671,"end_character":12},"updated":"2019-03-27 14:24:53.000000000","message":"Couldn\u0027t we implement these by looping over self.instances to find any by name and then take the appropriate action (change the power state or destroy the guest, i.e. remove it from self.instances).","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":664,"context_line":"    def unquiesce(self, context, instance, image_meta):"},{"line_number":665,"context_line":"        pass"},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"    def power_off_by_name(self, instance_name):"},{"line_number":668,"context_line":"        pass"},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    def destroy_instance_by_name(self, instance_name):"},{"line_number":671,"context_line":"        pass"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":""},{"line_number":674,"context_line":"class FakeVirtAPI(virtapi.VirtAPI):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_62704073","line":671,"range":{"start_line":667,"start_character":4,"end_line":671,"end_character":12},"in_reply_to":"5fc1f717_291f8fb7","updated":"2019-03-28 08:15:43.000000000","message":"I gonna address this later. thanks.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9521,"context_line":"        \"\"\"Destroy a domain by name."},{"line_number":9522,"context_line":""},{"line_number":9523,"context_line":"        Destroy a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":9524,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":9525,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9526,"context_line":""},{"line_number":9527,"context_line":"        This does not unplug VIFs, destroy block devices, or destroy disks."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_e97ae7ee","line":9524,"range":{"start_line":9524,"start_character":24,"end_line":9524,"end_character":31},"updated":"2019-03-27 14:24:53.000000000","message":"destroy","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9521,"context_line":"        \"\"\"Destroy a domain by name."},{"line_number":9522,"context_line":""},{"line_number":9523,"context_line":"        Destroy a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":9524,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":9525,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9526,"context_line":""},{"line_number":9527,"context_line":"        This does not unplug VIFs, destroy block devices, or destroy disks."}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_9f5ca77d","line":9524,"range":{"start_line":9524,"start_character":24,"end_line":9524,"end_character":31},"in_reply_to":"5fc1f717_e97ae7ee","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9522,"context_line":""},{"line_number":9523,"context_line":"        Destroy a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":9524,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":9525,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9526,"context_line":""},{"line_number":9527,"context_line":"        This does not unplug VIFs, destroy block devices, or destroy disks."},{"line_number":9528,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_a9805fc0","line":9525,"range":{"start_line":9525,"start_character":21,"end_line":9525,"end_character":26},"updated":"2019-03-27 14:24:53.000000000","message":"; the","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9522,"context_line":""},{"line_number":9523,"context_line":"        Destroy a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":9524,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":9525,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9526,"context_line":""},{"line_number":9527,"context_line":"        This does not unplug VIFs, destroy block devices, or destroy disks."},{"line_number":9528,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_3f57b35a","line":9525,"range":{"start_line":9525,"start_character":21,"end_line":9525,"end_character":26},"in_reply_to":"5fc1f717_a9805fc0","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9533,"context_line":"                state \u003d libvirt_guest.LIBVIRT_POWER_STATE[state]"},{"line_number":9534,"context_line":"                if state not in [power_state.SHUTDOWN, power_state.CRASHED]:"},{"line_number":9535,"context_line":"                    virt_dom.destroy()"},{"line_number":9536,"context_line":"            except libvirt.libvirtError as e:"},{"line_number":9537,"context_line":"                errcode \u003d e.get_error_code()"},{"line_number":9538,"context_line":"                if errcode \u003d\u003d libvirt.VIR_ERR_OPERATION_TIMEOUT:"},{"line_number":9539,"context_line":"                    LOG.warning("}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_89000336","line":9536,"updated":"2019-03-27 14:24:53.000000000","message":"Do we want to return from this except block? What if we hit something here and then call undefineFlags below?","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9533,"context_line":"                state \u003d libvirt_guest.LIBVIRT_POWER_STATE[state]"},{"line_number":9534,"context_line":"                if state not in [power_state.SHUTDOWN, power_state.CRASHED]:"},{"line_number":9535,"context_line":"                    virt_dom.destroy()"},{"line_number":9536,"context_line":"            except libvirt.libvirtError as e:"},{"line_number":9537,"context_line":"                errcode \u003d e.get_error_code()"},{"line_number":9538,"context_line":"                if errcode \u003d\u003d libvirt.VIR_ERR_OPERATION_TIMEOUT:"},{"line_number":9539,"context_line":"                    LOG.warning("}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_5f5cff49","line":9536,"in_reply_to":"5fc1f717_89000336","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9538,"context_line":"                if errcode \u003d\u003d libvirt.VIR_ERR_OPERATION_TIMEOUT:"},{"line_number":9539,"context_line":"                    LOG.warning("},{"line_number":9540,"context_line":"                        \"Cannot destroy instance, operation time out, %s\","},{"line_number":9541,"context_line":"                         instance_name)"},{"line_number":9542,"context_line":"                    reason \u003d _(\"operation time out\")"},{"line_number":9543,"context_line":"                    raise exception.InstancePowerOffFailure(reason\u003dreason)"},{"line_number":9544,"context_line":"                with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_49dd3bdb","line":9541,"updated":"2019-03-27 14:24:53.000000000","message":"alignment","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9538,"context_line":"                if errcode \u003d\u003d libvirt.VIR_ERR_OPERATION_TIMEOUT:"},{"line_number":9539,"context_line":"                    LOG.warning("},{"line_number":9540,"context_line":"                        \"Cannot destroy instance, operation time out, %s\","},{"line_number":9541,"context_line":"                         instance_name)"},{"line_number":9542,"context_line":"                    reason \u003d _(\"operation time out\")"},{"line_number":9543,"context_line":"                    raise exception.InstancePowerOffFailure(reason\u003dreason)"},{"line_number":9544,"context_line":"                with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_ff4ccbc8","line":9541,"in_reply_to":"5fc1f717_49dd3bdb","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9545,"context_line":"                    LOG.error(\u0027Error from libvirt during destroy. \u0027"},{"line_number":9546,"context_line":"                              \u0027Code\u003d%(errcode)s Error\u003d%(e)s, name\u003d%(name)s\u0027,"},{"line_number":9547,"context_line":"                               ({\u0027errcode\u0027: errcode,"},{"line_number":9548,"context_line":"                                  \u0027e\u0027: e,"},{"line_number":9549,"context_line":"                                  \u0027name\u0027: instance_name}))"},{"line_number":9550,"context_line":""},{"line_number":9551,"context_line":"            try:"},{"line_number":9552,"context_line":"                virt_dom.undefineFlags("}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_09f5f356","line":9549,"range":{"start_line":9548,"start_character":33,"end_line":9549,"end_character":58},"updated":"2019-03-27 14:24:53.000000000","message":"alignment","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9545,"context_line":"                    LOG.error(\u0027Error from libvirt during destroy. \u0027"},{"line_number":9546,"context_line":"                              \u0027Code\u003d%(errcode)s Error\u003d%(e)s, name\u003d%(name)s\u0027,"},{"line_number":9547,"context_line":"                               ({\u0027errcode\u0027: errcode,"},{"line_number":9548,"context_line":"                                  \u0027e\u0027: e,"},{"line_number":9549,"context_line":"                                  \u0027name\u0027: instance_name}))"},{"line_number":9550,"context_line":""},{"line_number":9551,"context_line":"            try:"},{"line_number":9552,"context_line":"                virt_dom.undefineFlags("}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_7fce9b2d","line":9549,"range":{"start_line":9548,"start_character":33,"end_line":9549,"end_character":58},"in_reply_to":"5fc1f717_09f5f356","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9549,"context_line":"                                  \u0027name\u0027: instance_name}))"},{"line_number":9550,"context_line":""},{"line_number":9551,"context_line":"            try:"},{"line_number":9552,"context_line":"                virt_dom.undefineFlags("},{"line_number":9553,"context_line":"                    libvirt.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE)"},{"line_number":9554,"context_line":"            except libvirt.libvirtError as e:"},{"line_number":9555,"context_line":"                with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_099ad312","line":9552,"updated":"2019-03-27 14:24:53.000000000","message":"What is this for? Please document the code.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9549,"context_line":"                                  \u0027name\u0027: instance_name}))"},{"line_number":9550,"context_line":""},{"line_number":9551,"context_line":"            try:"},{"line_number":9552,"context_line":"                virt_dom.undefineFlags("},{"line_number":9553,"context_line":"                    libvirt.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE)"},{"line_number":9554,"context_line":"            except libvirt.libvirtError as e:"},{"line_number":9555,"context_line":"                with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_c24ed46d","line":9552,"in_reply_to":"5fc1f717_099ad312","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9557,"context_line":"                    LOG.error(\u0027Error from libvirt during destroy. \u0027"},{"line_number":9558,"context_line":"                              \u0027Code\u003d%(errcode)s Error\u003d%(e)s, name\u003d%(name)s\u0027,"},{"line_number":9559,"context_line":"                               ({\u0027errcode\u0027: errcode,"},{"line_number":9560,"context_line":"                                  \u0027e\u0027: e,"},{"line_number":9561,"context_line":"                                  \u0027name\u0027: instance_name}))"},{"line_number":9562,"context_line":"        except exception.InstanceNotFound:"},{"line_number":9563,"context_line":"            # If the instance is already gone, we\u0027re happy."},{"line_number":9564,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_698a77bf","line":9561,"range":{"start_line":9560,"start_character":34,"end_line":9561,"end_character":55},"updated":"2019-03-27 14:24:53.000000000","message":"alignment","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9557,"context_line":"                    LOG.error(\u0027Error from libvirt during destroy. \u0027"},{"line_number":9558,"context_line":"                              \u0027Code\u003d%(errcode)s Error\u003d%(e)s, name\u003d%(name)s\u0027,"},{"line_number":9559,"context_line":"                               ({\u0027errcode\u0027: errcode,"},{"line_number":9560,"context_line":"                                  \u0027e\u0027: e,"},{"line_number":9561,"context_line":"                                  \u0027name\u0027: instance_name}))"},{"line_number":9562,"context_line":"        except exception.InstanceNotFound:"},{"line_number":9563,"context_line":"            # If the instance is already gone, we\u0027re happy."},{"line_number":9564,"context_line":"            pass"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_7fe77bad","line":9561,"range":{"start_line":9560,"start_character":34,"end_line":9561,"end_character":55},"in_reply_to":"5fc1f717_698a77bf","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9567,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":9568,"context_line":""},{"line_number":9569,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":9570,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":9571,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9572,"context_line":""},{"line_number":9573,"context_line":"        \"\"\""},{"line_number":9574,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_2990efec","line":9571,"range":{"start_line":9570,"start_character":8,"end_line":9571,"end_character":71},"updated":"2019-03-27 14:24:53.000000000","message":"Same comments in the driver parent class docstring.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9567,"context_line":"        \"\"\"Power off a domain by name."},{"line_number":9568,"context_line":""},{"line_number":9569,"context_line":"        Power off a domain if we only know \u0027name\u0027 and not the full instance."},{"line_number":9570,"context_line":"        Calling this to destory instance only if the instance object is"},{"line_number":9571,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9572,"context_line":""},{"line_number":9573,"context_line":"        \"\"\""},{"line_number":9574,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_9f9fc700","line":9571,"range":{"start_line":9570,"start_character":8,"end_line":9571,"end_character":71},"in_reply_to":"5fc1f717_2990efec","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":9571,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9572,"context_line":""},{"line_number":9573,"context_line":"        \"\"\""},{"line_number":9574,"context_line":"        try:"},{"line_number":9575,"context_line":"            virt_dom \u003d self._host._get_domain_by_name(instance_name)"},{"line_number":9576,"context_line":"            try:"},{"line_number":9577,"context_line":"                (state, _max_mem, _mem, _cpus, _t) \u003d virt_dom.info()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_29a9cf22","line":9574,"updated":"2019-03-27 14:24:53.000000000","message":"This try/except block is nearly identical to the one above except for the destroy/shutdown call and the log message if there is an error, could we move this to a private method to be used by both methods to avoid all the redundant code?","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":9571,"context_line":"        NOT in the DB, The instance had been logically deleted already."},{"line_number":9572,"context_line":""},{"line_number":9573,"context_line":"        \"\"\""},{"line_number":9574,"context_line":"        try:"},{"line_number":9575,"context_line":"            virt_dom \u003d self._host._get_domain_by_name(instance_name)"},{"line_number":9576,"context_line":"            try:"},{"line_number":9577,"context_line":"                (state, _max_mem, _mem, _cpus, _t) \u003d virt_dom.info()"}],"source_content_type":"text/x-python","patch_set":10,"id":"5fc1f717_42c74497","line":9574,"in_reply_to":"5fc1f717_29a9cf22","updated":"2019-03-28 08:15:43.000000000","message":"this small code snippet is quite close coupled together...\nHow to do that for good ..\nI would like to if I know how to, postpone your this comment a little bit.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"}],"releasenotes/notes/bug-1820802-nova-orphan-instances-0169318d20b76156.yaml":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Due to `bug 1820802`_, Instances might become orphan, Nova does not"},{"line_number":5,"context_line":"    aware that instance is running on the host anymore. This fix provide"},{"line_number":6,"context_line":"    configrable actions to deal with orphan instances via configration"},{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_690fd736","line":5,"range":{"start_line":5,"start_character":56,"end_line":5,"end_character":64},"updated":"2019-03-27 14:24:53.000000000","message":"\"This fix\" is fine for a commit message but not a release note which is ready as a group without context of what \u0027this fix\u0027 is. Just say something like, \"A configuration action is now available...\".","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Due to `bug 1820802`_, Instances might become orphan, Nova does not"},{"line_number":5,"context_line":"    aware that instance is running on the host anymore. This fix provide"},{"line_number":6,"context_line":"    configrable actions to deal with orphan instances via configration"},{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_09365304","line":5,"range":{"start_line":4,"start_character":27,"end_line":5,"end_character":55},"updated":"2019-03-27 14:24:53.000000000","message":"Re-word this as something like, \"guests may be orphaned on the hypervisor on one host while the nova database says the instance is actually running on another host.\"","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Due to `bug 1820802`_, Instances might become orphan, Nova does not"},{"line_number":5,"context_line":"    aware that instance is running on the host anymore. This fix provide"},{"line_number":6,"context_line":"    configrable actions to deal with orphan instances via configration"},{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_5f695f22","line":5,"range":{"start_line":4,"start_character":27,"end_line":5,"end_character":55},"in_reply_to":"5fc1f717_09365304","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Due to `bug 1820802`_, Instances might become orphan, Nova does not"},{"line_number":5,"context_line":"    aware that instance is running on the host anymore. This fix provide"},{"line_number":6,"context_line":"    configrable actions to deal with orphan instances via configration"},{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_3f6ed32e","line":5,"range":{"start_line":5,"start_character":56,"end_line":5,"end_character":64},"in_reply_to":"5fc1f717_690fd736","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    aware that instance is running on the host anymore. This fix provide"},{"line_number":6,"context_line":"    configrable actions to deal with orphan instances via configration"},{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "},{"line_number":9,"context_line":"    - `reap` Power down and delete the instance. [default]"},{"line_number":10,"context_line":"    - `stop` Power down the instance."},{"line_number":11,"context_line":"    - `log` Log the messages only."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_46276ac8","line":8,"updated":"2019-03-27 14:24:53.000000000","message":"Need to fix these whitespaces (tabs).","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    aware that instance is running on the host anymore. This fix provide"},{"line_number":6,"context_line":"    configrable actions to deal with orphan instances via configration"},{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "},{"line_number":9,"context_line":"    - `reap` Power down and delete the instance. [default]"},{"line_number":10,"context_line":"    - `stop` Power down the instance."},{"line_number":11,"context_line":"    - `log` Log the messages only."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_1f4197a6","line":8,"in_reply_to":"5fc1f717_46276ac8","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6fa689c1e096879e927ef405b483a77fb1e9ebf","unresolved":false,"context_lines":[{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "},{"line_number":9,"context_line":"    - `reap` Power down and delete the instance. [default]"},{"line_number":10,"context_line":"    - `stop` Power down the instance."},{"line_number":11,"context_line":"    - `log` Log the messages only."},{"line_number":12,"context_line":"    - `noop` do nothing."},{"line_number":13,"context_line":"    "}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_2c1a3d6e","line":10,"range":{"start_line":10,"start_character":7,"end_line":10,"end_character":11},"updated":"2019-03-27 14:24:53.000000000","message":"This is not a valid choice, it\u0027s \u0027shutdown\u0027.","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"10f8d653f6bc846ee84b4fb770a121615ee3cb17","unresolved":false,"context_lines":[{"line_number":7,"context_line":"    `running_orphan_instance_action`:"},{"line_number":8,"context_line":"    "},{"line_number":9,"context_line":"    - `reap` Power down and delete the instance. [default]"},{"line_number":10,"context_line":"    - `stop` Power down the instance."},{"line_number":11,"context_line":"    - `log` Log the messages only."},{"line_number":12,"context_line":"    - `noop` do nothing."},{"line_number":13,"context_line":"    "}],"source_content_type":"text/x-yaml","patch_set":10,"id":"5fc1f717_ff45abb4","line":10,"range":{"start_line":10,"start_character":7,"end_line":10,"end_character":11},"in_reply_to":"5fc1f717_2c1a3d6e","updated":"2019-03-28 08:15:43.000000000","message":"Done","commit_id":"b5304e30c612fe011975be364fc10a3d5bdc2a87"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b1932ba95945cf0e63e1343c3b8d68ea9825b51","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Due to `bug 1820802`_, guests may be orphaned on the hypervisor on one"},{"line_number":5,"context_line":"    host while the nova database says the instance is actually running on"},{"line_number":6,"context_line":"    another host or not tracked this instance."},{"line_number":7,"context_line":"    A configuration action is now avaliable to deal with orphan instances"},{"line_number":8,"context_line":"    via configration `running_orphan_instance_action`:"},{"line_number":9,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":16,"id":"5fc1f717_352aef7d","line":6,"range":{"start_line":6,"start_character":20,"end_line":6,"end_character":31},"updated":"2019-04-04 13:12:22.000000000","message":"is not tracking","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"ac5ab040f70f78a077d3ec27b5885684266d45ed","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Due to `bug 1820802`_, guests may be orphaned on the hypervisor on one"},{"line_number":5,"context_line":"    host while the nova database says the instance is actually running on"},{"line_number":6,"context_line":"    another host or not tracked this instance."},{"line_number":7,"context_line":"    A configuration action is now avaliable to deal with orphan instances"},{"line_number":8,"context_line":"    via configration `running_orphan_instance_action`:"},{"line_number":9,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":16,"id":"5fc1f717_9444d7b9","line":6,"range":{"start_line":6,"start_character":20,"end_line":6,"end_character":31},"in_reply_to":"5fc1f717_352aef7d","updated":"2019-04-08 07:33:10.000000000","message":"Done","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b1932ba95945cf0e63e1343c3b8d68ea9825b51","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Due to `bug 1820802`_, guests may be orphaned on the hypervisor on one"},{"line_number":5,"context_line":"    host while the nova database says the instance is actually running on"},{"line_number":6,"context_line":"    another host or not tracked this instance."},{"line_number":7,"context_line":"    A configuration action is now avaliable to deal with orphan instances"},{"line_number":8,"context_line":"    via configration `running_orphan_instance_action`:"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"    - `reap` Power down and delete the instance."}],"source_content_type":"text/x-yaml","patch_set":16,"id":"5fc1f717_f52307a6","line":7,"range":{"start_line":7,"start_character":34,"end_line":7,"end_character":43},"updated":"2019-04-04 13:12:22.000000000","message":"available","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b1932ba95945cf0e63e1343c3b8d68ea9825b51","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Due to `bug 1820802`_, guests may be orphaned on the hypervisor on one"},{"line_number":5,"context_line":"    host while the nova database says the instance is actually running on"},{"line_number":6,"context_line":"    another host or not tracked this instance."},{"line_number":7,"context_line":"    A configuration action is now avaliable to deal with orphan instances"},{"line_number":8,"context_line":"    via configration `running_orphan_instance_action`:"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"    - `reap` Power down and delete the instance."}],"source_content_type":"text/x-yaml","patch_set":16,"id":"5fc1f717_d5204b9e","line":7,"range":{"start_line":7,"start_character":20,"end_line":7,"end_character":26},"updated":"2019-04-04 13:12:22.000000000","message":"either \"configuration option\" or \"configurable action\"","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"},{"author":{"_account_id":7543,"name":"Yongli He","email":"yongli.he@intel.com","username":"yongli.he"},"change_message_id":"ac5ab040f70f78a077d3ec27b5885684266d45ed","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Due to `bug 1820802`_, guests may be orphaned on the hypervisor on one"},{"line_number":5,"context_line":"    host while the nova database says the instance is actually running on"},{"line_number":6,"context_line":"    another host or not tracked this instance."},{"line_number":7,"context_line":"    A configuration action is now avaliable to deal with orphan instances"},{"line_number":8,"context_line":"    via configration `running_orphan_instance_action`:"},{"line_number":9,"context_line":""},{"line_number":10,"context_line":"    - `reap` Power down and delete the instance."}],"source_content_type":"text/x-yaml","patch_set":16,"id":"5fc1f717_140a2778","line":7,"range":{"start_line":7,"start_character":34,"end_line":7,"end_character":43},"in_reply_to":"5fc1f717_f52307a6","updated":"2019-04-08 07:33:10.000000000","message":"Done","commit_id":"6c0f668e4c36d69d89084521d10bcda47b34cd10"}]}
