)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8effb3490047f029ab51e230fa381cbd679af3d8","unresolved":true,"context_lines":[{"line_number":7,"context_line":"Improve instance shutdown logic for graceful shutdown"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Nova\u0027s instance shutdown logic prematurely interpreted the \u0027in shutdown\u0027"},{"line_number":10,"context_line":"state as \u0027shutdown successful\u0027, interfering with the graceful shutdown"},{"line_number":11,"context_line":"process. This caused issues especially for VMs using PCI passthrough,"},{"line_number":12,"context_line":"instances with large memory (TB scale), or in scenarios where OS startup"},{"line_number":13,"context_line":"was not complete before a stop request."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"33fc86c4_93b35f6f","line":10,"updated":"2024-12-17 08:13:42.000000000","message":"What are the libvirt power states returned to nova for \"in shutdown\" and for \"shutdown successful\" in you case?","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"},{"author":{"_account_id":37469,"name":"DongHun, Kim","display_name":"DongHun, Kim","email":"bigheadzacky@gmail.com","username":"donghunkimzack"},"change_message_id":"e3651c59afb130f7d61d6962f1b2fcbe79e80ce7","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Improve instance shutdown logic for graceful shutdown"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Nova\u0027s instance shutdown logic prematurely interpreted the \u0027in shutdown\u0027"},{"line_number":10,"context_line":"state as \u0027shutdown successful\u0027, interfering with the graceful shutdown"},{"line_number":11,"context_line":"process. This caused issues especially for VMs using PCI passthrough,"},{"line_number":12,"context_line":"instances with large memory (TB scale), or in scenarios where OS startup"},{"line_number":13,"context_line":"was not complete before a stop request."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"6fc4e007_a07c166d","line":10,"in_reply_to":"33fc86c4_93b35f6f","updated":"2024-12-17 08:54:01.000000000","message":"Libvirt considers both the \u0027in shutdown\u0027 state and the completely powered off \u0027shut off\u0027 state as shutdown. It treats the \u0027in shutdown\u0027 state, where the system is still in the process of shutting down, the same as \u0027shut off\u0027. This leads to returning a \u0027shutdown successfully\u0027 message along with a \u0027return true\u0027, even when the shutdown process is not yet complete.\n\nThe relevant part of the LIBVIRT_POWER_STATE mapping is as follows:\n\"\nLIBVIRT_POWER_STATE \u003d {\n    # The libvirt API doc says that DOMAIN_SHUTDOWN means the domain\n    # is being shut down. So technically the domain is still\n    # running. SHUTOFF is the real powered off state.  But we will map\n    # both to SHUTDOWN anyway.\n    VIR_DOMAIN_SHUTDOWN: power_state.SHUTDOWN,\n    VIR_DOMAIN_SHUTOFF: power_state.SHUTDOWN,\n}\n\"\nThis mapping shows that both VIR_DOMAIN_SHUTDOWN (which represents the \u0027in shutdown\u0027 state) and VIR_DOMAIN_SHUTOFF (which represents the fully powered off state) are mapped to power_state.SHUTDOWN in Nova. This is the root cause of the issue we\u0027re addressing.","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8effb3490047f029ab51e230fa381cbd679af3d8","unresolved":true,"context_lines":[{"line_number":12,"context_line":"instances with large memory (TB scale), or in scenarios where OS startup"},{"line_number":13,"context_line":"was not complete before a stop request."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"- Add domain ID check to verify complete shut off before initiating destroy"},{"line_number":16,"context_line":"- Ensure proper clean shutdown in various scenarios"},{"line_number":17,"context_line":"- Improve robustness of shutdown process across different configurations"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"df600863_b59361f7","line":15,"updated":"2024-12-17 08:13:42.000000000","message":"how does checking the domain ID helps distinguishing between the two states?","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"},{"author":{"_account_id":37469,"name":"DongHun, Kim","display_name":"DongHun, Kim","email":"bigheadzacky@gmail.com","username":"donghunkimzack"},"change_message_id":"e3651c59afb130f7d61d6962f1b2fcbe79e80ce7","unresolved":false,"context_lines":[{"line_number":12,"context_line":"instances with large memory (TB scale), or in scenarios where OS startup"},{"line_number":13,"context_line":"was not complete before a stop request."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"- Add domain ID check to verify complete shut off before initiating destroy"},{"line_number":16,"context_line":"- Ensure proper clean shutdown in various scenarios"},{"line_number":17,"context_line":"- Improve robustness of shutdown process across different configurations"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1f04ad63_b03d929e","line":15,"in_reply_to":"df600863_b59361f7","updated":"2024-12-17 08:54:01.000000000","message":"For a running domain or a domain in the process of shutting down (VIR_DOMAIN_SHUTDOWN), the domain ID is a positive integer.\nex) 1  instnace-0000111a  running\n    2  instance-0000112a  in shutdown\n\nFor a domain that has successfully shut off (VIR_DOMAIN_SHUTOFF), the domain ID is -1.\n\nex) -  instance-0000112a  shut off","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8effb3490047f029ab51e230fa381cbd679af3d8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"72d0fc8a_30cc49dd","updated":"2024-12-17 08:13:42.000000000","message":"I have a couple question inline to better understand the scenario","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"},{"author":{"_account_id":37469,"name":"DongHun, Kim","display_name":"DongHun, Kim","email":"bigheadzacky@gmail.com","username":"donghunkimzack"},"change_message_id":"e3651c59afb130f7d61d6962f1b2fcbe79e80ce7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d73ec2c7_5e8d61b8","in_reply_to":"72d0fc8a_30cc49dd","updated":"2024-12-17 08:54:01.000000000","message":"I have answered all of your questions. Thank you for your inquiries.","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8effb3490047f029ab51e230fa381cbd679af3d8","unresolved":true,"context_lines":[{"line_number":4272,"context_line":""},{"line_number":4273,"context_line":"            # Add ID check to ensure complete shut off"},{"line_number":4274,"context_line":"            # before initiating destroy operation"},{"line_number":4275,"context_line":"            if old_domid !\u003d new_domid and state in SHUTDOWN_STATES:"},{"line_number":4276,"context_line":"                LOG.info(\"Instance shutdown successfully after %d seconds.\","},{"line_number":4277,"context_line":"                         sec, instance\u003dinstance)"},{"line_number":4278,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"83d53277_f843073c","line":4275,"range":{"start_line":4275,"start_character":15,"end_line":4275,"end_character":37},"updated":"2024-12-17 08:13:42.000000000","message":"why the domain id changes during shutdown?","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"},{"author":{"_account_id":37469,"name":"DongHun, Kim","display_name":"DongHun, Kim","email":"bigheadzacky@gmail.com","username":"donghunkimzack"},"change_message_id":"e3651c59afb130f7d61d6962f1b2fcbe79e80ce7","unresolved":false,"context_lines":[{"line_number":4272,"context_line":""},{"line_number":4273,"context_line":"            # Add ID check to ensure complete shut off"},{"line_number":4274,"context_line":"            # before initiating destroy operation"},{"line_number":4275,"context_line":"            if old_domid !\u003d new_domid and state in SHUTDOWN_STATES:"},{"line_number":4276,"context_line":"                LOG.info(\"Instance shutdown successfully after %d seconds.\","},{"line_number":4277,"context_line":"                         sec, instance\u003dinstance)"},{"line_number":4278,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":1,"id":"b7a14f2b_3308b4df","line":4275,"range":{"start_line":4275,"start_character":15,"end_line":4275,"end_character":37},"in_reply_to":"83d53277_f843073c","updated":"2024-12-17 08:54:01.000000000","message":"The _soft_reboot method in the same file uses the same approach of checking the domain ID to distinguish between shutdown states. By leveraging the domain ID change from a positive integer to -1, you can reliably identify when a domain has fully shut off, ensuring accurate control of the shutdown and reboot processes.","commit_id":"88fe9889e8938dfb2b3e6f6c219522debd2e4fcb"}]}
