)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3af7a4461ce08a9a080371a9bf6cf53fb819b06d","unresolved":false,"context_lines":[{"line_number":12,"context_line":"then UnableToMigrateToSelf was being raised from _prep_resize. If"},{"line_number":13,"context_line":"_reschedule_resize_or_reraise re-raises that exception, then"},{"line_number":14,"context_line":"_error_out_instance_on_exception in prep_resize handles it and"},{"line_number":15,"context_line":"sets the instance vm_state to ACTIVE. This is wrong since the"},{"line_number":16,"context_line":"instance power state is unchanged at this point and the instance"},{"line_number":17,"context_line":"is actually stopped."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This fixes the problem by wrapping UnableToMigrateToSelf in"},{"line_number":20,"context_line":"InstanceFaultRollback and raises that from _prep_resize, and"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"5fc1f717_020eaa8c","line":17,"range":{"start_line":15,"start_character":38,"end_line":17,"end_character":20},"updated":"2019-03-08 20:47:08.000000000","message":"I guess I could have pointed out that the _sync_power_states periodic task should eventually correct this by stopping the server and fixing the vm_state in the DB. But that periodic only runs every 10 minutes by default.","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"98e82799e7037a0a5e43a3ec53fea4c573711c02","unresolved":false,"context_lines":[{"line_number":27,"context_line":"case in _prep_resize so those are added here."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: I17543ecb572934ecc7d0bbc7a4ad2f537fa499bc"},{"line_number":30,"context_line":"Closes-Bug: #1811235"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fb8cfa7_a38eda24","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":20},"updated":"2019-06-19 23:59:23.000000000","message":"The fix in this patch makes sense but I\u0027m puzzled as to how it fixes the problem described in the bug report. The bug report says the instance goes into ERROR state when it fails cold migrate to same host, not ACTIVE. Or is there a mistake in the bug report?","commit_id":"d1931ac0630415519f9c3d906caba9c83cc8162a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f7d50611dc8d3a78ebb2fad4cc9976809b339b27","unresolved":false,"context_lines":[{"line_number":27,"context_line":"case in _prep_resize so those are added here."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Change-Id: I17543ecb572934ecc7d0bbc7a4ad2f537fa499bc"},{"line_number":30,"context_line":"Closes-Bug: #1811235"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9fb8cfa7_a3dc9a18","line":30,"range":{"start_line":30,"start_character":0,"end_line":30,"end_character":20},"in_reply_to":"9fb8cfa7_a38eda24","updated":"2019-06-20 00:03:54.000000000","message":"\u003e The fix in this patch makes sense but I\u0027m puzzled as to how it\n \u003e fixes the problem described in the bug report. The bug report says\n \u003e the instance goes into ERROR state when it fails cold migrate to\n \u003e same host, not ACTIVE. Or is there a mistake in the bug report?\n\nSorry, nevermind. I see now where it is explained in comment #10 on the bug.","commit_id":"d1931ac0630415519f9c3d906caba9c83cc8162a"}],"nova/compute/manager.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2c03b77f310a0331ca789e10d3762072665e151b","unresolved":false,"context_lines":[{"line_number":4275,"context_line":"        # Pass instance_state\u003dinstance.vm_state because we can resize"},{"line_number":4276,"context_line":"        # a STOPPED server and we don\u0027t want to set it back to ACTIVE"},{"line_number":4277,"context_line":"        # in case _prep_resize fails."},{"line_number":4278,"context_line":"        instance_state \u003d instance.vm_state"},{"line_number":4279,"context_line":"        with self._error_out_instance_on_exception("},{"line_number":4280,"context_line":"                context, instance, instance_state\u003dinstance_state),\\"},{"line_number":4281,"context_line":"                errors_out_migration_ctxt(migration):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5fc1f717_c591a29b","line":4278,"range":{"start_line":4278,"start_character":8,"end_line":4278,"end_character":42},"updated":"2019-03-07 23:02:52.000000000","message":"Why are you burning a variable here?","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3af7a4461ce08a9a080371a9bf6cf53fb819b06d","unresolved":false,"context_lines":[{"line_number":4275,"context_line":"        # Pass instance_state\u003dinstance.vm_state because we can resize"},{"line_number":4276,"context_line":"        # a STOPPED server and we don\u0027t want to set it back to ACTIVE"},{"line_number":4277,"context_line":"        # in case _prep_resize fails."},{"line_number":4278,"context_line":"        instance_state \u003d instance.vm_state"},{"line_number":4279,"context_line":"        with self._error_out_instance_on_exception("},{"line_number":4280,"context_line":"                context, instance, instance_state\u003dinstance_state),\\"},{"line_number":4281,"context_line":"                errors_out_migration_ctxt(migration):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5fc1f717_e2227e01","line":4278,"range":{"start_line":4278,"start_character":8,"end_line":4278,"end_character":42},"in_reply_to":"5fc1f717_c591a29b","updated":"2019-03-08 20:47:08.000000000","message":"Can\u0027t remember now, probably line length/wrapping ugliness because of the errors_out_migration_ctxt in there too.","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"af1e847cf424667d24e8071dc62cf766006b7b54","unresolved":false,"context_lines":[{"line_number":4352,"context_line":"                # prep_resize will set the instance.vm_state properly."},{"line_number":4353,"context_line":"                raise exception.InstanceFaultRollback("},{"line_number":4354,"context_line":"                    inner_exception\u003dexception.UnableToMigrateToSelf("},{"line_number":4355,"context_line":"                        instance_id\u003dinstance.uuid, host\u003dself.host))"},{"line_number":4356,"context_line":""},{"line_number":4357,"context_line":"        # NOTE(danms): Stash the new instance_type to avoid having to"},{"line_number":4358,"context_line":"        # look it up in the database later"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_e3f2929a","line":4355,"updated":"2019-06-20 00:11:07.000000000","message":"Question: if we do this and the user no longer gets an instance in ERROR state, how do they discover that their migration failed? Previously, they see instance in ERROR state and look at the instance fault message which states the migration was not successful. What will they see now?\n\nNote that the instance action API is admin-only by default.","commit_id":"d1931ac0630415519f9c3d906caba9c83cc8162a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fb52a815f474b0e569f3f7810acc378cb300148d","unresolved":false,"context_lines":[{"line_number":4352,"context_line":"                # prep_resize will set the instance.vm_state properly."},{"line_number":4353,"context_line":"                raise exception.InstanceFaultRollback("},{"line_number":4354,"context_line":"                    inner_exception\u003dexception.UnableToMigrateToSelf("},{"line_number":4355,"context_line":"                        instance_id\u003dinstance.uuid, host\u003dself.host))"},{"line_number":4356,"context_line":""},{"line_number":4357,"context_line":"        # NOTE(danms): Stash the new instance_type to avoid having to"},{"line_number":4358,"context_line":"        # look it up in the database later"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_21a41808","line":4355,"in_reply_to":"9fb8cfa7_3d5f5a42","updated":"2019-06-20 14:43:07.000000000","message":"\u003e I mention this in the bug report or another related one that we likely need a capability trait reported from the computes and use that to determine if they can support migrating on the same compute service host or not - so that only the vmware driver would work here, but that\u0027s a bigger change that likely requires a request filter and such.\n\nhttps://bugs.launchpad.net/nova/+bug/1819216/comments/1","commit_id":"d1931ac0630415519f9c3d906caba9c83cc8162a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"00b9c32e1caaf47b506dca87960c4471f16e6a71","unresolved":false,"context_lines":[{"line_number":4352,"context_line":"                # prep_resize will set the instance.vm_state properly."},{"line_number":4353,"context_line":"                raise exception.InstanceFaultRollback("},{"line_number":4354,"context_line":"                    inner_exception\u003dexception.UnableToMigrateToSelf("},{"line_number":4355,"context_line":"                        instance_id\u003dinstance.uuid, host\u003dself.host))"},{"line_number":4356,"context_line":""},{"line_number":4357,"context_line":"        # NOTE(danms): Stash the new instance_type to avoid having to"},{"line_number":4358,"context_line":"        # look it up in the database later"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_41482c86","line":4355,"in_reply_to":"9fb8cfa7_3d5f5a42","updated":"2019-06-20 15:13:25.000000000","message":"\u003e filter and such). And you correctly point out that if the instance\n \u003e is not in ERROR status the user can\u0027t see the fault to know what\n \u003e happened. Thus we would rely on instance actions, so let me address\n \u003e that...\n \u003e \n \u003e \u003e Note that the instance action API is admin-only by default.\n \u003e \n \u003e ...that\u0027s not entirely true. The owner of the server can list\n \u003e instance actions for the server. The admin-only thing is the event\n \u003e details per action but that\u0027s only true up until 2.50. Starting\n \u003e with microversion 2.51 they can also see the event details (except\n \u003e the traceback portion of an event is still admin-only by default\n \u003e policy).\n\nAh, I see. I was confused when I saw this in the code:\n\nhttps://github.com/openstack/nova/blob/c18f7f4/nova/policies/instance_actions.py#L28\n\nThanks for explaining that.\n\n \u003e Regardless of the admin-only nature of the instance action event\n \u003e details, if you fail here you\u0027re doing a cold migration, and a cold\n \u003e migration is admin-only by default, therefore I don\u0027t see a problem\n \u003e with the admin needing to check the instance action event details\n \u003e to find out why the cold migration failed since they should be able\n \u003e to do so since they\u0027re...an admin.\n\nArgh, sorry, that\u0027s a critical point that I missed. I didn\u0027t realize cold migration is admin-only by default. I think I\u0027m eternally confused by how it\u0027s different than resize -- I\u0027m used to thinking that resize \u003d\u003d cold migration.","commit_id":"d1931ac0630415519f9c3d906caba9c83cc8162a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7e13f58376fa8fae67d059a5bb08c49dafee7bbd","unresolved":false,"context_lines":[{"line_number":4352,"context_line":"                # prep_resize will set the instance.vm_state properly."},{"line_number":4353,"context_line":"                raise exception.InstanceFaultRollback("},{"line_number":4354,"context_line":"                    inner_exception\u003dexception.UnableToMigrateToSelf("},{"line_number":4355,"context_line":"                        instance_id\u003dinstance.uuid, host\u003dself.host))"},{"line_number":4356,"context_line":""},{"line_number":4357,"context_line":"        # NOTE(danms): Stash the new instance_type to avoid having to"},{"line_number":4358,"context_line":"        # look it up in the database later"}],"source_content_type":"text/x-python","patch_set":7,"id":"9fb8cfa7_3d5f5a42","line":4355,"in_reply_to":"9fb8cfa7_e3f2929a","updated":"2019-06-20 14:32:53.000000000","message":"\u003e Question: if we do this and the user no longer gets an instance in\n \u003e ERROR state, how do they discover that their migration failed?\n \u003e Previously, they see instance in ERROR state and look at the\n \u003e instance fault message which states the migration was not\n \u003e successful. What will they see now?\n\nYou\u0027re correct that the instance would go back to it\u0027s previous status of ACTIVE or STOPPED, which I\u0027m asserting with this change that is the correct behavior since we didn\u0027t actually change the power state of the guest so it shouldn\u0027t go to ERROR status just because we\u0027re being dumb and scheduling to the wrong host (I mention this in the bug report or another related one that we likely need a capability trait reported from the computes and use that to determine if they can support migrating on the same compute service host or not - so that only the vmware driver would work here, but that\u0027s a bigger change that likely requires a request filter and such). And you correctly point out that if the instance is not in ERROR status the user can\u0027t see the fault to know what happened. Thus we would rely on instance actions, so let me address that...\n\n \u003e Note that the instance action API is admin-only by default.\n\n...that\u0027s not entirely true. The owner of the server can list instance actions for the server. The admin-only thing is the event details per action but that\u0027s only true up until 2.50. Starting with microversion 2.51 they can also see the event details (except the traceback portion of an event is still admin-only by default policy).\n\nRegardless of the admin-only nature of the instance action event details, if you fail here you\u0027re doing a cold migration, and a cold migration is admin-only by default, therefore I don\u0027t see a problem with the admin needing to check the instance action event details to find out why the cold migration failed since they should be able to do so since they\u0027re...an admin.","commit_id":"d1931ac0630415519f9c3d906caba9c83cc8162a"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2c03b77f310a0331ca789e10d3762072665e151b","unresolved":false,"context_lines":[{"line_number":8387,"context_line":"        migration \u003d mock.MagicMock(spec\u003d\u0027nova.objects.Migration\u0027)"},{"line_number":8388,"context_line":"        with mock.patch.dict(self.compute.driver.capabilities,"},{"line_number":8389,"context_line":"                             {\u0027supports_migrate_to_same_host\u0027: False}):"},{"line_number":8390,"context_line":"            ex \u003d self.assertRaises("},{"line_number":8391,"context_line":"                exception.InstanceFaultRollback, self.compute._prep_resize,"},{"line_number":8392,"context_line":"                self.context, instance.image_meta, instance, instance.flavor,"},{"line_number":8393,"context_line":"                filter_properties\u003d{}, node\u003dinstance.node, migration\u003dmigration)"},{"line_number":8394,"context_line":"        self.assertIsInstance("}],"source_content_type":"text/x-python","patch_set":5,"id":"5fc1f717_251d060f","line":8391,"range":{"start_line":8390,"start_character":17,"end_line":8391,"end_character":47},"updated":"2019-03-07 23:02:52.000000000","message":"✔","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2c03b77f310a0331ca789e10d3762072665e151b","unresolved":false,"context_lines":[{"line_number":8427,"context_line":"            fake_reschedule_resize_or_reraise)"},{"line_number":8428,"context_line":""},{"line_number":8429,"context_line":"        with mock.patch.object(self.compute, \u0027_prep_resize\u0027, side_effect\u003dex):"},{"line_number":8430,"context_line":"            self.assertRaises("},{"line_number":8431,"context_line":"                # _error_out_instance_on_exception should reraise the"},{"line_number":8432,"context_line":"                # UnableToMigrateToSelf inside InstanceFaultRollback."},{"line_number":8433,"context_line":"                exception.UnableToMigrateToSelf, self.compute.prep_resize,"},{"line_number":8434,"context_line":"                self.context, instance.image_meta, instance, instance.flavor,"},{"line_number":8435,"context_line":"                request_spec, filter_properties\u003d{}, node\u003dinstance.node,"},{"line_number":8436,"context_line":"                clean_shutdown\u003dTrue, migration\u003dmigration, host_list\u003d[])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5fc1f717_85d39a38","line":8433,"range":{"start_line":8430,"start_character":12,"end_line":8433,"end_character":47},"updated":"2019-03-07 23:02:52.000000000","message":"✔","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2c03b77f310a0331ca789e10d3762072665e151b","unresolved":false,"context_lines":[{"line_number":8436,"context_line":"                clean_shutdown\u003dTrue, migration\u003dmigration, host_list\u003d[])"},{"line_number":8437,"context_line":"        # The instance.vm_state should remain unchanged"},{"line_number":8438,"context_line":"        # (_error_out_instance_on_exception will set to ACTIVE by default)."},{"line_number":8439,"context_line":"        self.assertEqual(vm_states.STOPPED, instance.vm_state)"},{"line_number":8440,"context_line":""},{"line_number":8441,"context_line":""},{"line_number":8442,"context_line":"class ComputeManagerInstanceUsageAuditTestCase(test.TestCase):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5fc1f717_45ddb240","line":8439,"range":{"start_line":8439,"start_character":8,"end_line":8439,"end_character":62},"updated":"2019-03-07 23:02:52.000000000","message":"✔","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"}],"nova/tests/unit/fake_instance.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"2c03b77f310a0331ca789e10d3762072665e151b","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            inst.vcpus \u003d flavor.vcpus"},{"line_number":133,"context_line":"        if \u0027memory_mb\u0027 in flavor and \u0027memory_mb\u0027 not in updates:"},{"line_number":134,"context_line":"            inst.memory_mb \u003d flavor.memory_mb"},{"line_number":135,"context_line":"        if (\u0027instance_type_id\u0027 not in inst or inst.instance_type_id is None"},{"line_number":136,"context_line":"                and \u0027id\u0027 in flavor):"},{"line_number":137,"context_line":"            inst.instance_type_id \u003d flavor.id"},{"line_number":138,"context_line":"    inst.old_flavor \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"5fc1f717_05e7aa14","line":135,"updated":"2019-03-07 23:02:52.000000000","message":"?","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3af7a4461ce08a9a080371a9bf6cf53fb819b06d","unresolved":false,"context_lines":[{"line_number":132,"context_line":"            inst.vcpus \u003d flavor.vcpus"},{"line_number":133,"context_line":"        if \u0027memory_mb\u0027 in flavor and \u0027memory_mb\u0027 not in updates:"},{"line_number":134,"context_line":"            inst.memory_mb \u003d flavor.memory_mb"},{"line_number":135,"context_line":"        if (\u0027instance_type_id\u0027 not in inst or inst.instance_type_id is None"},{"line_number":136,"context_line":"                and \u0027id\u0027 in flavor):"},{"line_number":137,"context_line":"            inst.instance_type_id \u003d flavor.id"},{"line_number":138,"context_line":"    inst.old_flavor \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"5fc1f717_427912fa","line":135,"in_reply_to":"5fc1f717_05e7aa14","updated":"2019-03-08 20:47:08.000000000","message":"Because of the instance.instance_type_id check here:\n\nhttps://review.openstack.org/#/c/633227/5/nova/compute/manager.py@4192","commit_id":"6f079eddc007261240c3238e05afe4516dc17971"}]}
