)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":4004,"context_line":""},{"line_number":4005,"context_line":"    def _prep_resize(self, context, image, instance, instance_type,"},{"line_number":4006,"context_line":"            filter_properties, node, migration, clean_shutdown\u003dTrue,"},{"line_number":4007,"context_line":"            host_list\u003dNone):"},{"line_number":4008,"context_line":""},{"line_number":4009,"context_line":"        if not filter_properties:"},{"line_number":4010,"context_line":"            filter_properties \u003d {}"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_9fd4d821","line":4007,"updated":"2018-01-09 16:26:20.000000000","message":"This isn\u0027t necessary, and you\u0027re not even passing anything into this from prep_resize.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":4004,"context_line":""},{"line_number":4005,"context_line":"    def _prep_resize(self, context, image, instance, instance_type,"},{"line_number":4006,"context_line":"            filter_properties, node, migration, clean_shutdown\u003dTrue,"},{"line_number":4007,"context_line":"            host_list\u003dNone):"},{"line_number":4008,"context_line":""},{"line_number":4009,"context_line":"        if not filter_properties:"},{"line_number":4010,"context_line":"            filter_properties \u003d {}"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_d0fa4f41","line":4007,"in_reply_to":"9f91af0f_9fd4d821","updated":"2018-01-09 18:52:14.000000000","message":"Yeah, I found that out with the functional test I wrote. But as you point out below, it isn\u0027t needed, so I\u0027ll remove it.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":4041,"context_line":"            # RPC cast to the source host to start the actual resize/migration."},{"line_number":4042,"context_line":"            self.compute_rpcapi.resize_instance("},{"line_number":4043,"context_line":"                    context, instance, claim.migration, image,"},{"line_number":4044,"context_line":"                    instance_type, clean_shutdown, host_list)"},{"line_number":4045,"context_line":""},{"line_number":4046,"context_line":"    @wrap_exception()"},{"line_number":4047,"context_line":"    @reverts_task_state"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_5f25f05a","line":4044,"range":{"start_line":4044,"start_character":51,"end_line":4044,"end_character":60},"updated":"2018-01-09 16:26:20.000000000","message":"Why do we need to pass this to the source node? host_list should only be needed for reschedules which are triggered from prep_resize on the destination node.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":4041,"context_line":"            # RPC cast to the source host to start the actual resize/migration."},{"line_number":4042,"context_line":"            self.compute_rpcapi.resize_instance("},{"line_number":4043,"context_line":"                    context, instance, claim.migration, image,"},{"line_number":4044,"context_line":"                    instance_type, clean_shutdown, host_list)"},{"line_number":4045,"context_line":""},{"line_number":4046,"context_line":"    @wrap_exception()"},{"line_number":4047,"context_line":"    @reverts_task_state"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_cbb5c233","line":4044,"range":{"start_line":4044,"start_character":51,"end_line":4044,"end_character":60},"in_reply_to":"9f91af0f_5f25f05a","updated":"2018-01-09 18:52:14.000000000","message":"ok, removed","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":4111,"context_line":"                    extra_usage_info\u003dextra_usage_info)"},{"line_number":4112,"context_line":""},{"line_number":4113,"context_line":"    def _reschedule_resize_or_reraise(self, context, image, instance, exc_info,"},{"line_number":4114,"context_line":"            instance_type, request_spec, filter_properties, host_list):"},{"line_number":4115,"context_line":"        \"\"\"Try to re-schedule the resize or re-raise the original error to"},{"line_number":4116,"context_line":"        error out the instance."},{"line_number":4117,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_1fe8c8df","line":4114,"range":{"start_line":4114,"start_character":60,"end_line":4114,"end_character":69},"updated":"2018-01-09 16:26:20.000000000","message":"nit: default to None?","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":4111,"context_line":"                    extra_usage_info\u003dextra_usage_info)"},{"line_number":4112,"context_line":""},{"line_number":4113,"context_line":"    def _reschedule_resize_or_reraise(self, context, image, instance, exc_info,"},{"line_number":4114,"context_line":"            instance_type, request_spec, filter_properties, host_list):"},{"line_number":4115,"context_line":"        \"\"\"Try to re-schedule the resize or re-raise the original error to"},{"line_number":4116,"context_line":"        error out the instance."},{"line_number":4117,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_8b381aa0","line":4114,"range":{"start_line":4114,"start_character":60,"end_line":4114,"end_character":69},"in_reply_to":"9f91af0f_1fe8c8df","updated":"2018-01-09 18:52:14.000000000","message":"This is a private method, only called from the method above (and a few tests). I\u0027ve updated them all to pass a value for this param.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":4168,"context_line":"    @wrap_instance_fault"},{"line_number":4169,"context_line":"    def resize_instance(self, context, instance, image,"},{"line_number":4170,"context_line":"                        reservations, migration, instance_type,"},{"line_number":4171,"context_line":"                        clean_shutdown, host_list):"},{"line_number":4172,"context_line":"        \"\"\"Starts the migration of a running instance to another host."},{"line_number":4173,"context_line":""},{"line_number":4174,"context_line":"        This is initiated from the destination host\u0027s ``prep_resize`` routine"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_3fceec81","line":4171,"range":{"start_line":4171,"start_character":40,"end_line":4171,"end_character":49},"updated":"2018-01-09 16:26:20.000000000","message":"This is not necessary, and not the \"resize_instance\" method you want - this is the compute resize_instance, but we need to pass host_list to the conductor task API \"resize_instance\" which you\u0027re done on L4133.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":4168,"context_line":"    @wrap_instance_fault"},{"line_number":4169,"context_line":"    def resize_instance(self, context, instance, image,"},{"line_number":4170,"context_line":"                        reservations, migration, instance_type,"},{"line_number":4171,"context_line":"                        clean_shutdown, host_list):"},{"line_number":4172,"context_line":"        \"\"\"Starts the migration of a running instance to another host."},{"line_number":4173,"context_line":""},{"line_number":4174,"context_line":"        This is initiated from the destination host\u0027s ``prep_resize`` routine"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_ab3dde8f","line":4171,"range":{"start_line":4171,"start_character":40,"end_line":4171,"end_character":49},"in_reply_to":"9f91af0f_3fceec81","updated":"2018-01-09 18:52:14.000000000","message":"Done","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aa9d4aa080b6e569c81b117a7357680e732ee5b6","unresolved":false,"context_lines":[{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":"    def _reschedule(self, context, request_spec, filter_properties,"},{"line_number":1332,"context_line":"            instance, reschedule_method, method_args, task_state,"},{"line_number":1333,"context_line":"            exc_info\u003dNone, host_list\u003dNone):"},{"line_number":1334,"context_line":"        \"\"\"Attempt to re-schedule a compute operation.\"\"\""},{"line_number":1335,"context_line":""},{"line_number":1336,"context_line":"        instance_uuid \u003d instance.uuid"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_6b8f6dcc","line":1333,"range":{"start_line":1333,"start_character":27,"end_line":1333,"end_character":41},"updated":"2018-01-11 19:28:10.000000000","message":"Add a method_kwargs instead, see below.","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"94240ea033f46242a33466784fe22fe44caba7e5","unresolved":false,"context_lines":[{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":"    def _reschedule(self, context, request_spec, filter_properties,"},{"line_number":1332,"context_line":"            instance, reschedule_method, method_args, task_state,"},{"line_number":1333,"context_line":"            exc_info\u003dNone, host_list\u003dNone):"},{"line_number":1334,"context_line":"        \"\"\"Attempt to re-schedule a compute operation.\"\"\""},{"line_number":1335,"context_line":""},{"line_number":1336,"context_line":"        instance_uuid \u003d instance.uuid"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_97f9ba81","line":1333,"range":{"start_line":1333,"start_character":27,"end_line":1333,"end_character":41},"in_reply_to":"7f96bb07_6b8f6dcc","updated":"2018-01-12 19:11:51.000000000","message":"This is a private method, called from only one place. We don\u0027t need to do that here.","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aa9d4aa080b6e569c81b117a7357680e732ee5b6","unresolved":false,"context_lines":[{"line_number":1358,"context_line":"            retry[\u0027exc\u0027] \u003d traceback.format_exception_only(exc_info[0],"},{"line_number":1359,"context_line":"                                    exc_info[1])"},{"line_number":1360,"context_line":""},{"line_number":1361,"context_line":"        reschedule_method(context, *method_args, host_list\u003dhost_list)"},{"line_number":1362,"context_line":"        return True"},{"line_number":1363,"context_line":""},{"line_number":1364,"context_line":"    @periodic_task.periodic_task"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_cb9ec106","line":1361,"updated":"2018-01-11 19:28:10.000000000","message":"Hmm, this is a generic method, and if this method that we\u0027re calling doesn\u0027t have a host_list kwarg, it\u0027s going to blow up. But I suppose you couldn\u0027t use method_args without specifying the other args in between which are:\n\nreservations\u003dNone, clean_shutdown\u003dTrue, request_spec\u003dNone,\n\nWhy not pass this as **method_kwargs so we don\u0027t assume that the called method has host_list as a kwarg?","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"94240ea033f46242a33466784fe22fe44caba7e5","unresolved":false,"context_lines":[{"line_number":1358,"context_line":"            retry[\u0027exc\u0027] \u003d traceback.format_exception_only(exc_info[0],"},{"line_number":1359,"context_line":"                                    exc_info[1])"},{"line_number":1360,"context_line":""},{"line_number":1361,"context_line":"        reschedule_method(context, *method_args, host_list\u003dhost_list)"},{"line_number":1362,"context_line":"        return True"},{"line_number":1363,"context_line":""},{"line_number":1364,"context_line":"    @periodic_task.periodic_task"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_d75bc284","line":1361,"in_reply_to":"7f96bb07_cb9ec106","updated":"2018-01-12 19:11:51.000000000","message":"It *looks* like a generic method, but it is only ever one method: self.compute_task_api.resize_instance. This is set on L4126. There are no other places that call _reschedule(). It would be cleaner to just call it directly here instead of passing it in and making the code look like it\u0027s generic.","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aa9d4aa080b6e569c81b117a7357680e732ee5b6","unresolved":false,"context_lines":[{"line_number":4003,"context_line":"        return True"},{"line_number":4004,"context_line":""},{"line_number":4005,"context_line":"    def _prep_resize(self, context, image, instance, instance_type,"},{"line_number":4006,"context_line":"            filter_properties, node, migration, clean_shutdown\u003dTrue):"},{"line_number":4007,"context_line":""},{"line_number":4008,"context_line":"        if not filter_properties:"},{"line_number":4009,"context_line":"            filter_properties \u003d {}"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_f65b642b","line":4006,"updated":"2018-01-11 19:28:10.000000000","message":"rebase booboo","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"94240ea033f46242a33466784fe22fe44caba7e5","unresolved":false,"context_lines":[{"line_number":4003,"context_line":"        return True"},{"line_number":4004,"context_line":""},{"line_number":4005,"context_line":"    def _prep_resize(self, context, image, instance, instance_type,"},{"line_number":4006,"context_line":"            filter_properties, node, migration, clean_shutdown\u003dTrue):"},{"line_number":4007,"context_line":""},{"line_number":4008,"context_line":"        if not filter_properties:"},{"line_number":4009,"context_line":"            filter_properties \u003d {}"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_f7eefe86","line":4006,"in_reply_to":"7f96bb07_f65b642b","updated":"2018-01-12 19:11:51.000000000","message":"Done","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"}],"nova/compute/rpcapi.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        * 4.19 - build_and_run_instance() now gets a \u0027host_list\u0027 parameter"},{"line_number":338,"context_line":"                 representing potential alternate hosts for retries within a"},{"line_number":339,"context_line":"                 cell."},{"line_number":340,"context_line":"        * 4.20 - resize_instance() now gets a \u0027host_list\u0027 parameter"},{"line_number":341,"context_line":"                 representing potential alternate hosts for retries within a"},{"line_number":342,"context_line":"                 cell."},{"line_number":343,"context_line":"    \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_ffc3a455","line":340,"range":{"start_line":340,"start_character":17,"end_line":340,"end_character":32},"updated":"2018-01-09 16:26:20.000000000","message":"The compute resize_instance method doesn\u0027t need host_list, just prep_resize.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        * 4.19 - build_and_run_instance() now gets a \u0027host_list\u0027 parameter"},{"line_number":338,"context_line":"                 representing potential alternate hosts for retries within a"},{"line_number":339,"context_line":"                 cell."},{"line_number":340,"context_line":"        * 4.20 - resize_instance() now gets a \u0027host_list\u0027 parameter"},{"line_number":341,"context_line":"                 representing potential alternate hosts for retries within a"},{"line_number":342,"context_line":"                 cell."},{"line_number":343,"context_line":"    \u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_6b435614","line":340,"range":{"start_line":340,"start_character":17,"end_line":340,"end_character":32},"in_reply_to":"9f91af0f_ffc3a455","updated":"2018-01-09 18:52:14.000000000","message":"Done","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":889,"context_line":""},{"line_number":890,"context_line":"    # TODO(melwitt): Remove the reservations parameter in version 5.0 of the"},{"line_number":891,"context_line":"    # RPC API."},{"line_number":892,"context_line":"    def resize_instance(self, ctxt, instance, migration, image, instance_type,"},{"line_number":893,"context_line":"            reservations\u003dNone, clean_shutdown\u003dTrue, host_list\u003dNone):"},{"line_number":894,"context_line":"        msg_args \u003d {\u0027instance\u0027: instance, \u0027migration\u0027: migration,"},{"line_number":895,"context_line":"                    \u0027image\u0027: image, \u0027reservations\u0027: reservations,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_3f934c5d","line":892,"updated":"2018-01-09 16:26:20.000000000","message":"Don\u0027t need the changes to this method.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":889,"context_line":""},{"line_number":890,"context_line":"    # TODO(melwitt): Remove the reservations parameter in version 5.0 of the"},{"line_number":891,"context_line":"    # RPC API."},{"line_number":892,"context_line":"    def resize_instance(self, ctxt, instance, migration, image, instance_type,"},{"line_number":893,"context_line":"            reservations\u003dNone, clean_shutdown\u003dTrue, host_list\u003dNone):"},{"line_number":894,"context_line":"        msg_args \u003d {\u0027instance\u0027: instance, \u0027migration\u0027: migration,"},{"line_number":895,"context_line":"                    \u0027image\u0027: image, \u0027reservations\u0027: reservations,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_0b4c0a40","line":892,"in_reply_to":"9f91af0f_3f934c5d","updated":"2018-01-09 18:52:14.000000000","message":"Done","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"}],"nova/conductor/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":288,"context_line":"            raise NotImplementedError()"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def _cold_migrate(self, context, instance, flavor, filter_properties,"},{"line_number":291,"context_line":"                      reservations, clean_shutdown, request_spec, host_list):"},{"line_number":292,"context_line":"        image \u003d utils.get_image_from_system_metadata("},{"line_number":293,"context_line":"            instance.system_metadata)"},{"line_number":294,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_dfc26034","line":291,"range":{"start_line":291,"start_character":66,"end_line":291,"end_character":75},"updated":"2018-01-09 16:26:20.000000000","message":"nit: default to None?","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":288,"context_line":"            raise NotImplementedError()"},{"line_number":289,"context_line":""},{"line_number":290,"context_line":"    def _cold_migrate(self, context, instance, flavor, filter_properties,"},{"line_number":291,"context_line":"                      reservations, clean_shutdown, request_spec, host_list):"},{"line_number":292,"context_line":"        image \u003d utils.get_image_from_system_metadata("},{"line_number":293,"context_line":"            instance.system_metadata)"},{"line_number":294,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_2bf78ed5","line":291,"range":{"start_line":291,"start_character":66,"end_line":291,"end_character":75},"in_reply_to":"9f91af0f_dfc26034","updated":"2018-01-09 18:52:14.000000000","message":"This is a private method, and all calls to it have been updated to pass a value for the param.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":463,"context_line":"                                              request_spec)"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"    def _build_cold_migrate_task(self, context, instance, flavor, request_spec,"},{"line_number":466,"context_line":"            reservations, clean_shutdown, host_list):"},{"line_number":467,"context_line":"        return migrate.MigrationTask(context, instance, flavor,"},{"line_number":468,"context_line":"                                     request_spec,"},{"line_number":469,"context_line":"                                     reservations, clean_shutdown,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_ffbf24a7","line":466,"range":{"start_line":466,"start_character":42,"end_line":466,"end_character":51},"updated":"2018-01-09 16:26:20.000000000","message":"default to None?","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":463,"context_line":"                                              request_spec)"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"    def _build_cold_migrate_task(self, context, instance, flavor, request_spec,"},{"line_number":466,"context_line":"            reservations, clean_shutdown, host_list):"},{"line_number":467,"context_line":"        return migrate.MigrationTask(context, instance, flavor,"},{"line_number":468,"context_line":"                                     request_spec,"},{"line_number":469,"context_line":"                                     reservations, clean_shutdown,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_ebfc46b6","line":466,"range":{"start_line":466,"start_character":42,"end_line":466,"end_character":51},"in_reply_to":"9f91af0f_ffbf24a7","updated":"2018-01-09 18:52:14.000000000","message":"See above","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"}],"nova/conductor/rpcapi.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7bd05932cb07323d31bf7cfc246a9925106dbff9","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    1.19 - build_instances() now gets a \u0027host_lists\u0027 parameter that represents"},{"line_number":279,"context_line":"           potential alternate hosts for retries within a cell for each"},{"line_number":280,"context_line":"           instance."},{"line_number":281,"context_line":"    1.19 - migrate_server() now gets a \u0027host_list\u0027 parameter that represents"},{"line_number":282,"context_line":"           potential alternate hosts for retries within a cell."},{"line_number":283,"context_line":"    \"\"\""},{"line_number":284,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"bf8cb3f7_8c2bcf2e","line":281,"range":{"start_line":281,"start_character":4,"end_line":281,"end_character":8},"updated":"2017-12-24 12:25:21.000000000","message":"1.20?","commit_id":"94841ca0b526d5aab96e4e965396a9ebd01a9c7d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"ac45facc36b9883d9fc656eb94a53c176e41f1c0","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    1.19 - build_instances() now gets a \u0027host_lists\u0027 parameter that represents"},{"line_number":279,"context_line":"           potential alternate hosts for retries within a cell for each"},{"line_number":280,"context_line":"           instance."},{"line_number":281,"context_line":"    1.19 - migrate_server() now gets a \u0027host_list\u0027 parameter that represents"},{"line_number":282,"context_line":"           potential alternate hosts for retries within a cell."},{"line_number":283,"context_line":"    \"\"\""},{"line_number":284,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"9f91af0f_b89e2405","line":281,"range":{"start_line":281,"start_character":4,"end_line":281,"end_character":8},"in_reply_to":"bf8cb3f7_8c2bcf2e","updated":"2018-01-03 22:00:55.000000000","message":"Heh, the 1.18 change snuck in on me. Fixed.","commit_id":"94841ca0b526d5aab96e4e965396a9ebd01a9c7d"}],"nova/conductor/tasks/migrate.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi"},{"line_number":121,"context_line":"        self.scheduler_client \u003d scheduler_client"},{"line_number":122,"context_line":"        self.host_list \u003d host_list"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # Persist things from the happy path so we don\u0027t have to look"},{"line_number":125,"context_line":"        # them up if we need to roll back"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_7fe9d4b4","line":122,"updated":"2018-01-09 16:26:20.000000000","message":"nit: would be nice to have a comment describing that this is and how it\u0027s used - is it a list of lists of Selection objects?","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.compute_rpcapi \u003d compute_rpcapi"},{"line_number":121,"context_line":"        self.scheduler_client \u003d scheduler_client"},{"line_number":122,"context_line":"        self.host_list \u003d host_list"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        # Persist things from the happy path so we don\u0027t have to look"},{"line_number":125,"context_line":"        # them up if we need to roll back"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_8bd49a21","line":122,"in_reply_to":"9f91af0f_7fe9d4b4","updated":"2018-01-09 18:52:14.000000000","message":"It is singular, so it is a single list of Selection objects. A comment on what it is and how it is used would be better where it\u0027s used, so I\u0027ll add it there.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        migration \u003d self._preallocate_migration()"},{"line_number":199,"context_line":"        self.request_spec.ensure_project_id(self.instance)"},{"line_number":200,"context_line":"        if self.host_list:"},{"line_number":201,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":202,"context_line":"        else:"},{"line_number":203,"context_line":"            selection_lists \u003d self.scheduler_client.select_destinations("},{"line_number":204,"context_line":"                    self.context, self.request_spec, [self.instance.uuid],"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_7f10f4a8","line":201,"updated":"2018-01-09 16:26:20.000000000","message":"OK so this is a reschedule from the compute and we need to look for another alternate.\n\nWhat if we\u0027ve exhausted alternates and host_list is empty not because it\u0027s the first time from the API before we\u0027ve tried any computes? We don\u0027t want to call select_destinations again.\n\nI think the answer is that scheduler_utils.populate_retry above will have already raised MaxRetriesExceeded if we\u0027ve exhausted our host_list.\n\nMight be good to leave some comments here explaining that.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        migration \u003d self._preallocate_migration()"},{"line_number":199,"context_line":"        self.request_spec.ensure_project_id(self.instance)"},{"line_number":200,"context_line":"        if self.host_list:"},{"line_number":201,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":202,"context_line":"        else:"},{"line_number":203,"context_line":"            selection_lists \u003d self.scheduler_client.select_destinations("},{"line_number":204,"context_line":"                    self.context, self.request_spec, [self.instance.uuid],"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_abe39ed8","line":201,"in_reply_to":"9f91af0f_7f10f4a8","updated":"2018-01-09 18:52:14.000000000","message":"Yeah, this was one of the places where I found a bug in the code. If fewer alternates than max_attempts are returned, we could run out of alternates before the populate_retry would kick in. I have a fix and a test for it coming. I\u0027ve also added comments explaining the logic.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            selection_list \u003d selection_lists[0]"},{"line_number":209,"context_line":"            # The selected host is the first item in the list, with the"},{"line_number":210,"context_line":"            # alternates being the remainder of the list."},{"line_number":211,"context_line":"            selection, self.host_list \u003d selection_list[0], selection_list[1:]"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        scheduler_utils.populate_filter_properties(legacy_props, selection)"},{"line_number":214,"context_line":"        # context is not serializable"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_5fce502d","line":211,"range":{"start_line":211,"start_character":59,"end_line":211,"end_character":77},"updated":"2018-01-09 16:26:20.000000000","message":"This assumes there is an alternate, correct? But this could be an IndexError if we only have one host to try.","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            selection_list \u003d selection_lists[0]"},{"line_number":209,"context_line":"            # The selected host is the first item in the list, with the"},{"line_number":210,"context_line":"            # alternates being the remainder of the list."},{"line_number":211,"context_line":"            selection, self.host_list \u003d selection_list[0], selection_list[1:]"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        scheduler_utils.populate_filter_properties(legacy_props, selection)"},{"line_number":214,"context_line":"        # context is not serializable"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_8b96daef","line":211,"range":{"start_line":211,"start_character":59,"end_line":211,"end_character":77},"in_reply_to":"9f91af0f_5fce502d","updated":"2018-01-09 18:52:14.000000000","message":"Nope: http://paste.openstack.org/show/641456/","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b50a77a4c1b9df95e942d2bc05ec973407660ee9","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            selection_list \u003d selection_lists[0]"},{"line_number":209,"context_line":"            # The selected host is the first item in the list, with the"},{"line_number":210,"context_line":"            # alternates being the remainder of the list."},{"line_number":211,"context_line":"            selection, self.host_list \u003d selection_list[0], selection_list[1:]"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":"        scheduler_utils.populate_filter_properties(legacy_props, selection)"},{"line_number":214,"context_line":"        # context is not serializable"}],"source_content_type":"text/x-python","patch_set":21,"id":"7f96bb07_cb5b2185","line":211,"range":{"start_line":211,"start_character":59,"end_line":211,"end_character":77},"in_reply_to":"9f91af0f_8b96daef","updated":"2018-01-11 19:09:46.000000000","message":"touche, this was easier for me to read:\n\n\u003e\u003e\u003e host_list \u003d [\u0027host\u0027]\n\u003e\u003e\u003e selection, new_list \u003d host_list[0], host_list[1:]\n\u003e\u003e\u003e selection\n\u0027host\u0027\n\u003e\u003e\u003e new_list\n[]","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        # tl;dr: datetimes in dicts are not accepted as correct values by the"},{"line_number":226,"context_line":"        # rpc fake driver."},{"line_number":227,"context_line":"        legacy_spec \u003d jsonutils.loads(jsonutils.dumps(legacy_spec))"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # RPC cast to the destination host to start the migration process."},{"line_number":230,"context_line":"        self.compute_rpcapi.prep_resize("},{"line_number":231,"context_line":"            self.context, self.instance, legacy_spec[\u0027image\u0027],"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_1f40c8a4","line":228,"updated":"2018-01-09 16:26:20.000000000","message":"Might be nice to log the selected host and the current alternates like you do in the server build flow:\n\nhttps://github.com/openstack/nova/blob/cf33de28b15bb445d34bbdda1897130812e3b5c5/nova/conductor/manager.py#L696","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":225,"context_line":"        # tl;dr: datetimes in dicts are not accepted as correct values by the"},{"line_number":226,"context_line":"        # rpc fake driver."},{"line_number":227,"context_line":"        legacy_spec \u003d jsonutils.loads(jsonutils.dumps(legacy_spec))"},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # RPC cast to the destination host to start the migration process."},{"line_number":230,"context_line":"        self.compute_rpcapi.prep_resize("},{"line_number":231,"context_line":"            self.context, self.instance, legacy_spec[\u0027image\u0027],"}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_cb56222b","line":228,"in_reply_to":"9f91af0f_1f40c8a4","updated":"2018-01-09 18:52:14.000000000","message":"Done","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"720dcf4bd9de77f5fa795f65cbe19e1896593dc8","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        migration.source_node \u003d self.instance.node"},{"line_number":143,"context_line":"        migration.migration_type \u003d (self.instance.flavor.id !\u003d self.flavor.id"},{"line_number":144,"context_line":"                                    and \u0027resize\u0027 or \u0027migration\u0027)"},{"line_number":145,"context_line":"        migration.create()"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        self._migration \u003d migration"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_6cd0e0f8","line":145,"updated":"2018-01-11 22:58:44.000000000","message":"If we\u0027re rescheduling, we shouldn\u0027t recreate this. The compute won\u0027t sent it back up over RPC either, but if we\u0027re rescheduling we should be able to just pull this out of the database, which I think we could do with MigrationList.get_in_progress_by_instance(self.context, self.instance.uuid, migration_type).\n\nWe should only be able to have one in-progress migration for the same instance at a time...","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"94240ea033f46242a33466784fe22fe44caba7e5","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        migration.source_node \u003d self.instance.node"},{"line_number":143,"context_line":"        migration.migration_type \u003d (self.instance.flavor.id !\u003d self.flavor.id"},{"line_number":144,"context_line":"                                    and \u0027resize\u0027 or \u0027migration\u0027)"},{"line_number":145,"context_line":"        migration.create()"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        self._migration \u003d migration"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_f09268f6","line":145,"in_reply_to":"7f96bb07_6cd0e0f8","updated":"2018-01-12 19:11:51.000000000","message":"Done","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"521fa7ed0e3d58d5317347a33a155a9346c52b38","unresolved":false,"context_lines":[{"line_number":142,"context_line":"        migration.source_node \u003d self.instance.node"},{"line_number":143,"context_line":"        migration.migration_type \u003d (self.instance.flavor.id !\u003d self.flavor.id"},{"line_number":144,"context_line":"                                    and \u0027resize\u0027 or \u0027migration\u0027)"},{"line_number":145,"context_line":"        migration.create()"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        self._migration \u003d migration"},{"line_number":148,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_9f56b006","line":145,"in_reply_to":"7f96bb07_6cd0e0f8","updated":"2018-01-11 23:21:34.000000000","message":"So we want the migration record to hold the source node allocation that the instance is currently holding.\n\nOn the first pass when we hit the scheduler, the scheduler will \u0027double up\u0027 the instance allocation to the chosen dest host. Then in here, we\u0027re moving the instance source node allocation to this migration record and leaving the dest node allocation that the instance holds to be associated with the instance.\n\nIf the resize fails in the compute, we reverse that (delete the allocation that the migration consumer is holding on the source node and adds it back to the instance so the instance allocations are \u0027doubled up\u0027 on the source and dest nodes).\n\nThat happens in the compute here:\n\nhttps://review.openstack.org/#/c/526436/22/nova/compute/manager.py@4086\n\nBefore we cast back to conductor to try the next alternate host.\n\nWhen we get back into the migrate task, the migration record already exists and we know if we\u0027re doing a reschedule because self.host_list will not be None (per the logic below).\n\nAt that point we need to again move the source node allocation from the instance to the migration record, but for the reschedule, we need to move the instance\u0027s original dest node allocation from the failed node (which would be in filter_properties[\u0027retry\u0027][\u0027hosts\u0027] (or on the migration record because of the move_claim in compute: https://review.openstack.org/#/c/526436/22/nova/compute/resource_tracker.py@383 ) to the alternate node.","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aa9d4aa080b6e569c81b117a7357680e732ee5b6","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            # If all the alternates have been exhausted, self.host_list will be"},{"line_number":219,"context_line":"            # empty. We need to raise a NoValidHost exception in that case."},{"line_number":220,"context_line":"            if not self.host_list:"},{"line_number":221,"context_line":"                reason \u003d (\"Unable to find a suitable destination for instance \""},{"line_number":222,"context_line":"                          \"%(instance_uuid)s\" %"},{"line_number":223,"context_line":"                          {\"instance_uuid\": self.instance.uuid})"},{"line_number":224,"context_line":"                raise exception.NoValidHost(reason\u003dreason)"},{"line_number":225,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        scheduler_utils.populate_filter_properties(legacy_props, selection)"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_2b364505","line":224,"range":{"start_line":221,"start_character":16,"end_line":224,"end_character":58},"updated":"2018-01-11 19:28:10.000000000","message":"Might consider using something similar to what we have in build_instances when we run out of alternates:\n\nhttps://github.com/openstack/nova/blob/master/nova/conductor/manager.py#L576-L579","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"94240ea033f46242a33466784fe22fe44caba7e5","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            # If all the alternates have been exhausted, self.host_list will be"},{"line_number":219,"context_line":"            # empty. We need to raise a NoValidHost exception in that case."},{"line_number":220,"context_line":"            if not self.host_list:"},{"line_number":221,"context_line":"                reason \u003d (\"Unable to find a suitable destination for instance \""},{"line_number":222,"context_line":"                          \"%(instance_uuid)s\" %"},{"line_number":223,"context_line":"                          {\"instance_uuid\": self.instance.uuid})"},{"line_number":224,"context_line":"                raise exception.NoValidHost(reason\u003dreason)"},{"line_number":225,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        scheduler_utils.populate_filter_properties(legacy_props, selection)"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_5759f257","line":224,"range":{"start_line":221,"start_character":16,"end_line":224,"end_character":58},"in_reply_to":"7f96bb07_2b364505","updated":"2018-01-12 19:11:51.000000000","message":"Done","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aa9d4aa080b6e569c81b117a7357680e732ee5b6","unresolved":false,"context_lines":[{"line_number":222,"context_line":"                          \"%(instance_uuid)s\" %"},{"line_number":223,"context_line":"                          {\"instance_uuid\": self.instance.uuid})"},{"line_number":224,"context_line":"                raise exception.NoValidHost(reason\u003dreason)"},{"line_number":225,"context_line":"            selection \u003d self.host_list.pop(0)"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"        scheduler_utils.populate_filter_properties(legacy_props, selection)"},{"line_number":228,"context_line":"        # context is not serializable"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_164db071","line":225,"updated":"2018-01-11 19:28:10.000000000","message":"You need to attempt to claim resources on the alternate host right?\n\nhttps://github.com/openstack/nova/blob/master/nova/conductor/manager.py#L627\n\nDoes that need to be done as part of replace_allocation_with_migration?","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6762685e8a75a92bf4937ecbd80ea175f80f3bb7","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        migration_type \u003d (\"resize\" if self.instance.flavor.id !\u003d self.flavor.id"},{"line_number":139,"context_line":"                else \"migration\")"},{"line_number":140,"context_line":"        filters \u003d {\"instance_uuid\": self.instance.uuid, \"type\": migration_type}"},{"line_number":141,"context_line":"        migrations \u003d objects.MigrationList.get_by_filters(self.context,"},{"line_number":142,"context_line":"                filters).objects"},{"line_number":143,"context_line":"        if migrations:"},{"line_number":144,"context_line":"            migration \u003d migrations[0]"}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_80b2afe5","line":141,"range":{"start_line":141,"start_character":43,"end_line":141,"end_character":57},"updated":"2018-01-12 21:08:32.000000000","message":"This need to be the in_progress method I think, otherwise you can get any completed migrations of the same type that ever ran on this instance, which would be wrong.","commit_id":"f3ae47864c8374700842450177fcdb5401e2e937"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"85b60df7f23ab1eeafc35dccc14eb0fa69b3b6ca","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        migration_type \u003d (\"resize\" if self.instance.flavor.id !\u003d self.flavor.id"},{"line_number":139,"context_line":"                else \"migration\")"},{"line_number":140,"context_line":"        filters \u003d {\"instance_uuid\": self.instance.uuid, \"type\": migration_type}"},{"line_number":141,"context_line":"        migrations \u003d objects.MigrationList.get_by_filters(self.context,"},{"line_number":142,"context_line":"                filters).objects"},{"line_number":143,"context_line":"        if migrations:"},{"line_number":144,"context_line":"            migration \u003d migrations[0]"}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_400ee73b","line":141,"range":{"start_line":141,"start_character":43,"end_line":141,"end_character":57},"in_reply_to":"7f96bb07_80b2afe5","updated":"2018-01-12 22:15:15.000000000","message":"I added a \"status\" filter for \"pre-migrating\".","commit_id":"f3ae47864c8374700842450177fcdb5401e2e937"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6762685e8a75a92bf4937ecbd80ea175f80f3bb7","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            self.request_spec.requested_destination \u003d objects.Destination("},{"line_number":205,"context_line":"                cell\u003dinstance_mapping.cell_mapping)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        migration \u003d self._preallocate_migration()"},{"line_number":208,"context_line":"        self.request_spec.ensure_project_id(self.instance)"},{"line_number":209,"context_line":"        # On an initial call to migrate, \u0027self.host_list\u0027 will be None, so we"},{"line_number":210,"context_line":"        # have to call the scheduler to get a list of acceptable hosts to"}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_00dbff1a","line":207,"range":{"start_line":207,"start_character":25,"end_line":207,"end_character":47},"updated":"2018-01-12 21:08:32.000000000","message":"So once we\u0027re done here, we\u0027ve moved the source node allocation from the instance to the migration record, and the instance has an allocation on the previously attempted (or first to be attempted) dest node.","commit_id":"f3ae47864c8374700842450177fcdb5401e2e937"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6762685e8a75a92bf4937ecbd80ea175f80f3bb7","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                else:"},{"line_number":240,"context_line":"                    alloc_req \u003d None"},{"line_number":241,"context_line":"                if alloc_req:"},{"line_number":242,"context_line":"                    host_available \u003d scheduler_utils.claim_resources("},{"line_number":243,"context_line":"                            elevated, self.reportclient, self.request_spec,"},{"line_number":244,"context_line":"                            self.instance.uuid, alloc_req,"},{"line_number":245,"context_line":"                            selection.allocation_request_version)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_c02bd7e8","line":242,"updated":"2018-01-12 21:08:32.000000000","message":"This will claim allocations for the instance consumer on the alternate host, however, we still have the original allocation on the previously attempted dest node, and that would need to be removed (or swapped to the alternate host). The swap is preferable if you can use that swap method in the report client.","commit_id":"f3ae47864c8374700842450177fcdb5401e2e937"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1e2ace52a66499b13b07d5f0fe7a0a3b9f45cf8c","unresolved":false,"context_lines":[{"line_number":239,"context_line":"                else:"},{"line_number":240,"context_line":"                    alloc_req \u003d None"},{"line_number":241,"context_line":"                if alloc_req:"},{"line_number":242,"context_line":"                    host_available \u003d scheduler_utils.claim_resources("},{"line_number":243,"context_line":"                            elevated, self.reportclient, self.request_spec,"},{"line_number":244,"context_line":"                            self.instance.uuid, alloc_req,"},{"line_number":245,"context_line":"                            selection.allocation_request_version)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_b6fff5ff","line":242,"in_reply_to":"7f96bb07_c02bd7e8","updated":"2018-01-12 22:27:32.000000000","message":"As discussed in IRC, before we cast from compute to conductor to reschedule, the compute runs _revert_allocation() to remove the allocation for the source node held by the migration record, and deletes the allocation for the instance on the destination node, and moves the source node allocation back to the instance. When _preallocate_migration() runs here, we move the source node allocation to the migration record and then this code claims the alternate host allocation by the instance.\n\nNow, that does leave a window of time where the migration record holds the source node allocation but the instance doesn\u0027t hold any allocation, so I think we should probably do this claim_resources call for the instance *before* we call _preallocate_migration, right? Then the instance has the alternate host allocated and the migration record gets the source node allocation and we\u0027re one big happy family.\n\nMaybe ask Dan though for a 2nd opinion.\n\nAlso, would be good to have some comments in here reminding us about how this flow all works.","commit_id":"f3ae47864c8374700842450177fcdb5401e2e937"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1e2ace52a66499b13b07d5f0fe7a0a3b9f45cf8c","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        filters \u003d {\"instance_uuid\": self.instance.uuid,"},{"line_number":141,"context_line":"                   \"type\": migration_type,"},{"line_number":142,"context_line":"                   \"status\": \"pre-migrating\"}"},{"line_number":143,"context_line":"        migrations \u003d objects.MigrationList.get_by_filters(self.context,"},{"line_number":144,"context_line":"                filters).objects"},{"line_number":145,"context_line":"        if migrations:"},{"line_number":146,"context_line":"            migration \u003d migrations[0]"}],"source_content_type":"text/x-python","patch_set":24,"id":"7f96bb07_332537c3","line":143,"updated":"2018-01-12 22:27:32.000000000","message":"Your test should probably make sure that we only ever have 1 migration record for this instance by the time it\u0027s done.","commit_id":"92cf95088fd79e371205ee96b9d465050d909052"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6b68a92e0e809b1a6282b2c1a06cd2c123741966","unresolved":false,"context_lines":[{"line_number":140,"context_line":"        filters \u003d {\"instance_uuid\": self.instance.uuid,"},{"line_number":141,"context_line":"                   \"type\": migration_type,"},{"line_number":142,"context_line":"                   \"status\": \"pre-migrating\"}"},{"line_number":143,"context_line":"        migrations \u003d objects.MigrationList.get_by_filters(self.context,"},{"line_number":144,"context_line":"                filters).objects"},{"line_number":145,"context_line":"        if migrations:"},{"line_number":146,"context_line":"            migration \u003d migrations[0]"}],"source_content_type":"text/x-python","patch_set":24,"id":"7f96bb07_d63161a4","line":143,"in_reply_to":"7f96bb07_332537c3","updated":"2018-01-12 22:45:25.000000000","message":"Done","commit_id":"92cf95088fd79e371205ee96b9d465050d909052"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9cf8e3256223d92af880181bedf2ab5e4c254b81","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                   \"type\": migration_type,"},{"line_number":142,"context_line":"                   \"status\": \"pre-migrating\"}"},{"line_number":143,"context_line":"        migrations \u003d objects.MigrationList.get_by_filters(self.context,"},{"line_number":144,"context_line":"                filters).objects"},{"line_number":145,"context_line":"        if migrations:"},{"line_number":146,"context_line":"            migration \u003d migrations[0]"},{"line_number":147,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":26,"id":"7f96bb07_e6deb63c","line":144,"range":{"start_line":144,"start_character":24,"end_line":144,"end_character":32},"updated":"2018-01-17 16:49:34.000000000","message":"this isn\u0027t necessary, since the MigrationList implements iterable","commit_id":"48af0121a0a958a8ddc9dffd2ddd43b73f2ab5a2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b053548c5d6d648962d0f357fb27f89296ff032","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        migration_type \u003d (\"resize\" if self.instance.flavor.id !\u003d self.flavor.id"},{"line_number":139,"context_line":"                else \"migration\")"},{"line_number":140,"context_line":"        filters \u003d {\"instance_uuid\": self.instance.uuid,"},{"line_number":141,"context_line":"                   \"type\": migration_type,"},{"line_number":142,"context_line":"                   \"status\": \"pre-migrating\"}"},{"line_number":143,"context_line":"        migrations \u003d objects.MigrationList.get_by_filters(self.context,"},{"line_number":144,"context_line":"                filters).objects"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_e182a300","line":141,"range":{"start_line":141,"start_character":20,"end_line":141,"end_character":24},"updated":"2018-01-22 17:02:47.000000000","message":"This isn\u0027t a valid filter, it should be \"migration_type\":\n\nhttps://github.com/openstack/nova/blob/a40c00957ef4552681c172913bae1135a1614bbc/nova/db/sqlalchemy/api.py#L4428","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6bf5c48935b6ec075cf532604021536c685d51ae","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        migration_type \u003d (\"resize\" if self.instance.flavor.id !\u003d self.flavor.id"},{"line_number":139,"context_line":"                else \"migration\")"},{"line_number":140,"context_line":"        filters \u003d {\"instance_uuid\": self.instance.uuid,"},{"line_number":141,"context_line":"                   \"type\": migration_type,"},{"line_number":142,"context_line":"                   \"status\": \"pre-migrating\"}"},{"line_number":143,"context_line":"        migrations \u003d objects.MigrationList.get_by_filters(self.context,"},{"line_number":144,"context_line":"                filters).objects"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_3ca514b6","line":141,"range":{"start_line":141,"start_character":20,"end_line":141,"end_character":24},"in_reply_to":"7f96bb07_e182a300","updated":"2018-01-22 19:56:31.000000000","message":"Done","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b053548c5d6d648962d0f357fb27f89296ff032","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            self.request_spec.requested_destination \u003d objects.Destination("},{"line_number":207,"context_line":"                cell\u003dinstance_mapping.cell_mapping)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        migration \u003d self._preallocate_migration()"},{"line_number":210,"context_line":"        self.request_spec.ensure_project_id(self.instance)"},{"line_number":211,"context_line":"        # On an initial call to migrate, \u0027self.host_list\u0027 will be None, so we"},{"line_number":212,"context_line":"        # have to call the scheduler to get a list of acceptable hosts to"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_21e88b14","line":209,"range":{"start_line":209,"start_character":25,"end_line":209,"end_character":47},"updated":"2018-01-22 17:02:47.000000000","message":"OK once this is done, the source node allocation is moved from the instance consumer to the migration record consumer, and the instance consumer doesn\u0027t have any allocations. If this is the first time through here (not a reschedule), select_destinations below will allocate resources on the selected destination node for the instance consumer. If we\u0027re rescheduling, host_list is not None and we\u0027ll call claim_resources for the instance and the selected alternate.\n\nIf we exhaust our alternates and raise MaxRetriesExceeded, the rollback() method should revert the allocation swaparoo and move the source node allocation from the migration record back to the instance record.","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6bf5c48935b6ec075cf532604021536c685d51ae","unresolved":false,"context_lines":[{"line_number":206,"context_line":"            self.request_spec.requested_destination \u003d objects.Destination("},{"line_number":207,"context_line":"                cell\u003dinstance_mapping.cell_mapping)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"        migration \u003d self._preallocate_migration()"},{"line_number":210,"context_line":"        self.request_spec.ensure_project_id(self.instance)"},{"line_number":211,"context_line":"        # On an initial call to migrate, \u0027self.host_list\u0027 will be None, so we"},{"line_number":212,"context_line":"        # have to call the scheduler to get a list of acceptable hosts to"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_fc86ccdb","line":209,"range":{"start_line":209,"start_character":25,"end_line":209,"end_character":47},"in_reply_to":"7f96bb07_21e88b14","updated":"2018-01-22 19:56:31.000000000","message":"I added your comments as a comment in the code.","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b053548c5d6d648962d0f357fb27f89296ff032","unresolved":false,"context_lines":[{"line_number":247,"context_line":"                            elevated, self.reportclient, self.request_spec,"},{"line_number":248,"context_line":"                            self.instance.uuid, alloc_req,"},{"line_number":249,"context_line":"                            selection.allocation_request_version)"},{"line_number":250,"context_line":"                else:"},{"line_number":251,"context_line":"                    # Some deployments use different schedulers that do not"},{"line_number":252,"context_line":"                    # use Placement, so they will not have an"},{"line_number":253,"context_line":"                    # allocation_request to claim with. For those cases,"},{"line_number":254,"context_line":"                    # there is no concept of claiming, so just assume that"},{"line_number":255,"context_line":"                    # the host is valid."},{"line_number":256,"context_line":"                    host_available \u003d True"},{"line_number":257,"context_line":"            # There are no more available hosts. Raise a MaxRetriesExceeded"},{"line_number":258,"context_line":"            # exception in that case."},{"line_number":259,"context_line":"            if not host_available:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_6158d355","line":256,"range":{"start_line":250,"start_character":16,"end_line":256,"end_character":41},"updated":"2018-01-22 17:02:47.000000000","message":"As far as I can tell, you don\u0027t have a test case for this scenario.","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d3babbf8fe3d87c4e8708e7e4f9c95b994c1ebc4","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                            elevated, self.reportclient, self.request_spec,"},{"line_number":260,"context_line":"                            self.instance.uuid, alloc_req,"},{"line_number":261,"context_line":"                            selection.allocation_request_version)"},{"line_number":262,"context_line":"                else:"},{"line_number":263,"context_line":"                    # Some deployments use different schedulers that do not"},{"line_number":264,"context_line":"                    # use Placement, so they will not have an"},{"line_number":265,"context_line":"                    # allocation_request to claim with. For those cases,"},{"line_number":266,"context_line":"                    # there is no concept of claiming, so just assume that"},{"line_number":267,"context_line":"                    # the host is valid."},{"line_number":268,"context_line":"                    host_available \u003d True"},{"line_number":269,"context_line":"            # There are no more available hosts. Raise a MaxRetriesExceeded"},{"line_number":270,"context_line":"            # exception in that case."},{"line_number":271,"context_line":"            if not host_available:"}],"source_content_type":"text/x-python","patch_set":28,"id":"7f96bb07_c45aeb4e","line":268,"range":{"start_line":262,"start_character":16,"end_line":268,"end_character":41},"updated":"2018-01-23 18:48:29.000000000","message":"Still missing a unit test for this but I guess we could build that on top, I don\u0027t really want to keep delaying this.","commit_id":"941b309154c1f6b595d6d7824f0f708ba18a4e90"}],"nova/objects/service.py":[{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"3d433e42e1be370c257a26582eb07d8f8a98bf4a","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"# NOTE(danms): This is the global service version counter"},{"line_number":34,"context_line":"SERVICE_VERSION \u003d 26"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"# NOTE(danms): This is our SERVICE_VERSION history. The idea is that any"}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_03b49c34","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":20},"updated":"2017-12-13 11:34:43.000000000","message":"SERVICE_VERSION \u003d 27\n\nnova.tests.unit.objects.test_service.TestServiceVersion.test_version check this.","commit_id":"adedc84e2c6161528229b38a9f375040bd61cf83"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"3d433e42e1be370c257a26582eb07d8f8a98bf4a","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    {\u0027compute_rpc\u0027: \u00274.18\u0027},"},{"line_number":123,"context_line":"    # Version 26: Adds a \u0027host_list\u0027 parameter to build_and_run_instance()"},{"line_number":124,"context_line":"    {\u0027compute_rpc\u0027: \u00274.19\u0027},"},{"line_number":125,"context_line":"    # Version 26: Adds a \u0027host_list\u0027 parameter to resize_instance()"},{"line_number":126,"context_line":"    {\u0027compute_rpc\u0027: \u00274.20\u0027},"},{"line_number":127,"context_line":")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"df87a7cf_633fa887","line":125,"range":{"start_line":125,"start_character":14,"end_line":125,"end_character":16},"updated":"2017-12-13 11:34:43.000000000","message":"nit: 27?","commit_id":"adedc84e2c6161528229b38a9f375040bd61cf83"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"dca43ae316009e1fefc49ba5c0d4b15f74b35fd0","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    {\u0027compute_rpc\u0027: \u00274.18\u0027},"},{"line_number":123,"context_line":"    # Version 26: Adds a \u0027host_list\u0027 parameter to build_and_run_instance()"},{"line_number":124,"context_line":"    {\u0027compute_rpc\u0027: \u00274.19\u0027},"},{"line_number":125,"context_line":"    # Version 27: Adds a \u0027host_list\u0027 parameter to resize_instance()"},{"line_number":126,"context_line":"    {\u0027compute_rpc\u0027: \u00274.20\u0027},"},{"line_number":127,"context_line":")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_1f052846","line":125,"range":{"start_line":125,"start_character":50,"end_line":125,"end_character":65},"updated":"2018-01-09 16:26:20.000000000","message":"prep_resize","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"945b2ca17a7e87717b1c53717f29c233dff4e9ba","unresolved":false,"context_lines":[{"line_number":122,"context_line":"    {\u0027compute_rpc\u0027: \u00274.18\u0027},"},{"line_number":123,"context_line":"    # Version 26: Adds a \u0027host_list\u0027 parameter to build_and_run_instance()"},{"line_number":124,"context_line":"    {\u0027compute_rpc\u0027: \u00274.19\u0027},"},{"line_number":125,"context_line":"    # Version 27: Adds a \u0027host_list\u0027 parameter to resize_instance()"},{"line_number":126,"context_line":"    {\u0027compute_rpc\u0027: \u00274.20\u0027},"},{"line_number":127,"context_line":")"},{"line_number":128,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9f91af0f_ab207ead","line":125,"range":{"start_line":125,"start_character":50,"end_line":125,"end_character":65},"in_reply_to":"9f91af0f_1f052846","updated":"2018-01-09 18:52:14.000000000","message":"Done","commit_id":"057ed722cd6fe943f1f21bce2ba41f4882fa4ff4"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aa9d4aa080b6e569c81b117a7357680e732ee5b6","unresolved":false,"context_lines":[{"line_number":2701,"context_line":"        # allocation which just leaves us with the original flavor."},{"line_number":2702,"context_line":"        self.assertFlavorMatchesAllocation(self.flavor1, source_usages)"},{"line_number":2703,"context_line":""},{"line_number":2704,"context_line":"    def _test_resize_reschedule_uses_host_lists(self, fails, num_alts\u003dNone):"},{"line_number":2705,"context_line":"        \"\"\"Test that when a resize attempt fails, the retry comes from the"},{"line_number":2706,"context_line":"        supplied host_list, and does not call the scheduler."},{"line_number":2707,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_b6707c74","line":2704,"range":{"start_line":2704,"start_character":8,"end_line":2704,"end_character":47},"updated":"2018-01-11 19:28:10.000000000","message":"If you\u0027re going to put your functional test in something that\u0027s using the ProviderUsagesMixin, it would be good to do some of the same types of resource provider allocation assertions that the other tests do, like between reschedules, asserting that the allocations on the correct consumers and providers, especially because I don\u0027t think we\u0027re properly claiming resources on the alternate hosts yet in the change.","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"94240ea033f46242a33466784fe22fe44caba7e5","unresolved":false,"context_lines":[{"line_number":2701,"context_line":"        # allocation which just leaves us with the original flavor."},{"line_number":2702,"context_line":"        self.assertFlavorMatchesAllocation(self.flavor1, source_usages)"},{"line_number":2703,"context_line":""},{"line_number":2704,"context_line":"    def _test_resize_reschedule_uses_host_lists(self, fails, num_alts\u003dNone):"},{"line_number":2705,"context_line":"        \"\"\"Test that when a resize attempt fails, the retry comes from the"},{"line_number":2706,"context_line":"        supplied host_list, and does not call the scheduler."},{"line_number":2707,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_a576e0a3","line":2704,"range":{"start_line":2704,"start_character":8,"end_line":2704,"end_character":47},"in_reply_to":"7f96bb07_b6707c74","updated":"2018-01-12 19:11:51.000000000","message":"Done","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"da70860258b78d0b1253cc56545655ba88957392","unresolved":false,"context_lines":[{"line_number":2769,"context_line":"            if num_alts \u003c fails:"},{"line_number":2770,"context_line":"                # We will run out of alternates before populate_retry will"},{"line_number":2771,"context_line":"                # raise a MaxRetriesExceeded exception, so the migration will"},{"line_number":2772,"context_line":"                # fail and the server should be in status \"ERRROR\""},{"line_number":2773,"context_line":"                server \u003d self._wait_for_state_change(self.api, created_server,"},{"line_number":2774,"context_line":"                        \"ERROR\")"},{"line_number":2775,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_522604ba","line":2772,"range":{"start_line":2772,"start_character":62,"end_line":2772,"end_character":63},"updated":"2018-01-10 17:58:06.000000000","message":"oops","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eee3c45ca2d453eb1292903c318f3f84558df799","unresolved":false,"context_lines":[{"line_number":2792,"context_line":"        if num_alts:"},{"line_number":2793,"context_line":"            selections \u003d selections[:num_alts + 1]"},{"line_number":2794,"context_line":"        sqc \u003d scheduler_query_client.SchedulerQueryClient"},{"line_number":2795,"context_line":"        with mock.patch.object(sqc, \"select_destinations\") as mock_seldest:"},{"line_number":2796,"context_line":"            mock_seldest.return_value \u003d [selections]"},{"line_number":2797,"context_line":"            server_uuid \u003d server[\"id\"]"},{"line_number":2798,"context_line":"            data \u003d {\"resize\": {\"flavorRef\": self.flavor2[\"id\"]}}"}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_f31b4f18","line":2795,"updated":"2018-01-12 21:47:48.000000000","message":"We shouldn\u0027t be stubbing this out in a functional test. Are you doing this for a predictable alternate host sort order or something? If so, just add a weigher that will weigh the hosts in the order you want - there are other functional tests that do something like that.","commit_id":"f3ae47864c8374700842450177fcdb5401e2e937"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"85b60df7f23ab1eeafc35dccc14eb0fa69b3b6ca","unresolved":false,"context_lines":[{"line_number":2792,"context_line":"        if num_alts:"},{"line_number":2793,"context_line":"            selections \u003d selections[:num_alts + 1]"},{"line_number":2794,"context_line":"        sqc \u003d scheduler_query_client.SchedulerQueryClient"},{"line_number":2795,"context_line":"        with mock.patch.object(sqc, \"select_destinations\") as mock_seldest:"},{"line_number":2796,"context_line":"            mock_seldest.return_value \u003d [selections]"},{"line_number":2797,"context_line":"            server_uuid \u003d server[\"id\"]"},{"line_number":2798,"context_line":"            data \u003d {\"resize\": {\"flavorRef\": self.flavor2[\"id\"]}}"}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_73b2dfe8","line":2795,"in_reply_to":"7f96bb07_f31b4f18","updated":"2018-01-12 22:15:15.000000000","message":"Since this test is designed to verify that the new behavior of using alternate hosts is working correctly, one of the important aspects is that when reschedules occur, select_destinations() should not be called. If the host_list was not being passed correctly, then the code in MigrationTask would call it again. The mock is the only way I know to verify that select_destinations is called only once.","commit_id":"f3ae47864c8374700842450177fcdb5401e2e937"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9cf8e3256223d92af880181bedf2ab5e4c254b81","unresolved":false,"context_lines":[{"line_number":2826,"context_line":"                dest_usages \u003d self._get_provider_usages(uuid_dest)"},{"line_number":2827,"context_line":"                # The usage should match the resized flavor"},{"line_number":2828,"context_line":"                self.assertFlavorMatchesAllocation(self.flavor2, dest_usages)"},{"line_number":2829,"context_line":"                # Verify that the other host have no allocations"},{"line_number":2830,"context_line":"                target_uuids \u003d (uuid_sel, uuid_alt1, uuid_alt2, uuid_alt3)"},{"line_number":2831,"context_line":"                empty_usage \u003d {\"VCPU\": 0, \"MEMORY_MB\": 0, \"DISK_GB\": 0}"},{"line_number":2832,"context_line":"                for target_uuid in target_uuids:"}],"source_content_type":"text/x-python","patch_set":26,"id":"7f96bb07_0c7c23ea","line":2829,"range":{"start_line":2829,"start_character":40,"end_line":2829,"end_character":44},"updated":"2018-01-17 16:49:34.000000000","message":"hosts","commit_id":"48af0121a0a958a8ddc9dffd2ddd43b73f2ab5a2"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9cf8e3256223d92af880181bedf2ab5e4c254b81","unresolved":false,"context_lines":[{"line_number":2842,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":2843,"context_line":"            filters \u003d {\"instance_uuid\": server[\"id\"]}"},{"line_number":2844,"context_line":"            migrations \u003d objects.MigrationList.get_by_filters(ctxt, filters)"},{"line_number":2845,"context_line":"            self.assertEqual(1, len(migrations.objects))"},{"line_number":2846,"context_line":""},{"line_number":2847,"context_line":"    def test_resize_reschedule_uses_host_lists_1_fail(self):"},{"line_number":2848,"context_line":"        self._test_resize_reschedule_uses_host_lists(fails\u003d1)"}],"source_content_type":"text/x-python","patch_set":26,"id":"7f96bb07_2cf6bf64","line":2845,"updated":"2018-01-17 16:49:34.000000000","message":"tests are ok. would prefer actually less de-duplication into the _test_resize_reschedule_uses_host_lists() method since I find the introduction of conditionals in the \"helper\" method just leads to a greater surface area for bugs in the tests and actually makes tests harder to read. but meh :)","commit_id":"48af0121a0a958a8ddc9dffd2ddd43b73f2ab5a2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b053548c5d6d648962d0f357fb27f89296ff032","unresolved":false,"context_lines":[{"line_number":2784,"context_line":"        # Yes this isn\u0027t great in a functional test, but it\u0027s simple."},{"line_number":2785,"context_line":"        self.stub_out(\"nova.compute.manager.ComputeManager._prep_resize\","},{"line_number":2786,"context_line":"                      fake_prep_resize)"},{"line_number":2787,"context_line":"        # This is also not ideal in a functional test, but it assures that we"},{"line_number":2788,"context_line":"        # get a known set of computes for the selected/alternates."},{"line_number":2789,"context_line":"        selections \u003d [obj_sel, obj_alt1, obj_alt2, obj_alt3]"},{"line_number":2790,"context_line":"        # Trim this to the number of selected alternates, if requested"},{"line_number":2791,"context_line":"        num_alts \u003d 4 if num_alts is None else num_alts"},{"line_number":2792,"context_line":"        if num_alts:"},{"line_number":2793,"context_line":"            selections \u003d selections[:num_alts + 1]"},{"line_number":2794,"context_line":"        sqc \u003d scheduler_query_client.SchedulerQueryClient"},{"line_number":2795,"context_line":"        with mock.patch.object(sqc, \"select_destinations\") as mock_seldest:"},{"line_number":2796,"context_line":"            mock_seldest.return_value \u003d [selections]"},{"line_number":2797,"context_line":"            server_uuid \u003d server[\"id\"]"},{"line_number":2798,"context_line":"            data \u003d {\"resize\": {\"flavorRef\": self.flavor2[\"id\"]}}"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_a1b01b8d","line":2795,"range":{"start_line":2787,"start_character":8,"end_line":2795,"end_character":75},"updated":"2018-01-22 17:02:47.000000000","message":"I still don\u0027t like this, and not sure why it\u0027s necessary. We should be able to control the number of alternates based on the number of computes created in the test, and can use a custom weigher to make a predictable selected dest ordering. This also makes the functional test rigid to the point that it assumes a FilterScheduler behavior, and can\u0027t be extended to test the scenario that we\u0027re using the CachingScheduler where there won\u0027t be allocation requests to Placement. I won\u0027t block this change on it, but it seems like something we should fix in a follow up so we\u0027re not having false positives at some point b/c we mocked out the scheduler code in a functional test.","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6bf5c48935b6ec075cf532604021536c685d51ae","unresolved":false,"context_lines":[{"line_number":2784,"context_line":"        # Yes this isn\u0027t great in a functional test, but it\u0027s simple."},{"line_number":2785,"context_line":"        self.stub_out(\"nova.compute.manager.ComputeManager._prep_resize\","},{"line_number":2786,"context_line":"                      fake_prep_resize)"},{"line_number":2787,"context_line":"        # This is also not ideal in a functional test, but it assures that we"},{"line_number":2788,"context_line":"        # get a known set of computes for the selected/alternates."},{"line_number":2789,"context_line":"        selections \u003d [obj_sel, obj_alt1, obj_alt2, obj_alt3]"},{"line_number":2790,"context_line":"        # Trim this to the number of selected alternates, if requested"},{"line_number":2791,"context_line":"        num_alts \u003d 4 if num_alts is None else num_alts"},{"line_number":2792,"context_line":"        if num_alts:"},{"line_number":2793,"context_line":"            selections \u003d selections[:num_alts + 1]"},{"line_number":2794,"context_line":"        sqc \u003d scheduler_query_client.SchedulerQueryClient"},{"line_number":2795,"context_line":"        with mock.patch.object(sqc, \"select_destinations\") as mock_seldest:"},{"line_number":2796,"context_line":"            mock_seldest.return_value \u003d [selections]"},{"line_number":2797,"context_line":"            server_uuid \u003d server[\"id\"]"},{"line_number":2798,"context_line":"            data \u003d {\"resize\": {\"flavorRef\": self.flavor2[\"id\"]}}"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_3cc2f4ea","line":2795,"range":{"start_line":2787,"start_character":8,"end_line":2795,"end_character":75},"in_reply_to":"7f96bb07_a1b01b8d","updated":"2018-01-22 19:56:31.000000000","message":"I\u0027ll remove it, but one of the reasons for it was so that we could verify that the code didn\u0027t try to call select_destinations() more than once. By removing the mock, we remove the ability to test that assumption.","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b053548c5d6d648962d0f357fb27f89296ff032","unresolved":false,"context_lines":[{"line_number":2820,"context_line":"                # an alternate host."},{"line_number":2821,"context_line":"                new_server_host \u003d server.get(\"OS-EXT-SRV-ATTR:host\")"},{"line_number":2822,"context_line":"                expected_host \u003d selections[fails].service_host"},{"line_number":2823,"context_line":"                self.assertEqual(new_server_host, expected_host)"},{"line_number":2824,"context_line":"                uuid_dest \u003d selections[fails].compute_node_uuid"},{"line_number":2825,"context_line":"                source_usages \u003d self._get_provider_usages(uuid_orig)"},{"line_number":2826,"context_line":"                dest_usages \u003d self._get_provider_usages(uuid_dest)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_01d0ef4f","line":2823,"updated":"2018-01-22 17:02:47.000000000","message":"nit: reverse the args because assertEqual(expected, actual) - only matters if this assertion fails because the MismatchError will be wrong.","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6bf5c48935b6ec075cf532604021536c685d51ae","unresolved":false,"context_lines":[{"line_number":2820,"context_line":"                # an alternate host."},{"line_number":2821,"context_line":"                new_server_host \u003d server.get(\"OS-EXT-SRV-ATTR:host\")"},{"line_number":2822,"context_line":"                expected_host \u003d selections[fails].service_host"},{"line_number":2823,"context_line":"                self.assertEqual(new_server_host, expected_host)"},{"line_number":2824,"context_line":"                uuid_dest \u003d selections[fails].compute_node_uuid"},{"line_number":2825,"context_line":"                source_usages \u003d self._get_provider_usages(uuid_orig)"},{"line_number":2826,"context_line":"                dest_usages \u003d self._get_provider_usages(uuid_dest)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_2ad05ff7","line":2823,"in_reply_to":"7f96bb07_01d0ef4f","updated":"2018-01-22 19:56:31.000000000","message":"Done","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1b053548c5d6d648962d0f357fb27f89296ff032","unresolved":false,"context_lines":[{"line_number":2838,"context_line":"            # Verify that select_destinations() was only called once in either"},{"line_number":2839,"context_line":"            # case."},{"line_number":2840,"context_line":"            mock_seldest.assert_called_once()"},{"line_number":2841,"context_line":"            # Verify that there is only one migration record for the instance."},{"line_number":2842,"context_line":"            ctxt \u003d context.get_admin_context()"},{"line_number":2843,"context_line":"            filters \u003d {\"instance_uuid\": server[\"id\"]}"},{"line_number":2844,"context_line":"            migrations \u003d objects.MigrationList.get_by_filters(ctxt, filters)"}],"source_content_type":"text/x-python","patch_set":27,"id":"7f96bb07_a13a5bca","line":2841,"updated":"2018-01-22 17:02:47.000000000","message":"nit: would be nice to use the actual os-migrations API for this, but won\u0027t block on it.","commit_id":"f8eed1630539095adea5cb6f53ee5731d57681dc"}],"nova/tests/unit/compute/test_rpcapi.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"aa9d4aa080b6e569c81b117a7357680e732ee5b6","unresolved":false,"context_lines":[{"line_number":620,"context_line":"        self._test_compute_api(\u0027reset_network\u0027, \u0027cast\u0027,"},{"line_number":621,"context_line":"                instance\u003dself.fake_instance_obj)"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    def test_resize_instance(self):"},{"line_number":624,"context_line":"        self._test_compute_api(\u0027resize_instance\u0027, \u0027cast\u0027,"},{"line_number":625,"context_line":"                instance\u003dself.fake_instance_obj, migration\u003d{\u0027id\u0027: \u0027fake_id\u0027},"},{"line_number":626,"context_line":"                image\u003d\u0027image\u0027, instance_type\u003dself.fake_flavor_obj,"},{"line_number":627,"context_line":"                reservations\u003d[\u0027fake_res\u0027], clean_shutdown\u003dTrue, version\u003d\u00274.1\u0027)"},{"line_number":628,"context_line":"        self.flags(compute\u003d\u00274.0\u0027, group\u003d\u0027upgrade_levels\u0027)"},{"line_number":629,"context_line":"        expected_args \u003d {\u0027instance_type\u0027: self.fake_flavor}"},{"line_number":630,"context_line":"        self._test_compute_api(\u0027resize_instance\u0027, \u0027cast\u0027, expected_args,"},{"line_number":631,"context_line":"                instance\u003dself.fake_instance_obj, migration\u003d{\u0027id\u0027: \u0027fake_id\u0027},"},{"line_number":632,"context_line":"                image\u003d\u0027image\u0027, instance_type\u003dself.fake_flavor_obj,"},{"line_number":633,"context_line":"                reservations\u003d[\u0027fake_res\u0027], clean_shutdown\u003dTrue,"},{"line_number":634,"context_line":"                version\u003d\u00274.0\u0027)"},{"line_number":635,"context_line":""},{"line_number":636,"context_line":"    def test_resume_instance(self):"},{"line_number":637,"context_line":"        self._test_compute_api(\u0027resume_instance\u0027, \u0027cast\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_560258b6","line":634,"range":{"start_line":623,"start_character":4,"end_line":634,"end_character":30},"updated":"2018-01-11 19:28:10.000000000","message":"There is no reason to make these changes in this patch.","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"94240ea033f46242a33466784fe22fe44caba7e5","unresolved":false,"context_lines":[{"line_number":620,"context_line":"        self._test_compute_api(\u0027reset_network\u0027, \u0027cast\u0027,"},{"line_number":621,"context_line":"                instance\u003dself.fake_instance_obj)"},{"line_number":622,"context_line":""},{"line_number":623,"context_line":"    def test_resize_instance(self):"},{"line_number":624,"context_line":"        self._test_compute_api(\u0027resize_instance\u0027, \u0027cast\u0027,"},{"line_number":625,"context_line":"                instance\u003dself.fake_instance_obj, migration\u003d{\u0027id\u0027: \u0027fake_id\u0027},"},{"line_number":626,"context_line":"                image\u003d\u0027image\u0027, instance_type\u003dself.fake_flavor_obj,"},{"line_number":627,"context_line":"                reservations\u003d[\u0027fake_res\u0027], clean_shutdown\u003dTrue, version\u003d\u00274.1\u0027)"},{"line_number":628,"context_line":"        self.flags(compute\u003d\u00274.0\u0027, group\u003d\u0027upgrade_levels\u0027)"},{"line_number":629,"context_line":"        expected_args \u003d {\u0027instance_type\u0027: self.fake_flavor}"},{"line_number":630,"context_line":"        self._test_compute_api(\u0027resize_instance\u0027, \u0027cast\u0027, expected_args,"},{"line_number":631,"context_line":"                instance\u003dself.fake_instance_obj, migration\u003d{\u0027id\u0027: \u0027fake_id\u0027},"},{"line_number":632,"context_line":"                image\u003d\u0027image\u0027, instance_type\u003dself.fake_flavor_obj,"},{"line_number":633,"context_line":"                reservations\u003d[\u0027fake_res\u0027], clean_shutdown\u003dTrue,"},{"line_number":634,"context_line":"                version\u003d\u00274.0\u0027)"},{"line_number":635,"context_line":""},{"line_number":636,"context_line":"    def test_resume_instance(self):"},{"line_number":637,"context_line":"        self._test_compute_api(\u0027resume_instance\u0027, \u0027cast\u0027,"}],"source_content_type":"text/x-python","patch_set":22,"id":"7f96bb07_256ad0b2","line":634,"range":{"start_line":623,"start_character":4,"end_line":634,"end_character":30},"in_reply_to":"7f96bb07_560258b6","updated":"2018-01-12 19:11:51.000000000","message":"There *was* a reason: I had originally had the host_list param included, which required wrapping. After it was removed, I re-wrapped, and it didn\u0027t match the original. Fixed.","commit_id":"c5a33f834fc7d444e704ac1d5e51cfcda52ff28a"}]}
