)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a6c237a96a1037645505172440ddb085d4ca3019","unresolved":false,"context_lines":[{"line_number":14,"context_line":"And this change passes the ARQs to spawn during unshelve an instance."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This change extends the ``shelve_offload_instance`` and"},{"line_number":17,"context_line":"``unshelve_instance`` rpcapi function to carry the arq_uuids."},{"line_number":18,"context_line":"This eliminates the need to lookup the uuids associated with the arqs"},{"line_number":19,"context_line":"assinged to the instance by quering Cyborg."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"bf51134e_373bf6c8","line":17,"updated":"2020-07-20 11:15:28.000000000","message":"and the shelve_instance too","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"090ca6cc552617dd74b28f9ecd5bb93f29c049a0","unresolved":false,"context_lines":[{"line_number":14,"context_line":"And this change passes the ARQs to spawn during unshelve an instance."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This change extends the ``shelve_offload_instance`` and"},{"line_number":17,"context_line":"``unshelve_instance`` rpcapi function to carry the arq_uuids."},{"line_number":18,"context_line":"This eliminates the need to lookup the uuids associated with the arqs"},{"line_number":19,"context_line":"assinged to the instance by quering Cyborg."},{"line_number":20,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9f560f44_c2fb65bb","line":17,"in_reply_to":"bf51134e_373bf6c8","updated":"2020-09-08 07:50:24.000000000","message":"Done","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a6c237a96a1037645505172440ddb085d4ca3019","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This change extends the ``shelve_offload_instance`` and"},{"line_number":17,"context_line":"``unshelve_instance`` rpcapi function to carry the arq_uuids."},{"line_number":18,"context_line":"This eliminates the need to lookup the uuids associated with the arqs"},{"line_number":19,"context_line":"assinged to the instance by quering Cyborg."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Co-Authored-By: Wenping Song \u003csongwenping@inspur.com\u003e"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"bf51134e_b778a68f","line":19,"range":{"start_line":18,"start_character":0,"end_line":19,"end_character":43},"updated":"2020-07-20 11:15:28.000000000","message":"Why this is better to eliminate such lookup? As you add the lookup to the compute api you have to modify the RPC interface. If you add the lookup to the compute side then no RPC changes would be needed.","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"090ca6cc552617dd74b28f9ecd5bb93f29c049a0","unresolved":false,"context_lines":[{"line_number":15,"context_line":""},{"line_number":16,"context_line":"This change extends the ``shelve_offload_instance`` and"},{"line_number":17,"context_line":"``unshelve_instance`` rpcapi function to carry the arq_uuids."},{"line_number":18,"context_line":"This eliminates the need to lookup the uuids associated with the arqs"},{"line_number":19,"context_line":"assinged to the instance by quering Cyborg."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Co-Authored-By: Wenping Song \u003csongwenping@inspur.com\u003e"},{"line_number":22,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9f560f44_42291535","line":19,"range":{"start_line":18,"start_character":0,"end_line":19,"end_character":43},"in_reply_to":"bf51134e_b778a68f","updated":"2020-09-08 07:50:24.000000000","message":"Done. Remove this.","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"}],"api-guide/source/accelerator-support.rst":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":55,"context_line":".. versionchanged:: 22.0.0(Victoria)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"   Added support for rebuild and evacuate operations."},{"line_number":58,"context_line":"   Added support for shelve and unshelve operations."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Some operations, such as lock and unlock, work as they are effectively"},{"line_number":61,"context_line":"no-ops for accelerators."}],"source_content_type":"text/x-rst","patch_set":14,"id":"1f621f24_fca0af92","line":58,"updated":"2020-11-11 16:01:05.000000000","message":"we are in Wallaby now","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":55,"context_line":".. versionchanged:: 22.0.0(Victoria)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"   Added support for rebuild and evacuate operations."},{"line_number":58,"context_line":"   Added support for shelve and unshelve operations."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Some operations, such as lock and unlock, work as they are effectively"},{"line_number":61,"context_line":"no-ops for accelerators."}],"source_content_type":"text/x-rst","patch_set":14,"id":"1f621f24_b6e76bac","line":58,"in_reply_to":"1f621f24_fca0af92","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"}],"nova/api/openstack/compute/shelve.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"91d3b37319816af7c33f63451d9c88606b279770","unresolved":true,"context_lines":[{"line_number":56,"context_line":"        ) as e:"},{"line_number":57,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":58,"context_line":"        except exception.ForbiddenWithAccelerators as e:"},{"line_number":59,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":60,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":61,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":62,"context_line":"                                                                  \u0027shelve\u0027, id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5db8b3a0_ffda74bc","line":59,"updated":"2021-01-05 14:29:16.000000000","message":"This is sad because we were already returning HTTP403 *before* when you were passing a nested flavor in the instance that was using accel:device_profile key.\n\nNow, we are technically not changing this now, but I\u0027d argue that *before*, we changed the behaviour for flavors having this key (due to the block_accelerators decorator) that were getting HTTP403 instead of 200, hence a new microversion needed [1]\n\n[1] https://docs.openstack.org/nova/latest/contributor/microversions.html#f2\n\n/me grumbles.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a099474bd46b99e75ba2ed7706cb62fd1deea36a","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        ) as e:"},{"line_number":57,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":58,"context_line":"        except exception.ForbiddenWithAccelerators as e:"},{"line_number":59,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":60,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":61,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":62,"context_line":"                                                                  \u0027shelve\u0027, id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"8fec2499_4b812f8e","line":59,"in_reply_to":"5c3c2699_20bd5d0b","updated":"2021-01-11 01:12:33.000000000","message":"\u003e I did not find the test case which verify ForbiddenWithAccelerators  -\u003e HTTPForbidden so adding those with the fix in https://review.opendev.org/c/openstack/nova/+/770007\n\u003e \n\nThanks fixing this issue, +1.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"35159359c00e1a5ebf4597c74444351ce822b736","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        ) as e:"},{"line_number":57,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":58,"context_line":"        except exception.ForbiddenWithAccelerators as e:"},{"line_number":59,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":60,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":61,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":62,"context_line":"                                                                  \u0027shelve\u0027, id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"d036f211_e11196d7","line":59,"in_reply_to":"5db8b3a0_ffda74bc","updated":"2021-01-05 14:53:29.000000000","message":"We just discussed this on IRC, and I think we\u0027re okay. We were raising ForbiddenWithAccelerators always when shelving. However, that\u0027s been converted to \"only until service version 54\", which was the original plan to make this \"forbidden ... until it\u0027s implemented.\" That\u0027s what this patch is doing, so it\u0027s following the original plan. This translation of ForbiddenWithAccelerators to HTTPForbidden is probably not really necessary because the former already declares code\u003d403, but it is in line with much of the other API code, where we\u0027re explicit about what can happen here, HTTP-wise.\n\nSo, I think we\u0027re good here, but good attention to detail from Mr. Bauzas :)","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"178cc6349a31202ef6430c6b65b4f545da80c67d","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        ) as e:"},{"line_number":57,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":58,"context_line":"        except exception.ForbiddenWithAccelerators as e:"},{"line_number":59,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":60,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":61,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":62,"context_line":"                                                                  \u0027shelve\u0027, id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"9d81de74_b3d510b7","line":59,"in_reply_to":"8fec2499_4b812f8e","updated":"2021-01-13 14:47:24.000000000","message":"Just provided +W to this change. FWIW, you should not depend 770007 on this one, but rather the other way.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"24d0ad18287954667e64fcf9ef6720c428488b6e","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        ) as e:"},{"line_number":57,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":58,"context_line":"        except exception.ForbiddenWithAccelerators as e:"},{"line_number":59,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":60,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":61,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":62,"context_line":"                                                                  \u0027shelve\u0027, id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"645cecf6_5901b633","line":59,"in_reply_to":"9d81de74_b3d510b7","updated":"2021-01-14 16:10:18.000000000","message":"right, it can be independent. I made on top of this to avoid conflict.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":8556,"name":"Ghanshyam Maan","display_name":"Ghanshyam Maan","email":"gmaan.os14@gmail.com","username":"ghanshyam"},"change_message_id":"e6be241a0bef4fe6e3f827581ccd318cfb143006","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        ) as e:"},{"line_number":57,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":58,"context_line":"        except exception.ForbiddenWithAccelerators as e:"},{"line_number":59,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":60,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":61,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":62,"context_line":"                                                                  \u0027shelve\u0027, id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"5c3c2699_20bd5d0b","line":59,"in_reply_to":"aa88bcf9_85d4442a","updated":"2021-01-08 22:56:40.000000000","message":"Actually this change fixes the 500 -\u003e 403. ForbiddenWithAccelerators was never converted to HTTPForbidden for shelve or any other API where block_accelerators decorator was used and it end up raising HTTPInternalServerError (500).\n\nReason for 500 was ForbiddenWithAccelerators  is not inherited from Forbidden [1] and expected_errors() decorator raised 500 for ForbiddenWithAccelerators  exception occurred [2]. so this change fix this issue but we should inherit ForbiddenWithAccelerators from Forbidden to fix other API where block_accelerators decorator is used. \n\nI did not find the test case which verify ForbiddenWithAccelerators  -\u003e HTTPForbidden so adding those with the fix in https://review.opendev.org/c/openstack/nova/+/770007\n\n[1] https://github.com/openstack/nova/blob/46899968619e4ea0ff2ab380977619bb29578d43/nova/exception.py#L158\n[2] https://github.com/openstack/nova/blob/46899968619e4ea0ff2ab380977619bb29578d43/nova/api/openstack/wsgi.py#L689","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1f80d1ba37049d210e4391d8b777802ce6537b93","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        ) as e:"},{"line_number":57,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":58,"context_line":"        except exception.ForbiddenWithAccelerators as e:"},{"line_number":59,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":60,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":61,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":62,"context_line":"                                                                  \u0027shelve\u0027, id)"}],"source_content_type":"text/x-python","patch_set":26,"id":"aa88bcf9_85d4442a","line":59,"in_reply_to":"d036f211_e11196d7","updated":"2021-01-06 01:24:43.000000000","message":"Agree with Dan.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"}],"nova/compute/api.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"5b310fc99b2e1aa5b41e085af726b0835e2ac785","unresolved":false,"context_lines":[{"line_number":4032,"context_line":""},{"line_number":4033,"context_line":"        self._record_action_start(context, instance, instance_actions.SHELVE)"},{"line_number":4034,"context_line":""},{"line_number":4035,"context_line":"        accel_uuids \u003d []"},{"line_number":4036,"context_line":"        device_profile \u003d instance.flavor.extra_specs.get("},{"line_number":4037,"context_line":"            \u0027accel:device_profile\u0027)"},{"line_number":4038,"context_line":"        if device_profile:"},{"line_number":4039,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":4040,"context_line":"            accel_uuids \u003d [arq[\u0027uuid\u0027]"},{"line_number":4041,"context_line":"                for arq in cyclient.get_arqs_for_instance(instance.uuid)]"},{"line_number":4042,"context_line":""},{"line_number":4043,"context_line":"        if not compute_utils.is_volume_backed_instance(context, instance):"},{"line_number":4044,"context_line":"            name \u003d \u0027%s-shelved\u0027 % instance.display_name"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_9dfcee3e","line":4041,"range":{"start_line":4035,"start_character":7,"end_line":4041,"end_character":73},"updated":"2020-05-20 11:39:55.000000000","message":"by the way i think i did exactly the same thing for evacuate and you have done this twice so it might be nice to just pull this out into a helper function that takes a context and instance and returns the accel_uuids\n\nso in the cyborg module just add a module level function that just does this.","commit_id":"d5bee5f3509bba52eb8f18db9cf75ab489d3abdd"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"5b310fc99b2e1aa5b41e085af726b0835e2ac785","unresolved":false,"context_lines":[{"line_number":4050,"context_line":"        else:"},{"line_number":4051,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4052,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"},{"line_number":4053,"context_line":"                accel_uuids\u003daccel_uuids)"},{"line_number":4054,"context_line":""},{"line_number":4055,"context_line":"    @check_instance_lock"},{"line_number":4056,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.SHELVED])"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_dd9786eb","line":4053,"range":{"start_line":4053,"start_character":28,"end_line":4053,"end_character":39},"updated":"2020-05-20 11:39:55.000000000","message":"if you extract the funciton you can just do\ncyborg.get_instance_arqs(context, instance) here","commit_id":"d5bee5f3509bba52eb8f18db9cf75ab489d3abdd"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"5b310fc99b2e1aa5b41e085af726b0835e2ac785","unresolved":false,"context_lines":[{"line_number":4062,"context_line":"        self._record_action_start(context, instance,"},{"line_number":4063,"context_line":"                                  instance_actions.SHELVE_OFFLOAD)"},{"line_number":4064,"context_line":""},{"line_number":4065,"context_line":"        accel_uuids \u003d []"},{"line_number":4066,"context_line":"        device_profile \u003d instance.flavor.extra_specs.get("},{"line_number":4067,"context_line":"            \u0027accel:device_profile\u0027)"},{"line_number":4068,"context_line":"        if device_profile:"},{"line_number":4069,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":4070,"context_line":"            accel_uuids \u003d [arq[\u0027uuid\u0027]"},{"line_number":4071,"context_line":"                for arq in cyclient.get_arqs_for_instance(instance.uuid)]"},{"line_number":4072,"context_line":""},{"line_number":4073,"context_line":"        self.compute_rpcapi.shelve_offload_instance(context, instance\u003dinstance,"},{"line_number":4074,"context_line":"            clean_shutdown\u003dclean_shutdown, accel_uuids\u003daccel_uuids)"},{"line_number":4075,"context_line":""},{"line_number":4076,"context_line":"    def _validate_unshelve_az(self, context, instance, availability_zone):"},{"line_number":4077,"context_line":"        \"\"\"Verify the specified availability_zone during unshelve."}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_fda08a44","line":4074,"range":{"start_line":4065,"start_character":6,"end_line":4074,"end_character":67},"updated":"2020-05-20 11:39:55.000000000","message":"same with this and the other places i did this in the evacuate code.","commit_id":"d5bee5f3509bba52eb8f18db9cf75ab489d3abdd"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"844a87b45abc69258eda4b5f857266658c666433","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"9f560f44_a9d8cd7e","updated":"2020-09-08 15:15:21.000000000","message":"I think you are missing unit tests for these changes","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"f9960ff6996e29d10faa05a3aae9df815e010e33","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"9f560f44_56ab8186","in_reply_to":"9f560f44_a9d8cd7e","updated":"2020-09-11 11:24:24.000000000","message":"Done","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":4223,"context_line":""},{"line_number":4224,"context_line":"    @check_instance_lock"},{"line_number":4225,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.SHELVED])"},{"line_number":4226,"context_line":"    def shelve_offload(self, context, instance, clean_shutdown\u003dTrue):"},{"line_number":4227,"context_line":"        \"\"\"Remove a shelved instance from the hypervisor.\"\"\""},{"line_number":4228,"context_line":"        instance.task_state \u003d task_states.SHELVING_OFFLOADING"},{"line_number":4229,"context_line":"        instance.save(expected_task_state\u003d[None])"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_48b63d40","line":4226,"range":{"start_line":4226,"start_character":8,"end_line":4226,"end_character":22},"updated":"2020-11-11 16:01:05.000000000","message":"I just note to the reviewers (and my future self) that we don\u0027t not need to block shelve_offload with accelerators:\n* in Victoria we don\u0027t need to bock is as shelve was blocked and shelve_offload can only be called on an already shelved instances\n* we don\u0027t need to block it in a mixed V and W compute situation as the min service version there is still on V level and that still block the shelve operation in the whole cloud, until the rolling upgrade is finished.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":4223,"context_line":""},{"line_number":4224,"context_line":"    @check_instance_lock"},{"line_number":4225,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.SHELVED])"},{"line_number":4226,"context_line":"    def shelve_offload(self, context, instance, clean_shutdown\u003dTrue):"},{"line_number":4227,"context_line":"        \"\"\"Remove a shelved instance from the hypervisor.\"\"\""},{"line_number":4228,"context_line":"        instance.task_state \u003d task_states.SHELVING_OFFLOADING"},{"line_number":4229,"context_line":"        instance.save(expected_task_state\u003d[None])"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_3657db28","line":4226,"range":{"start_line":4226,"start_character":8,"end_line":4226,"end_character":22},"in_reply_to":"1f621f24_48b63d40","updated":"2020-11-12 10:51:41.000000000","message":"yup.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"febd40769a0c222c7c238fe8e8a430ccdc8bb0ba","unresolved":false,"context_lines":[{"line_number":4198,"context_line":"        else:"},{"line_number":4199,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4200,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"},{"line_number":4201,"context_line":"                accel_uuids\u003daccel_uuids)"},{"line_number":4202,"context_line":""},{"line_number":4203,"context_line":"    @check_instance_lock"},{"line_number":4204,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.SHELVED])"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f621f24_58c1b853","line":4201,"updated":"2020-11-16 14:53:53.000000000","message":"You need to catch the exception here and do something right? Otherwise people will see a 500?","commit_id":"5489ad6b870c8a091d0d83b08059197d7142365c"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"2077e85819f0e06083ff39e928f1123b118439a7","unresolved":false,"context_lines":[{"line_number":4198,"context_line":"        else:"},{"line_number":4199,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4200,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"},{"line_number":4201,"context_line":"                accel_uuids\u003daccel_uuids)"},{"line_number":4202,"context_line":""},{"line_number":4203,"context_line":"    @check_instance_lock"},{"line_number":4204,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.SHELVED])"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f621f24_e46bbab3","line":4201,"in_reply_to":"1f621f24_58c1b853","updated":"2020-11-17 04:20:11.000000000","message":"Yes, we can catch the exception unsupport with accelerators, but it seems repeat with the `block_accelerators()`, ForbiddenWithAccelerators does the same ting.","commit_id":"5489ad6b870c8a091d0d83b08059197d7142365c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5c14b68defcbb436b64bfb3ad44d95bfe23a1ffe","unresolved":false,"context_lines":[{"line_number":4198,"context_line":"        else:"},{"line_number":4199,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4200,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"},{"line_number":4201,"context_line":"                accel_uuids\u003daccel_uuids)"},{"line_number":4202,"context_line":""},{"line_number":4203,"context_line":"    @check_instance_lock"},{"line_number":4204,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.SHELVED])"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f621f24_5eeb4e76","line":4201,"in_reply_to":"1f621f24_e46bbab3","updated":"2020-11-17 16:43:49.000000000","message":"Right, but that exception is caught in the API and handled as a 4xx. For example:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/migrate_server.py#L63","commit_id":"5489ad6b870c8a091d0d83b08059197d7142365c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5c14b68defcbb436b64bfb3ad44d95bfe23a1ffe","unresolved":false,"context_lines":[{"line_number":4199,"context_line":"            except exception.ServiceTooOld:"},{"line_number":4200,"context_line":"                LOG.warning(\"Nova-compute version is too old, shelve a server \""},{"line_number":4201,"context_line":"                            \"with accelerators is not supported.\")"},{"line_number":4202,"context_line":"                raise exception.ShelveUnsupportedAccelerators()"},{"line_number":4203,"context_line":"        else:"},{"line_number":4204,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4205,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"}],"source_content_type":"text/x-python","patch_set":20,"id":"1f621f24_fefb3a43","line":4202,"updated":"2020-11-17 16:43:49.000000000","message":"I don\u0027t think we need a new exception here, just catch the ServiceTooOld in the API and return something useful, right?\n\nNote that even with this new exception, we\u0027ll raise 500 in the API, AFAICT, since shelve doesn\u0027t catch any of these.","commit_id":"9222a83d5b731c9bcb5d6473637d2820037449b5"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"cff4956e5f49027893e90cb461ac3b6c80d1fe8e","unresolved":false,"context_lines":[{"line_number":4199,"context_line":"            except exception.ServiceTooOld:"},{"line_number":4200,"context_line":"                LOG.warning(\"Nova-compute version is too old, shelve a server \""},{"line_number":4201,"context_line":"                            \"with accelerators is not supported.\")"},{"line_number":4202,"context_line":"                raise exception.ShelveUnsupportedAccelerators()"},{"line_number":4203,"context_line":"        else:"},{"line_number":4204,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4205,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"}],"source_content_type":"text/x-python","patch_set":20,"id":"1f621f24_3c181583","line":4202,"in_reply_to":"1f621f24_fefb3a43","updated":"2020-11-18 03:02:20.000000000","message":"Yeah, we can catch the TooOldComputeService, and return the useful message to users.","commit_id":"9222a83d5b731c9bcb5d6473637d2820037449b5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":4201,"context_line":"                msg \u003d (_(\"Nova-compute version is too old, shelve a server \""},{"line_number":4202,"context_line":"                        \"with accelerators is not supported: %s\") % str(e))"},{"line_number":4203,"context_line":"                LOG.error(msg)"},{"line_number":4204,"context_line":"                return upgradecheck.Result(upgradecheck.Code.FAILURE, msg)"},{"line_number":4205,"context_line":"        else:"},{"line_number":4206,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4207,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"}],"source_content_type":"text/x-python","patch_set":21,"id":"b8346ad2_5324cee1","line":4204,"range":{"start_line":4204,"start_character":17,"end_line":4204,"end_character":74},"updated":"2020-11-24 16:54:35.000000000","message":"What is the reason of this return value? It is not handled in the REST api side. I think you can raise ForbiddenWithAccelerator as that is handled on the REST API side.","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"94a483c90c22fa20186b4f809ab3a6381d615b46","unresolved":false,"context_lines":[{"line_number":4201,"context_line":"                msg \u003d (_(\"Nova-compute version is too old, shelve a server \""},{"line_number":4202,"context_line":"                        \"with accelerators is not supported: %s\") % str(e))"},{"line_number":4203,"context_line":"                LOG.error(msg)"},{"line_number":4204,"context_line":"                return upgradecheck.Result(upgradecheck.Code.FAILURE, msg)"},{"line_number":4205,"context_line":"        else:"},{"line_number":4206,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4207,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"}],"source_content_type":"text/x-python","patch_set":21,"id":"13fb9c78_68572cda","line":4204,"range":{"start_line":4204,"start_character":17,"end_line":4204,"end_character":74},"in_reply_to":"b8346ad2_5324cee1","updated":"2020-11-27 09:29:53.000000000","message":"Done","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3e0f488e0e15945520124a74ff9ca315302c556","unresolved":true,"context_lines":[{"line_number":4195,"context_line":"                self.compute_rpcapi.shelve_instance(context, instance\u003dinstance,"},{"line_number":4196,"context_line":"                    image_id\u003dimage_id, clean_shutdown\u003dclean_shutdown,"},{"line_number":4197,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":4198,"context_line":"            except exception.TooOldComputeService as e:"},{"line_number":4199,"context_line":"                msg \u003d (_(\"Nova-compute version is too old, shelve a server \""},{"line_number":4200,"context_line":"                        \"with accelerators is not supported: %s\") % str(e))"},{"line_number":4201,"context_line":"                LOG.error(msg)"}],"source_content_type":"text/x-python","patch_set":24,"id":"a84ef2c0_ed435fed","line":4198,"range":{"start_line":4198,"start_character":19,"end_line":4198,"end_character":55},"updated":"2021-01-05 08:28:16.000000000","message":"self.compute_rpcapi.shelve_instance raises ForbiddenWithAccelerators not TooOldComputeService","commit_id":"91bb152632a44a26b955f56578397f738e81dbda"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a840cc627ab624351c5da22bb9e73d0011ad59d3","unresolved":false,"context_lines":[{"line_number":4195,"context_line":"                self.compute_rpcapi.shelve_instance(context, instance\u003dinstance,"},{"line_number":4196,"context_line":"                    image_id\u003dimage_id, clean_shutdown\u003dclean_shutdown,"},{"line_number":4197,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":4198,"context_line":"            except exception.TooOldComputeService as e:"},{"line_number":4199,"context_line":"                msg \u003d (_(\"Nova-compute version is too old, shelve a server \""},{"line_number":4200,"context_line":"                        \"with accelerators is not supported: %s\") % str(e))"},{"line_number":4201,"context_line":"                LOG.error(msg)"}],"source_content_type":"text/x-python","patch_set":24,"id":"b7dfcc06_dc8c8917","line":4198,"range":{"start_line":4198,"start_character":19,"end_line":4198,"end_character":55},"in_reply_to":"a84ef2c0_ed435fed","updated":"2021-01-05 08:55:08.000000000","message":"Done","commit_id":"91bb152632a44a26b955f56578397f738e81dbda"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d3e0f488e0e15945520124a74ff9ca315302c556","unresolved":true,"context_lines":[{"line_number":4196,"context_line":"                    image_id\u003dimage_id, clean_shutdown\u003dclean_shutdown,"},{"line_number":4197,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":4198,"context_line":"            except exception.TooOldComputeService as e:"},{"line_number":4199,"context_line":"                msg \u003d (_(\"Nova-compute version is too old, shelve a server \""},{"line_number":4200,"context_line":"                        \"with accelerators is not supported: %s\") % str(e))"},{"line_number":4201,"context_line":"                LOG.error(msg)"},{"line_number":4202,"context_line":"                raise exception.ForbiddenWithAccelerators()"},{"line_number":4203,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":24,"id":"83ce0b99_63aa0d9b","line":4200,"range":{"start_line":4199,"start_character":16,"end_line":4200,"end_character":75},"updated":"2021-01-05 08:28:16.000000000","message":"at his point in execution the rpcapi logged a very similar message already","commit_id":"91bb152632a44a26b955f56578397f738e81dbda"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fa108efe7efff3d6bed73c85a586933ca0d69280","unresolved":true,"context_lines":[{"line_number":4195,"context_line":"                self.compute_rpcapi.shelve_instance(context, instance\u003dinstance,"},{"line_number":4196,"context_line":"                    image_id\u003dimage_id, clean_shutdown\u003dclean_shutdown,"},{"line_number":4197,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":4198,"context_line":"            except exception.ForbiddenWithAccelerators as e:"},{"line_number":4199,"context_line":"                raise exception.ForbiddenWithAccelerators()"},{"line_number":4200,"context_line":"        else:"},{"line_number":4201,"context_line":"            self.compute_rpcapi.shelve_offload_instance("},{"line_number":4202,"context_line":"                context, instance\u003dinstance, clean_shutdown\u003dclean_shutdown,"},{"line_number":4203,"context_line":"                accel_uuids\u003daccel_uuids)"}],"source_content_type":"text/x-python","patch_set":25,"id":"40d415a9_774ec8ef","line":4200,"range":{"start_line":4198,"start_character":0,"end_line":4200,"end_character":1},"updated":"2021-01-05 11:45:26.000000000","message":"if you just catch and then raise the same exception then you can simply remove the whole except block and let the original exception propagate up the call stack","commit_id":"7e3ad531237346a43158618cfd5b5408ae594ee3"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"71a5030e4b1292714a3eca12be2aca8fff75b725","unresolved":true,"context_lines":[{"line_number":4184,"context_line":"        accel_uuids \u003d []"},{"line_number":4185,"context_line":"        if instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":4186,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":4187,"context_line":"            accel_uuids \u003d cyclient.get_arq_uuids_for_instance(instance)"},{"line_number":4188,"context_line":""},{"line_number":4189,"context_line":"        if not compute_utils.is_volume_backed_instance(context, instance):"},{"line_number":4190,"context_line":"            name \u003d \u0027%s-shelved\u0027 % instance.display_name"}],"source_content_type":"text/x-python","patch_set":26,"id":"37b662e9_5bc85cba","line":4187,"updated":"2021-01-06 08:15:50.000000000","message":"we should catch the exception raised from this method at api layer https://review.opendev.org/c/openstack/nova/+/729563/26/nova/api/openstack/compute/shelve.py#40, otherwise, it will turn into 500 code.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a099474bd46b99e75ba2ed7706cb62fd1deea36a","unresolved":true,"context_lines":[{"line_number":4184,"context_line":"        accel_uuids \u003d []"},{"line_number":4185,"context_line":"        if instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":4186,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":4187,"context_line":"            accel_uuids \u003d cyclient.get_arq_uuids_for_instance(instance)"},{"line_number":4188,"context_line":""},{"line_number":4189,"context_line":"        if not compute_utils.is_volume_backed_instance(context, instance):"},{"line_number":4190,"context_line":"            name \u003d \u0027%s-shelved\u0027 % instance.display_name"}],"source_content_type":"text/x-python","patch_set":26,"id":"b4bbd7fa_d3a8abda","line":4187,"in_reply_to":"37b662e9_5bc85cba","updated":"2021-01-11 01:12:33.000000000","message":"Fixed in https://review.opendev.org/c/openstack/nova/+/770007","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"243e32c9afe6d180af009f26033138683e4b6ead","unresolved":true,"context_lines":[{"line_number":4212,"context_line":"        accel_uuids \u003d []"},{"line_number":4213,"context_line":"        if instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":4214,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":4215,"context_line":"            accel_uuids \u003d cyclient.get_arq_uuids_for_instance(instance)"},{"line_number":4216,"context_line":""},{"line_number":4217,"context_line":"        self.compute_rpcapi.shelve_offload_instance("},{"line_number":4218,"context_line":"            context, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":26,"id":"b3394b42_78208e79","line":4215,"updated":"2021-01-05 15:50:39.000000000","message":"super nitty, a common helper method for both shelve and unshelve would make sure we won\u0027t diverge in some cycles, but anyway, not worthy to do it.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"178cc6349a31202ef6430c6b65b4f545da80c67d","unresolved":true,"context_lines":[{"line_number":4212,"context_line":"        accel_uuids \u003d []"},{"line_number":4213,"context_line":"        if instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":4214,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":4215,"context_line":"            accel_uuids \u003d cyclient.get_arq_uuids_for_instance(instance)"},{"line_number":4216,"context_line":""},{"line_number":4217,"context_line":"        self.compute_rpcapi.shelve_offload_instance("},{"line_number":4218,"context_line":"            context, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":26,"id":"45ebcb7c_8ab8046f","line":4215,"in_reply_to":"3b2746ca_475914cb","updated":"2021-01-13 14:47:24.000000000","message":"Sure, I meant you don\u0027t need to provide this in this change, but maybe in a new followed one in case you want to modify.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1f80d1ba37049d210e4391d8b777802ce6537b93","unresolved":true,"context_lines":[{"line_number":4212,"context_line":"        accel_uuids \u003d []"},{"line_number":4213,"context_line":"        if instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":4214,"context_line":"            cyclient \u003d cyborg.get_client(context)"},{"line_number":4215,"context_line":"            accel_uuids \u003d cyclient.get_arq_uuids_for_instance(instance)"},{"line_number":4216,"context_line":""},{"line_number":4217,"context_line":"        self.compute_rpcapi.shelve_offload_instance("},{"line_number":4218,"context_line":"            context, instance\u003dinstance,"}],"source_content_type":"text/x-python","patch_set":26,"id":"3b2746ca_475914cb","line":4215,"in_reply_to":"b3394b42_78208e79","updated":"2021-01-06 01:24:43.000000000","message":"I might want to say \"Why not?\" We put this in unshelve and shelve apis, it can be request and get the accel_uuids correctly, and if the \u0027accel:device_profile\u0027 not in the flavor that we can be jump this logical. In terms of frequency of use and efficiency, I think this modification is reasonable.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"}],"nova/compute/manager.py":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"f72f42ff89e27030434a93d1ca5b8a5f05e8baf2","unresolved":false,"context_lines":[{"line_number":6485,"context_line":""},{"line_number":6486,"context_line":"        :param context: request context"},{"line_number":6487,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":6488,"context_line":"        :param clean_shutdown: give the GuestOS a chance to stop"},{"line_number":6489,"context_line":"        \"\"\""},{"line_number":6490,"context_line":""},{"line_number":6491,"context_line":"        @utils.synchronized(instance.uuid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"ff570b3c_56add0e8","line":6488,"range":{"start_line":6488,"start_character":8,"end_line":6488,"end_character":14},"updated":"2020-05-25 00:19:16.000000000","message":":param accel_uuids: the accelerators uuids for the instance","commit_id":"8d9ea76a9de69d67660772355b8e14f49cf242ce"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"39e9a567ec672c8804a7b232c37ea80f5f00f6ae","unresolved":false,"context_lines":[{"line_number":6485,"context_line":""},{"line_number":6486,"context_line":"        :param context: request context"},{"line_number":6487,"context_line":"        :param instance: nova.objects.instance.Instance"},{"line_number":6488,"context_line":"        :param clean_shutdown: give the GuestOS a chance to stop"},{"line_number":6489,"context_line":"        \"\"\""},{"line_number":6490,"context_line":""},{"line_number":6491,"context_line":"        @utils.synchronized(instance.uuid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"bf51134e_cb540301","line":6488,"range":{"start_line":6488,"start_character":8,"end_line":6488,"end_character":14},"in_reply_to":"ff570b3c_56add0e8","updated":"2020-07-19 09:25:51.000000000","message":"\u003e :param accel_uuids: the accelerators uuids for the instance","commit_id":"8d9ea76a9de69d67660772355b8e14f49cf242ce"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"844a87b45abc69258eda4b5f857266658c666433","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"9f560f44_e989256f","updated":"2020-09-08 15:15:21.000000000","message":"most of these are not covered with unit tests","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"844a87b45abc69258eda4b5f857266658c666433","unresolved":false,"context_lines":[{"line_number":6640,"context_line":"                context, instance)"},{"line_number":6641,"context_line":""},{"line_number":6642,"context_line":"            accel_info \u003d []"},{"line_number":6643,"context_line":"            if instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":6644,"context_line":"                try:"},{"line_number":6645,"context_line":"                    accel_info \u003d self._get_bound_arq_resources("},{"line_number":6646,"context_line":"                        context, instance, accel_uuids or [])"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f560f44_d1184d77","line":6643,"updated":"2020-09-08 15:15:21.000000000","message":"I think it would be simpler to check just\n\n    if accel_uuids:","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"f9960ff6996e29d10faa05a3aae9df815e010e33","unresolved":false,"context_lines":[{"line_number":6640,"context_line":"                context, instance)"},{"line_number":6641,"context_line":""},{"line_number":6642,"context_line":"            accel_info \u003d []"},{"line_number":6643,"context_line":"            if instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":6644,"context_line":"                try:"},{"line_number":6645,"context_line":"                    accel_info \u003d self._get_bound_arq_resources("},{"line_number":6646,"context_line":"                        context, instance, accel_uuids or [])"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f560f44_e0ebefa0","line":6643,"in_reply_to":"9f560f44_d1184d77","updated":"2020-09-11 11:24:24.000000000","message":"Done","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"39396db994c210e4277420edba32792cc83838bd","unresolved":true,"context_lines":[{"line_number":6598,"context_line":"                    LOG.exception(exc)"},{"line_number":6599,"context_line":"                    self._build_resources_cleanup(instance, network_info)"},{"line_number":6600,"context_line":"                    msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":6601,"context_line":"                    raise exception.BuildAbortException("},{"line_number":6602,"context_line":"                        instance_uuid\u003dinstance.uuid, reason\u003dmsg)"},{"line_number":6603,"context_line":""},{"line_number":6604,"context_line":"            with self.rt.instance_claim(context, instance, node, allocations,"},{"line_number":6605,"context_line":"                                        limits):"}],"source_content_type":"text/x-python","patch_set":26,"id":"1dcd6c99_5fcf0ea5","line":6602,"range":{"start_line":6601,"start_character":20,"end_line":6602,"end_character":64},"updated":"2021-01-06 08:43:15.000000000","message":"I don\u0027t know why we convert to this exception, this exception is used for building new instance, and stop the retry. looks like we don\u0027t have retry for unshelve.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"d403ecaf4ba2b7d4fb6f1a2df48f69b5e4e17f82","unresolved":true,"context_lines":[{"line_number":6598,"context_line":"                    LOG.exception(exc)"},{"line_number":6599,"context_line":"                    self._build_resources_cleanup(instance, network_info)"},{"line_number":6600,"context_line":"                    msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":6601,"context_line":"                    raise exception.BuildAbortException("},{"line_number":6602,"context_line":"                        instance_uuid\u003dinstance.uuid, reason\u003dmsg)"},{"line_number":6603,"context_line":""},{"line_number":6604,"context_line":"            with self.rt.instance_claim(context, instance, node, allocations,"},{"line_number":6605,"context_line":"                                        limits):"}],"source_content_type":"text/x-python","patch_set":26,"id":"c8276b71_1e29302c","line":6602,"range":{"start_line":6601,"start_character":20,"end_line":6602,"end_character":64},"in_reply_to":"1dcd6c99_5fcf0ea5","updated":"2021-01-12 01:07:54.000000000","message":"If this operation is failed, we doesnot need to retry, if the accelerators binging failed, may the request cannot be filled, I remember we talked this in IRC but not sure which day.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"3193f70aa093647b41846f050d5cc42b65d3c97b","unresolved":true,"context_lines":[{"line_number":6598,"context_line":"                    LOG.exception(exc)"},{"line_number":6599,"context_line":"                    self._build_resources_cleanup(instance, network_info)"},{"line_number":6600,"context_line":"                    msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":6601,"context_line":"                    raise exception.BuildAbortException("},{"line_number":6602,"context_line":"                        instance_uuid\u003dinstance.uuid, reason\u003dmsg)"},{"line_number":6603,"context_line":""},{"line_number":6604,"context_line":"            with self.rt.instance_claim(context, instance, node, allocations,"},{"line_number":6605,"context_line":"                                        limits):"}],"source_content_type":"text/x-python","patch_set":26,"id":"b8cee07b_058f91b8","line":6602,"range":{"start_line":6601,"start_character":20,"end_line":6602,"end_character":64},"in_reply_to":"615160b7_1cc600a2","updated":"2021-01-12 03:09:08.000000000","message":"Yes, but from the *msg* we can know why this is failed.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"178cc6349a31202ef6430c6b65b4f545da80c67d","unresolved":true,"context_lines":[{"line_number":6598,"context_line":"                    LOG.exception(exc)"},{"line_number":6599,"context_line":"                    self._build_resources_cleanup(instance, network_info)"},{"line_number":6600,"context_line":"                    msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":6601,"context_line":"                    raise exception.BuildAbortException("},{"line_number":6602,"context_line":"                        instance_uuid\u003dinstance.uuid, reason\u003dmsg)"},{"line_number":6603,"context_line":""},{"line_number":6604,"context_line":"            with self.rt.instance_claim(context, instance, node, allocations,"},{"line_number":6605,"context_line":"                                        limits):"}],"source_content_type":"text/x-python","patch_set":26,"id":"0caec00e_8a5bec11","line":6602,"range":{"start_line":6601,"start_character":20,"end_line":6602,"end_character":64},"in_reply_to":"b8cee07b_058f91b8","updated":"2021-01-13 14:47:24.000000000","message":"Agreed with Alex, you don\u0027t need to raise this specific exception but rather a specific one.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"4a31642f96bc89f9074530e7d2250fb688639653","unresolved":true,"context_lines":[{"line_number":6598,"context_line":"                    LOG.exception(exc)"},{"line_number":6599,"context_line":"                    self._build_resources_cleanup(instance, network_info)"},{"line_number":6600,"context_line":"                    msg \u003d _(\u0027Failure getting accelerator requests.\u0027)"},{"line_number":6601,"context_line":"                    raise exception.BuildAbortException("},{"line_number":6602,"context_line":"                        instance_uuid\u003dinstance.uuid, reason\u003dmsg)"},{"line_number":6603,"context_line":""},{"line_number":6604,"context_line":"            with self.rt.instance_claim(context, instance, node, allocations,"},{"line_number":6605,"context_line":"                                        limits):"}],"source_content_type":"text/x-python","patch_set":26,"id":"615160b7_1cc600a2","line":6602,"range":{"start_line":6601,"start_character":20,"end_line":6602,"end_character":64},"in_reply_to":"c8276b71_1e29302c","updated":"2021-01-12 01:51:17.000000000","message":"so we we didn\u0027t raise original exception?","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"}],"nova/compute/rpcapi.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a6c237a96a1037645505172440ddb085d4ca3019","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        * 5.12 - Add accel_uuids (accelerator requests) parameter to"},{"line_number":382,"context_line":"                 rebuild_instance()"},{"line_number":383,"context_line":"        * 5.13 - Add accel_uuids (accelerator requests) parameter to"},{"line_number":384,"context_line":"                 shelve_offload_instance() and unshelve_instance()"},{"line_number":385,"context_line":"    \u0027\u0027\u0027"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    VERSION_ALIASES \u003d {"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf51134e_573e6ab9","line":384,"updated":"2020-07-20 11:15:28.000000000","message":"and shelve_instance() too","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"090ca6cc552617dd74b28f9ecd5bb93f29c049a0","unresolved":false,"context_lines":[{"line_number":381,"context_line":"        * 5.12 - Add accel_uuids (accelerator requests) parameter to"},{"line_number":382,"context_line":"                 rebuild_instance()"},{"line_number":383,"context_line":"        * 5.13 - Add accel_uuids (accelerator requests) parameter to"},{"line_number":384,"context_line":"                 shelve_offload_instance() and unshelve_instance()"},{"line_number":385,"context_line":"    \u0027\u0027\u0027"},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"    VERSION_ALIASES \u003d {"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f560f44_423c75e0","line":384,"in_reply_to":"bf51134e_573e6ab9","updated":"2020-09-08 07:50:24.000000000","message":"Done","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"844a87b45abc69258eda4b5f857266658c666433","unresolved":false,"context_lines":[{"line_number":382,"context_line":"                 rebuild_instance()"},{"line_number":383,"context_line":"        * 5.13 - Add accel_uuids (accelerator requests) parameter to"},{"line_number":384,"context_line":"                 shelve_instance(), shelve_offload_instance() and"},{"line_number":385,"context_line":"                 unshelve_instance()"},{"line_number":386,"context_line":"    \u0027\u0027\u0027"},{"line_number":387,"context_line":""},{"line_number":388,"context_line":"    VERSION_ALIASES \u003d {"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f560f44_f132b1a6","line":385,"updated":"2020-09-08 15:15:21.000000000","message":"You could get rid of the shelve and shelve offload part of the RPC bump if you move the get_arq_uuids_for_instance() call to the compute manager but we still need the unshelve RPC change as we want to keep the binding async.","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"33c54cf9fa88384324fffcd84cdce50384a85e3b","unresolved":false,"context_lines":[{"line_number":1384,"context_line":"        client \u003d self.router.client(ctxt)"},{"line_number":1385,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1386,"context_line":"        if not client.can_send_version(version):"},{"line_number":1387,"context_line":"            msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1388,"context_line":"            version \u003d \u00275.0\u0027"},{"line_number":1389,"context_line":"        cctxt \u003d client.prepare("},{"line_number":1390,"context_line":"                server\u003d_compute_host(None, instance), version\u003dversion)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_7753f6e2","line":1387,"updated":"2020-11-13 15:59:08.000000000","message":"Shouldn\u0027t this raise an exception saying \"you can\u0027t do this\"? That would be better than just silently deleting it, since we know that it means a compute will not be able to do what is being asked.\n\nIf I have a setup with all new computes, but still have my rpc version manually pinned to 5.12, then this will silently pass the block_accelerators check in api.py, get to here, and then snip off the accel_uuids silently.\n\nIMHO, the better thing to do, is not have that block_accelerators decorator (which is super expensive by the way!) and instead raise here if the version pin (which is cached) says that we can\u0027t make this call. Have api.py look for that exception and use that to reject the call.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":1384,"context_line":"        client \u003d self.router.client(ctxt)"},{"line_number":1385,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1386,"context_line":"        if not client.can_send_version(version):"},{"line_number":1387,"context_line":"            msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1388,"context_line":"            version \u003d \u00275.0\u0027"},{"line_number":1389,"context_line":"        cctxt \u003d client.prepare("},{"line_number":1390,"context_line":"                server\u003d_compute_host(None, instance), version\u003dversion)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_3f3e70b7","line":1387,"in_reply_to":"1f621f24_37ddfedf","updated":"2020-11-14 07:38:36.000000000","message":"Good point, I will add.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":1384,"context_line":"        client \u003d self.router.client(ctxt)"},{"line_number":1385,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1386,"context_line":"        if not client.can_send_version(version):"},{"line_number":1387,"context_line":"            msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1388,"context_line":"            version \u003d \u00275.0\u0027"},{"line_number":1389,"context_line":"        cctxt \u003d client.prepare("},{"line_number":1390,"context_line":"                server\u003d_compute_host(None, instance), version\u003dversion)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_971972d8","line":1387,"in_reply_to":"1f621f24_7753f6e2","updated":"2020-11-13 16:21:54.000000000","message":"I agree with Dan here. This is why the func test that pins the rpc to 5.0 passes now even though it should fail instead of ignoring the passed accel_uuids here.\n\nI would refine the condition to something like:\n\n  if not client.can_send_version(version):\n      if accel_uuids:\n          raise ...\n      else:\n          msg_kwargs.pop(\u0027accel_uuids\u0027)\n\nas we don\u0027t have to fail if cannot send accel_uuids but we don\u0027t have any accel_uuids to be sent.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b3ce33146fd3ce5e4c61874dcd944613515f9049","unresolved":false,"context_lines":[{"line_number":1384,"context_line":"        client \u003d self.router.client(ctxt)"},{"line_number":1385,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1386,"context_line":"        if not client.can_send_version(version):"},{"line_number":1387,"context_line":"            msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1388,"context_line":"            version \u003d \u00275.0\u0027"},{"line_number":1389,"context_line":"        cctxt \u003d client.prepare("},{"line_number":1390,"context_line":"                server\u003d_compute_host(None, instance), version\u003dversion)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_37ddfedf","line":1387,"in_reply_to":"1f621f24_971972d8","updated":"2020-11-13 16:31:37.000000000","message":"Just a note, I forgot the service object does its own caching, which makes that decorator less expensive. It\u0027s still a lot of functionality in a decorator, and the general approach still suffers from the problem described above.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5c14b68defcbb436b64bfb3ad44d95bfe23a1ffe","unresolved":false,"context_lines":[{"line_number":1385,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1386,"context_line":"        if not client.can_send_version(version):"},{"line_number":1387,"context_line":"            if accel_uuids:"},{"line_number":1388,"context_line":"                raise exception.ServiceTooOld(_(\u0027nova-compute too old\u0027))"},{"line_number":1389,"context_line":"            else:"},{"line_number":1390,"context_line":"                msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1391,"context_line":"            version \u003d \u00275.0\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"1f621f24_3e9772ee","line":1388,"updated":"2020-11-17 16:43:49.000000000","message":"We have a compute-specific exception, as I mentioned, why aren\u0027t you using that?","commit_id":"9222a83d5b731c9bcb5d6473637d2820037449b5"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"cff4956e5f49027893e90cb461ac3b6c80d1fe8e","unresolved":false,"context_lines":[{"line_number":1385,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1386,"context_line":"        if not client.can_send_version(version):"},{"line_number":1387,"context_line":"            if accel_uuids:"},{"line_number":1388,"context_line":"                raise exception.ServiceTooOld(_(\u0027nova-compute too old\u0027))"},{"line_number":1389,"context_line":"            else:"},{"line_number":1390,"context_line":"                msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1391,"context_line":"            version \u003d \u00275.0\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"1f621f24_7c9d6d09","line":1388,"in_reply_to":"1f621f24_3e9772ee","updated":"2020-11-18 03:02:20.000000000","message":"IMO, they are all can express the same meaning, whichever is ok. But following you.","commit_id":"9222a83d5b731c9bcb5d6473637d2820037449b5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":1386,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1387,"context_line":"        if not client.can_send_version(version):"},{"line_number":1388,"context_line":"            if accel_uuids:"},{"line_number":1389,"context_line":"                LOG.error(\"Failed to extract compute RPC version from service \""},{"line_number":1390,"context_line":"                          \"while shelve instance because I am too old.\")"},{"line_number":1391,"context_line":"                raise exception.TooOldComputeService("},{"line_number":1392,"context_line":"                    utils.raise_if_old_compute)"},{"line_number":1393,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":21,"id":"07102993_f01fbe6e","line":1390,"range":{"start_line":1389,"start_character":26,"end_line":1390,"end_character":71},"updated":"2020-11-24 16:54:35.000000000","message":"This is not correct. I guess what you mean here is that shelve with accelerators is not supported as RPC version is too old.","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"94a483c90c22fa20186b4f809ab3a6381d615b46","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"        version \u003d \u00275.13\u0027"},{"line_number":1387,"context_line":"        if not client.can_send_version(version):"},{"line_number":1388,"context_line":"            if accel_uuids:"},{"line_number":1389,"context_line":"                LOG.error(\"Failed to extract compute RPC version from service \""},{"line_number":1390,"context_line":"                          \"while shelve instance because I am too old.\")"},{"line_number":1391,"context_line":"                raise exception.TooOldComputeService("},{"line_number":1392,"context_line":"                    utils.raise_if_old_compute)"},{"line_number":1393,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":21,"id":"8a54e4b1_eb1820e7","line":1390,"range":{"start_line":1389,"start_character":26,"end_line":1390,"end_character":71},"in_reply_to":"07102993_f01fbe6e","updated":"2020-11-27 09:29:53.000000000","message":"Done","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":1388,"context_line":"            if accel_uuids:"},{"line_number":1389,"context_line":"                LOG.error(\"Failed to extract compute RPC version from service \""},{"line_number":1390,"context_line":"                          \"while shelve instance because I am too old.\")"},{"line_number":1391,"context_line":"                raise exception.TooOldComputeService("},{"line_number":1392,"context_line":"                    utils.raise_if_old_compute)"},{"line_number":1393,"context_line":"            else:"},{"line_number":1394,"context_line":"                msg_kwargs.pop(\u0027accel_uuids\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"5019ab2a_77afaad5","line":1391,"range":{"start_line":1391,"start_character":32,"end_line":1391,"end_character":52},"updated":"2020-11-24 16:54:35.000000000","message":"this could also be a exception.ForbiddenWithAccelerator. If it is TooOldComputeService then this exception needs to be handled on the compute/api side.","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"94a483c90c22fa20186b4f809ab3a6381d615b46","unresolved":false,"context_lines":[{"line_number":1388,"context_line":"            if accel_uuids:"},{"line_number":1389,"context_line":"                LOG.error(\"Failed to extract compute RPC version from service \""},{"line_number":1390,"context_line":"                          \"while shelve instance because I am too old.\")"},{"line_number":1391,"context_line":"                raise exception.TooOldComputeService("},{"line_number":1392,"context_line":"                    utils.raise_if_old_compute)"},{"line_number":1393,"context_line":"            else:"},{"line_number":1394,"context_line":"                msg_kwargs.pop(\u0027accel_uuids\u0027)"}],"source_content_type":"text/x-python","patch_set":21,"id":"cbaa75b3_a25e9e4c","line":1391,"range":{"start_line":1391,"start_character":32,"end_line":1391,"end_character":52},"in_reply_to":"5019ab2a_77afaad5","updated":"2020-11-27 09:29:53.000000000","message":"Done","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":1388,"context_line":"            if accel_uuids:"},{"line_number":1389,"context_line":"                LOG.error(\"Failed to extract compute RPC version from service \""},{"line_number":1390,"context_line":"                          \"while shelve instance because I am too old.\")"},{"line_number":1391,"context_line":"                raise exception.TooOldComputeService("},{"line_number":1392,"context_line":"                    utils.raise_if_old_compute)"},{"line_number":1393,"context_line":"            else:"},{"line_number":1394,"context_line":"                msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1395,"context_line":"            version \u003d \u00275.0\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"50c238a8_f1616ac6","line":1392,"range":{"start_line":1391,"start_character":22,"end_line":1392,"end_character":47},"updated":"2020-11-24 16:54:35.000000000","message":"this is odd. Why do you pass a function to this execption as a parameter?","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"94a483c90c22fa20186b4f809ab3a6381d615b46","unresolved":false,"context_lines":[{"line_number":1388,"context_line":"            if accel_uuids:"},{"line_number":1389,"context_line":"                LOG.error(\"Failed to extract compute RPC version from service \""},{"line_number":1390,"context_line":"                          \"while shelve instance because I am too old.\")"},{"line_number":1391,"context_line":"                raise exception.TooOldComputeService("},{"line_number":1392,"context_line":"                    utils.raise_if_old_compute)"},{"line_number":1393,"context_line":"            else:"},{"line_number":1394,"context_line":"                msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1395,"context_line":"            version \u003d \u00275.0\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"8ad338cb_03dd2b04","line":1392,"range":{"start_line":1391,"start_character":22,"end_line":1392,"end_character":47},"in_reply_to":"50c238a8_f1616ac6","updated":"2020-11-27 09:29:53.000000000","message":"Done","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":1428,"context_line":"        client \u003d self.router.client(ctxt)"},{"line_number":1429,"context_line":""},{"line_number":1430,"context_line":"        if not client.can_send_version(version):"},{"line_number":1431,"context_line":"            msg_kwargs.pop(\u0027accel_uuids\u0027)"},{"line_number":1432,"context_line":"            version \u003d \u00275.2\u0027"},{"line_number":1433,"context_line":"        if not client.can_send_version(version):"},{"line_number":1434,"context_line":"            msg_kwargs.pop(\u0027request_spec\u0027)"},{"line_number":1435,"context_line":"            version \u003d \u00275.0\u0027"},{"line_number":1436,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"def104a6_a86598de","line":1433,"range":{"start_line":1431,"start_character":1,"end_line":1433,"end_character":1},"updated":"2020-11-24 16:54:35.000000000","message":"It is still OK as shelve can only happen with 5.13 so we can only have shelved instance if we are on 5.13 already. So accel_uuids cannot be not None here.","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"}],"nova/conductor/manager.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a6c237a96a1037645505172440ddb085d4ca3019","unresolved":false,"context_lines":[{"line_number":969,"context_line":"                    external_resources +\u003d ("},{"line_number":970,"context_line":"                        self.network_api.get_requested_resource_for_instance("},{"line_number":971,"context_line":"                            context, instance.uuid))"},{"line_number":972,"context_line":"                    # NOTE(gibi): When cyborg or other module wants to handle"},{"line_number":973,"context_line":"                    # similar non-nova resources then here we have to collect"},{"line_number":974,"context_line":"                    # all the external resource requests in a single list and"},{"line_number":975,"context_line":"                    # add them to the RequestSpec."},{"line_number":976,"context_line":"                    extra_specs \u003d request_spec.flavor.extra_specs"},{"line_number":977,"context_line":"                    device_profile \u003d extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":978,"context_line":"                    external_resources.extend("}],"source_content_type":"text/x-python","patch_set":8,"id":"bf51134e_376496e5","line":975,"range":{"start_line":972,"start_character":0,"end_line":975,"end_character":50},"updated":"2020-07-20 11:15:28.000000000","message":"please rephrase it as cyborg case is already covered by the below code","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"090ca6cc552617dd74b28f9ecd5bb93f29c049a0","unresolved":false,"context_lines":[{"line_number":969,"context_line":"                    external_resources +\u003d ("},{"line_number":970,"context_line":"                        self.network_api.get_requested_resource_for_instance("},{"line_number":971,"context_line":"                            context, instance.uuid))"},{"line_number":972,"context_line":"                    # NOTE(gibi): When cyborg or other module wants to handle"},{"line_number":973,"context_line":"                    # similar non-nova resources then here we have to collect"},{"line_number":974,"context_line":"                    # all the external resource requests in a single list and"},{"line_number":975,"context_line":"                    # add them to the RequestSpec."},{"line_number":976,"context_line":"                    extra_specs \u003d request_spec.flavor.extra_specs"},{"line_number":977,"context_line":"                    device_profile \u003d extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":978,"context_line":"                    external_resources.extend("}],"source_content_type":"text/x-python","patch_set":8,"id":"9f560f44_817a30b7","line":975,"range":{"start_line":972,"start_character":0,"end_line":975,"end_character":50},"in_reply_to":"bf51134e_376496e5","updated":"2020-09-08 07:50:24.000000000","message":"Done","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"a6c237a96a1037645505172440ddb085d4ca3019","unresolved":false,"context_lines":[{"line_number":1261,"context_line":"                accel_uuids\u003daccel_uuids)"},{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def _get_arq_uuids_for_instance("},{"line_number":1264,"context_line":"            self, context, instance, host, request_spec, evacuate\u003dFalse,"},{"line_number":1265,"context_line":"            offload\u003dFalse):"},{"line_number":1266,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":1267,"context_line":"        if not dp_name:"},{"line_number":1268,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":8,"id":"bf51134e_d798bacd","line":1265,"range":{"start_line":1264,"start_character":57,"end_line":1265,"end_character":25},"updated":"2020-07-20 11:15:28.000000000","message":"You will never call this function with evacuate\u003dTrue offload\u003dTrue\n\nYou can combine these and express the intent in the signature. This single param can be named like \u0027recreate_accelerators\u0027","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"090ca6cc552617dd74b28f9ecd5bb93f29c049a0","unresolved":false,"context_lines":[{"line_number":1261,"context_line":"                accel_uuids\u003daccel_uuids)"},{"line_number":1262,"context_line":""},{"line_number":1263,"context_line":"    def _get_arq_uuids_for_instance("},{"line_number":1264,"context_line":"            self, context, instance, host, request_spec, evacuate\u003dFalse,"},{"line_number":1265,"context_line":"            offload\u003dFalse):"},{"line_number":1266,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":1267,"context_line":"        if not dp_name:"},{"line_number":1268,"context_line":"            return []"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f560f44_fccd8fb7","line":1265,"range":{"start_line":1264,"start_character":57,"end_line":1265,"end_character":25},"in_reply_to":"bf51134e_d798bacd","updated":"2020-09-08 07:50:24.000000000","message":"Done","commit_id":"05c076a9b82471fb71f5b27471ed4333e82f96d5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"844a87b45abc69258eda4b5f857266658c666433","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"9f560f44_098d797b","updated":"2020-09-08 15:15:21.000000000","message":"I don\u0027t think that the changes in this file are covered by unit test","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"844a87b45abc69258eda4b5f857266658c666433","unresolved":false,"context_lines":[{"line_number":1005,"context_line":""},{"line_number":1006,"context_line":"                    accel_uuids \u003d self._get_arq_uuids_for_instance("},{"line_number":1007,"context_line":"                        context, instance, host, request_spec,"},{"line_number":1008,"context_line":"                        recreate_accels\u003dTrue)"},{"line_number":1009,"context_line":"                    self.compute_rpcapi.unshelve_instance("},{"line_number":1010,"context_line":"                        context, instance, host, request_spec, image\u003dimage,"},{"line_number":1011,"context_line":"                        filter_properties\u003dfilter_properties, node\u003dnode,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f560f44_6c66c8ef","line":1008,"updated":"2020-09-08 15:15:21.000000000","message":"OK, this is in the unshelve-after-shelve-offload codepath so we do need to create new accelerators on the dest host. I guess the delete of the accelerators on the source is a no-op as shelve_offload already deleted those.","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"cf15f9ac7dc1f70210e2627426c87c1a7339a9f1","unresolved":false,"context_lines":[{"line_number":1272,"context_line":""},{"line_number":1273,"context_line":"    def _get_arq_uuids_for_instance("},{"line_number":1274,"context_line":"            self, context, instance, host, request_spec,"},{"line_number":1275,"context_line":"            recreate_accels\u003dFalse):"},{"line_number":1276,"context_line":"        if not instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":1277,"context_line":"            return []"},{"line_number":1278,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9f560f44_b14839b3","line":1275,"range":{"start_line":1275,"start_character":12,"end_line":1275,"end_character":27},"updated":"2020-09-08 13:43:20.000000000","message":"ya this make more sense now that its reused for other move operations","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"aac151bf860e41a6e2b26384c192dbb2458e29a2","unresolved":false,"context_lines":[{"line_number":1272,"context_line":""},{"line_number":1273,"context_line":"    def _get_arq_uuids_for_instance("},{"line_number":1274,"context_line":"            self, context, instance, host, request_spec,"},{"line_number":1275,"context_line":"            recreate_accels\u003dFalse):"},{"line_number":1276,"context_line":"        if not instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):"},{"line_number":1277,"context_line":"            return []"},{"line_number":1278,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9f560f44_3eecdfb9","line":1275,"range":{"start_line":1275,"start_character":12,"end_line":1275,"end_character":27},"in_reply_to":"9f560f44_b14839b3","updated":"2020-09-09 10:56:02.000000000","message":"This is not correctly, as gibi said in https://review.opendev.org/#/c/729563/11/nova/conductor/manager.py@1008, when we are shelving the instance the arqs have already deleted, when we unshelve the instance, we will set \u0027recreate_accels\u003dTrue\u0027, than we will delete the bound arq(L1281) again, it will be raised an 404 error.\n\nSo we restored this change","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"df34714c947fd80c0552d0cbfe2136e3f530122a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"9f560f44_6726b0cd","updated":"2020-09-10 15:10:33.000000000","message":"Only _get_arq_uuids_for_instance is covered in unit test please cover the rest of the changes","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"f9960ff6996e29d10faa05a3aae9df815e010e33","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"9f560f44_7a091193","in_reply_to":"9f560f44_6726b0cd","updated":"2020-09-11 11:24:24.000000000","message":"Done","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"df34714c947fd80c0552d0cbfe2136e3f530122a","unresolved":false,"context_lines":[{"line_number":1272,"context_line":""},{"line_number":1273,"context_line":"    def _get_arq_uuids_for_instance("},{"line_number":1274,"context_line":"            self, context, instance, host, request_spec,"},{"line_number":1275,"context_line":"            evacuate\u003dFalse, offload\u003dFalse):"},{"line_number":1276,"context_line":"        \"\"\"This method will return the accelerator uuids for the"},{"line_number":1277,"context_line":"        instance when we do evacuate or unshelve an instance."},{"line_number":1278,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_ddc2ee33","line":1275,"updated":"2020-09-10 15:10:33.000000000","message":"I don\u0027t like the list of boolean flags to drive what the function do[1].  I think two functions would be better\n1) delete_arqs():\n    if not  instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027):\n            return []\n  cyclient.delete_arqs_by_uuid(instance.uuid)\n\n2) create arqs():\n            resource_provider_mapping \u003d (\n                request_spec.get_request_group_mapping())\n            return self._create_and_bind_arqs(\n                context, instance.uuid, instance.flavor.extra_specs,\n                host, resource_provider_mapping)\n        return cyclient.get_arq_uuids_for_instance(instance)\n\nAnd then for evac you call both 1) and 2) for unshelve you only call 2) from the given compute manage method\n\n\n[1] https://martinfowler.com/bliki/FlagArgument.html","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"f9960ff6996e29d10faa05a3aae9df815e010e33","unresolved":false,"context_lines":[{"line_number":1272,"context_line":""},{"line_number":1273,"context_line":"    def _get_arq_uuids_for_instance("},{"line_number":1274,"context_line":"            self, context, instance, host, request_spec,"},{"line_number":1275,"context_line":"            evacuate\u003dFalse, offload\u003dFalse):"},{"line_number":1276,"context_line":"        \"\"\"This method will return the accelerator uuids for the"},{"line_number":1277,"context_line":"        instance when we do evacuate or unshelve an instance."},{"line_number":1278,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_dafc9d73","line":1275,"in_reply_to":"9f560f44_ddc2ee33","updated":"2020-09-11 11:24:24.000000000","message":"refactor this segment, please review again.","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":864,"context_line":"        try:"},{"line_number":865,"context_line":"            resource_provider_mapping \u003d ("},{"line_number":866,"context_line":"                request_spec.get_request_group_mapping())"},{"line_number":867,"context_line":"            # Using nodename instead of hostname. See:"},{"line_number":868,"context_line":"            # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":869,"context_line":"            return self._create_and_bind_arqs("},{"line_number":870,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_0d7f3715","line":867,"range":{"start_line":867,"start_character":0,"end_line":867,"end_character":54},"updated":"2020-11-11 16:01:05.000000000","message":"Now this log became confusing as there is no explicit nodename in the call below any more. \n\nIn the other hand now the callers of _create_and_bind_arq_for_instance() is expected to pass in a nodename instead of the service hostname. So you have to go and change all the places where _create_and_bind_arq_for_instance() is called.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                    filter_properties \u003d request_spec.\\"},{"line_number":965,"context_line":"                        to_legacy_filter_properties_dict()"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"                    external_resources \u003d []"},{"line_number":968,"context_line":"                    external_resources +\u003d ("},{"line_number":969,"context_line":"                        self.network_api.get_requested_resource_for_instance("},{"line_number":970,"context_line":"                            context, instance.uuid))"},{"line_number":971,"context_line":"                    extra_specs \u003d request_spec.flavor.extra_specs"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_8db987cd","line":968,"range":{"start_line":967,"start_character":20,"end_line":968,"end_character":40},"updated":"2020-11-11 16:01:05.000000000","message":"No need to append to the empty list. You can say this with a single line simply:\n\n    external_resources \u003d self.network_api....","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"883a71c35cdd1be44a463974e3dd2bc2ad5ee61a","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                    filter_properties \u003d request_spec.\\"},{"line_number":965,"context_line":"                        to_legacy_filter_properties_dict()"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"                    external_resources \u003d []"},{"line_number":968,"context_line":"                    external_resources +\u003d ("},{"line_number":969,"context_line":"                        self.network_api.get_requested_resource_for_instance("},{"line_number":970,"context_line":"                            context, instance.uuid))"},{"line_number":971,"context_line":"                    extra_specs \u003d request_spec.flavor.extra_specs"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_91719447","line":968,"range":{"start_line":967,"start_character":20,"end_line":968,"end_character":40},"in_reply_to":"1f621f24_8db987cd","updated":"2020-11-12 11:42:21.000000000","message":"By your suggestion we will get the test error, I am not sure which caused this :(\n\nroot@ubuntu:/home/brinzhang/nova# python3 -m unittest nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_unshelve_instance_resource_request_with_device_profile\nModules with known eventlet monkey patching issues were imported prior to eventlet monkey patching: urllib3, oslo_context.context. This warning can usually be ignored if the caller is only importing and not executing nova code.\nF\n\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\nFAIL: test_unshelve_instance_resource_request_with_device_profile (nova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase)\nnova.tests.unit.conductor.test_conductor.ConductorTaskAPITestCase.test_unshelve_instance_resource_request_with_device_profile\n----------------------------------------------------------------------\ntesttools.testresult.real._StringException: pythonlogging:\u0027\u0027: {{{\n2020-11-12 11:35:58,122 INFO [248_add_expire_reservations_index] Skipped adding reservations_deleted_expire_idx because an equivalent index already exists.\n2020-11-12 11:36:02,764 WARNING [oslo_policy.policy] JSON formatted policy_file support is deprecated since Victoria release. You need to use YAML format which will be default in future. You can use ``oslopolicy-convert-json-to-yaml`` tool to convert existing JSON-formatted policy file to YAML-formatted in backward compatible way: https://docs.openstack.org/oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html.\n2020-11-12 11:36:02,765 WARNING [oslo_policy.policy] JSON formatted policy_file support is deprecated since Victoria release. You need to use YAML format which will be default in future. You can use ``oslopolicy-convert-json-to-yaml`` tool to convert existing JSON-formatted policy file to YAML-formatted in backward compatible way: https://docs.openstack.org/oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html.\n2020-11-12 11:36:02,767 WARNING [oslo_policy.policy] Policy Rules [\u0027os_compute_api:extensions\u0027, \u0027os_compute_api:os-floating-ip-pools\u0027, \u0027os_compute_api:os-quota-sets:defaults\u0027, \u0027os_compute_api:os-availability-zone:list\u0027, \u0027os_compute_api:limits\u0027, \u0027system_admin_api\u0027, \u0027system_reader_api\u0027, \u0027project_admin_api\u0027, \u0027project_member_api\u0027, \u0027project_reader_api\u0027, \u0027system_admin_or_owner\u0027, \u0027system_or_project_reader\u0027, \u0027os_compute_api:limits:other_project\u0027, \u0027os_compute_api:os-lock-server:unlock:unlock_override\u0027, \u0027os_compute_api:servers:create:zero_disk_flavor\u0027, \u0027compute:servers:resize:cross_cell\u0027] specified in policy files are the same as the defaults provided by the service. You can remove these rules from policy files which will make maintenance easier. You can detect these redundant rules by ``oslopolicy-list-redundant`` tool also.\n2020-11-12 11:36:02,933 INFO [nova.virt.driver] Loading compute driver \u0027fake.SmallFakeDriver\u0027\n2020-11-12 11:36:02,936 INFO [nova.compute.provider_config] No provider configs found in /etc/nova/provider_config/. If files are present, ensure the Nova process has access.\n2020-11-12 11:36:02,943 INFO [nova.compute.provider_config] No provider configs found in /etc/nova/provider_config/. If files are present, ensure the Nova process has access.\n2020-11-12 11:36:02,944 INFO [nova.compute.manager] Deleting orphan compute node 2 hypervisor host is fake_phyp1, nodes are {\u0027fakenode2\u0027, \u0027fakenode1\u0027}\n2020-11-12 11:36:02,953 ERROR [nova.compute.manager] Failed to delete compute node resource provider for compute node db5604bc-9a63-49cd-9d65-a5d375c0f3b5: An auth plugin is required to determine endpoint URL\n2020-11-12 11:36:02,961 WARNING [nova.compute.resource_tracker] No compute node record for fake-mini:fakenode2\n2020-11-12 11:36:02,968 INFO [nova.compute.resource_tracker] Compute node record created for fake-mini:fakenode2 with uuid: 8694cd17-be1d-4395-a339-e86f06f95b7c\n2020-11-12 11:36:03,050 WARNING [nova.compute.resource_tracker] No compute node record for fake-mini:fakenode1\n2020-11-12 11:36:03,065 INFO [nova.compute.resource_tracker] Compute node record created for fake-mini:fakenode1 with uuid: 8caaec8e-da07-425a-a228-4a82a92e282f\n2020-11-12 11:36:03,134 INFO [nova.service] Starting conductor node (version 22.1.0)\n}}}\n\nTraceback (most recent call last):\n  File \"/usr/local/lib/python3.8/dist-packages/mock/mock.py\", line 1369, in patched\n    return func(*newargs, **newkeywargs)\n  File \"/home/brinzhang/nova/nova/tests/unit/conductor/test_conductor.py\", line 1677, in test_unshelve_instance_resource_request_with_device_profile\n    self.assertEqual(res_req, request_spec.requested_resources)\n  File \"/usr/local/lib/python3.8/dist-packages/testtools/testcase.py\", line 415, in assertEqual\n    self.assertThat(observed, matcher, message)\n  File \"/usr/local/lib/python3.8/dist-packages/testtools/testcase.py\", line 502, in assertThat\n    raise mismatch_error\ntesttools.matchers._impl.MismatchError: !\u003d:\nreference \u003d [RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003dNone,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue),\n RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003d\u0027deviceprofile2\u0027,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue),\n RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003d\u0027deviceprofile3\u0027,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue),\n RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003d\u0027deviceprofile2\u0027,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue),\n RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003d\u0027deviceprofile3\u0027,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue)]\nactual    \u003d [RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003dNone,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue),\n RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003d\u0027deviceprofile2\u0027,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue),\n RequestGroup(aggregates\u003d[],forbidden_aggregates\u003dset([]),forbidden_traits\u003dset([]),in_tree\u003dNone,provider_uuids\u003d[],requester_id\u003d\u0027deviceprofile3\u0027,required_traits\u003dset([]),resources\u003d{},use_same_provider\u003dTrue)]\n\n\n----------------------------------------------------------------------\nRan 1 test in 9.144s\n\nFAILED (failures\u003d1)","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                    filter_properties \u003d request_spec.\\"},{"line_number":965,"context_line":"                        to_legacy_filter_properties_dict()"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"                    external_resources \u003d []"},{"line_number":968,"context_line":"                    external_resources +\u003d ("},{"line_number":969,"context_line":"                        self.network_api.get_requested_resource_for_instance("},{"line_number":970,"context_line":"                            context, instance.uuid))"},{"line_number":971,"context_line":"                    extra_specs \u003d request_spec.flavor.extra_specs"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_f60e0339","line":968,"range":{"start_line":967,"start_character":20,"end_line":968,"end_character":40},"in_reply_to":"1f621f24_8db987cd","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b88473575020a9b3455f4b6e442534328a9e28f4","unresolved":false,"context_lines":[{"line_number":964,"context_line":"                    filter_properties \u003d request_spec.\\"},{"line_number":965,"context_line":"                        to_legacy_filter_properties_dict()"},{"line_number":966,"context_line":""},{"line_number":967,"context_line":"                    external_resources \u003d []"},{"line_number":968,"context_line":"                    external_resources +\u003d ("},{"line_number":969,"context_line":"                        self.network_api.get_requested_resource_for_instance("},{"line_number":970,"context_line":"                            context, instance.uuid))"},{"line_number":971,"context_line":"                    extra_specs \u003d request_spec.flavor.extra_specs"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_b49d9e67","line":968,"range":{"start_line":967,"start_character":20,"end_line":968,"end_character":40},"in_reply_to":"1f621f24_91719447","updated":"2020-11-12 12:53:53.000000000","message":"Later: get details, the test cases need to be fixed, done.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"                    # NOTE(brinzhang): For unshelve operation we should"},{"line_number":1007,"context_line":"                    # re-create-and-bound the arqs for the instance."},{"line_number":1008,"context_line":"                    accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1009,"context_line":"                        context, instance, host, request_spec)"},{"line_number":1010,"context_line":"                    self.compute_rpcapi.unshelve_instance("},{"line_number":1011,"context_line":"                        context, instance, host, request_spec, image\u003dimage,"},{"line_number":1012,"context_line":"                        filter_properties\u003dfilter_properties, node\u003dnode,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_ed3c7b30","line":1009,"range":{"start_line":1009,"start_character":43,"end_line":1009,"end_character":47},"updated":"2020-11-11 16:01:05.000000000","message":"is this now the nodename? This patch changes what _create_and_bind_arq_for_instance() expects. It is now expect the compute node name.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"                    # NOTE(brinzhang): For unshelve operation we should"},{"line_number":1007,"context_line":"                    # re-create-and-bound the arqs for the instance."},{"line_number":1008,"context_line":"                    accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1009,"context_line":"                        context, instance, host, request_spec)"},{"line_number":1010,"context_line":"                    self.compute_rpcapi.unshelve_instance("},{"line_number":1011,"context_line":"                        context, instance, host, request_spec, image\u003dimage,"},{"line_number":1012,"context_line":"                        filter_properties\u003dfilter_properties, node\u003dnode,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_ac16e5a6","line":1009,"range":{"start_line":1009,"start_character":43,"end_line":1009,"end_character":47},"in_reply_to":"1f621f24_16029f0b","updated":"2020-11-13 16:21:54.000000000","message":"But as far as I understand _create_and_bind_arq_for_instance needs nodename. Isn\u0027t it? At least there are cases when you pass in nodename. I think you need to be consistent.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"                    # NOTE(brinzhang): For unshelve operation we should"},{"line_number":1007,"context_line":"                    # re-create-and-bound the arqs for the instance."},{"line_number":1008,"context_line":"                    accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1009,"context_line":"                        context, instance, host, request_spec)"},{"line_number":1010,"context_line":"                    self.compute_rpcapi.unshelve_instance("},{"line_number":1011,"context_line":"                        context, instance, host, request_spec, image\u003dimage,"},{"line_number":1012,"context_line":"                        filter_properties\u003dfilter_properties, node\u003dnode,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_1f21f49f","line":1009,"range":{"start_line":1009,"start_character":43,"end_line":1009,"end_character":47},"in_reply_to":"1f621f24_ac16e5a6","updated":"2020-11-14 07:38:36.000000000","message":"yes.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":1006,"context_line":"                    # NOTE(brinzhang): For unshelve operation we should"},{"line_number":1007,"context_line":"                    # re-create-and-bound the arqs for the instance."},{"line_number":1008,"context_line":"                    accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1009,"context_line":"                        context, instance, host, request_spec)"},{"line_number":1010,"context_line":"                    self.compute_rpcapi.unshelve_instance("},{"line_number":1011,"context_line":"                        context, instance, host, request_spec, image\u003dimage,"},{"line_number":1012,"context_line":"                        filter_properties\u003dfilter_properties, node\u003dnode,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_16029f0b","line":1009,"range":{"start_line":1009,"start_character":43,"end_line":1009,"end_character":47},"in_reply_to":"1f621f24_ed3c7b30","updated":"2020-11-12 10:51:41.000000000","message":"Here, host equals hostname, defined in Line 998.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":1247,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1248,"context_line":"                    if evacuate:"},{"line_number":1249,"context_line":"                        # NOTE(brinzhang): For evacuate operation we should"},{"line_number":1250,"context_line":"                        # delete the bound arqs, than re-create-and-bound the"},{"line_number":1251,"context_line":"                        # arqs for the instance."},{"line_number":1252,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1253,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_8ddea70e","line":1250,"range":{"start_line":1250,"start_character":49,"end_line":1250,"end_character":53},"updated":"2020-11-11 16:01:05.000000000","message":"then","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":1247,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1248,"context_line":"                    if evacuate:"},{"line_number":1249,"context_line":"                        # NOTE(brinzhang): For evacuate operation we should"},{"line_number":1250,"context_line":"                        # delete the bound arqs, than re-create-and-bound the"},{"line_number":1251,"context_line":"                        # arqs for the instance."},{"line_number":1252,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1253,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_f113ad5a","line":1250,"range":{"start_line":1250,"start_character":49,"end_line":1250,"end_character":53},"in_reply_to":"1f621f24_8ddea70e","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":1251,"context_line":"                        # arqs for the instance."},{"line_number":1252,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1253,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1254,"context_line":"                            context, instance, host, request_spec)"},{"line_number":1255,"context_line":"                    else:"},{"line_number":1256,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1257,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_cd809fc2","line":1254,"range":{"start_line":1254,"start_character":47,"end_line":1254,"end_character":51},"updated":"2020-11-11 16:01:05.000000000","message":"is this a nodename now?","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":1251,"context_line":"                        # arqs for the instance."},{"line_number":1252,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1253,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1254,"context_line":"                            context, instance, host, request_spec)"},{"line_number":1255,"context_line":"                    else:"},{"line_number":1256,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1257,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_4c1bd1c8","line":1254,"range":{"start_line":1254,"start_character":47,"end_line":1254,"end_character":51},"in_reply_to":"1f621f24_11174947","updated":"2020-11-13 16:21:54.000000000","message":"I think you are now mixing passing nodename and hostname to _create_and_bind_arq_for_instance()","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":1251,"context_line":"                        # arqs for the instance."},{"line_number":1252,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1253,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1254,"context_line":"                            context, instance, host, request_spec)"},{"line_number":1255,"context_line":"                    else:"},{"line_number":1256,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1257,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_11174947","line":1254,"range":{"start_line":1254,"start_character":47,"end_line":1254,"end_character":51},"in_reply_to":"1f621f24_cd809fc2","updated":"2020-11-12 10:51:41.000000000","message":"Here, host is hostname, defined in line1200.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":1681,"context_line":""},{"line_number":1682,"context_line":"            try:"},{"line_number":1683,"context_line":"                accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1684,"context_line":"                        context, instance, host.nodename, request_spec)"},{"line_number":1685,"context_line":"            except Exception as exc:"},{"line_number":1686,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1687,"context_line":"                    self._cleanup_build_artifacts("}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_ad8563d1","line":1684,"range":{"start_line":1684,"start_character":43,"end_line":1684,"end_character":56},"updated":"2020-11-11 16:01:05.000000000","message":"this is OK.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":1681,"context_line":""},{"line_number":1682,"context_line":"            try:"},{"line_number":1683,"context_line":"                accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1684,"context_line":"                        context, instance, host.nodename, request_spec)"},{"line_number":1685,"context_line":"            except Exception as exc:"},{"line_number":1686,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1687,"context_line":"                    self._cleanup_build_artifacts("}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_4c4911b5","line":1684,"range":{"start_line":1684,"start_character":43,"end_line":1684,"end_character":56},"in_reply_to":"1f621f24_1129099a","updated":"2020-11-13 16:21:54.000000000","message":"No, this is OK as it is a nodename instead of a hostname. You need to be consistent what you pass in _create_and_bind_arq_for_instance. I think the comment at L867 was about to use nodenames.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":1681,"context_line":""},{"line_number":1682,"context_line":"            try:"},{"line_number":1683,"context_line":"                accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1684,"context_line":"                        context, instance, host.nodename, request_spec)"},{"line_number":1685,"context_line":"            except Exception as exc:"},{"line_number":1686,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1687,"context_line":"                    self._cleanup_build_artifacts("}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_ff2358a5","line":1684,"range":{"start_line":1684,"start_character":43,"end_line":1684,"end_character":56},"in_reply_to":"1f621f24_4c4911b5","updated":"2020-11-14 07:38:36.000000000","message":"yes, _create_and_bind_arq_for_instance accept the parameter should be a nodename, as the comment inline.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":1681,"context_line":""},{"line_number":1682,"context_line":"            try:"},{"line_number":1683,"context_line":"                accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1684,"context_line":"                        context, instance, host.nodename, request_spec)"},{"line_number":1685,"context_line":"            except Exception as exc:"},{"line_number":1686,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1687,"context_line":"                    self._cleanup_build_artifacts("}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_1129099a","line":1684,"range":{"start_line":1684,"start_character":43,"end_line":1684,"end_character":56},"in_reply_to":"1f621f24_ad8563d1","updated":"2020-11-12 10:51:41.000000000","message":"Yes, this is defined in Line1629, \u0027host\u0027 is an object.","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":1002,"context_line":""},{"line_number":1003,"context_line":"                    # NOTE(brinzhang): For unshelve operation we should"},{"line_number":1004,"context_line":"                    # re-create-and-bound the arqs for the instance."},{"line_number":1005,"context_line":"                    # NOTE(brinzhang): Here, host equals hostname,"},{"line_number":1006,"context_line":"                    # defined above."},{"line_number":1007,"context_line":"                    accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1008,"context_line":"                        context, instance, host, request_spec)"},{"line_number":1009,"context_line":"                    self.compute_rpcapi.unshelve_instance("},{"line_number":1010,"context_line":"                        context, instance, host, request_spec, image\u003dimage,"},{"line_number":1011,"context_line":"                        filter_properties\u003dfilter_properties, node\u003dnode,"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_cc0fe185","line":1008,"range":{"start_line":1005,"start_character":0,"end_line":1008,"end_character":62},"updated":"2020-11-13 16:21:54.000000000","message":"See my reply in PS14","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":1002,"context_line":""},{"line_number":1003,"context_line":"                    # NOTE(brinzhang): For unshelve operation we should"},{"line_number":1004,"context_line":"                    # re-create-and-bound the arqs for the instance."},{"line_number":1005,"context_line":"                    # NOTE(brinzhang): Here, host equals hostname,"},{"line_number":1006,"context_line":"                    # defined above."},{"line_number":1007,"context_line":"                    accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1008,"context_line":"                        context, instance, host, request_spec)"},{"line_number":1009,"context_line":"                    self.compute_rpcapi.unshelve_instance("},{"line_number":1010,"context_line":"                        context, instance, host, request_spec, image\u003dimage,"},{"line_number":1011,"context_line":"                        filter_properties\u003dfilter_properties, node\u003dnode,"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_5f3eccc0","line":1008,"range":{"start_line":1005,"start_character":0,"end_line":1008,"end_character":62},"in_reply_to":"1f621f24_cc0fe185","updated":"2020-11-14 07:38:36.000000000","message":"Done","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":1248,"context_line":"                        # NOTE(brinzhang): For evacuate operation we should"},{"line_number":1249,"context_line":"                        # delete the bound arqs, then re-create-and-bound the"},{"line_number":1250,"context_line":"                        # arqs for the instance."},{"line_number":1251,"context_line":"                        # NOTE(brinzhang): Here, host equals hostname,"},{"line_number":1252,"context_line":"                        # defined above."},{"line_number":1253,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1254,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1255,"context_line":"                            context, instance, host, request_spec)"},{"line_number":1256,"context_line":"                    else:"},{"line_number":1257,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1258,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_ec81fdc4","line":1255,"range":{"start_line":1251,"start_character":0,"end_line":1255,"end_character":66},"updated":"2020-11-13 16:21:54.000000000","message":"See my reply in PS14","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":1248,"context_line":"                        # NOTE(brinzhang): For evacuate operation we should"},{"line_number":1249,"context_line":"                        # delete the bound arqs, then re-create-and-bound the"},{"line_number":1250,"context_line":"                        # arqs for the instance."},{"line_number":1251,"context_line":"                        # NOTE(brinzhang): Here, host equals hostname,"},{"line_number":1252,"context_line":"                        # defined above."},{"line_number":1253,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1254,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1255,"context_line":"                            context, instance, host, request_spec)"},{"line_number":1256,"context_line":"                    else:"},{"line_number":1257,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1258,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_3f3950d6","line":1255,"range":{"start_line":1251,"start_character":0,"end_line":1255,"end_character":66},"in_reply_to":"1f621f24_ec81fdc4","updated":"2020-11-14 07:38:36.000000000","message":"Done","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":868,"context_line":"            # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":869,"context_line":"            return self._create_and_bind_arqs("},{"line_number":870,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":871,"context_line":"                hostname, resource_provider_mapping)"},{"line_number":872,"context_line":"        except exception.AcceleratorRequestBindingFailed as exc:"},{"line_number":873,"context_line":"            # If anything failed here we need to cleanup and bail out."},{"line_number":874,"context_line":"            cyclient \u003d cyborg.get_client(context)"}],"source_content_type":"text/x-python","patch_set":21,"id":"4f6ff8a4_1bb8d8a3","line":871,"range":{"start_line":871,"start_character":16,"end_line":871,"end_character":24},"updated":"2020-11-24 16:54:35.000000000","message":"OK all the callers are passing the nodename as hostname now.","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"b108a9f58dede9ecf15c453020d339d521dc9880","unresolved":true,"context_lines":[{"line_number":1253,"context_line":"                request_spec\u003drequest_spec,"},{"line_number":1254,"context_line":"                accel_uuids\u003daccel_uuids)"},{"line_number":1255,"context_line":""},{"line_number":1256,"context_line":"    def _rebuild_cyborg_arq("},{"line_number":1257,"context_line":"            self, context, instance, host, request_spec, evacuate):"},{"line_number":1258,"context_line":"        dp_name \u003d instance.flavor.extra_specs.get(\u0027accel:device_profile\u0027)"},{"line_number":1259,"context_line":"        if not dp_name:"}],"source_content_type":"text/x-python","patch_set":26,"id":"9b8d1eff_46792c9b","side":"PARENT","line":1256,"range":{"start_line":1256,"start_character":8,"end_line":1256,"end_character":27},"updated":"2021-01-05 17:05:58.000000000","message":"this is the function that was folded in in previous iteration this was exteded to supprot sheleve instead.","commit_id":"261416aeb0187cc7d420bb74d8b330aa66cc37b6"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"243e32c9afe6d180af009f26033138683e4b6ead","unresolved":true,"context_lines":[{"line_number":838,"context_line":""},{"line_number":839,"context_line":"            try:"},{"line_number":840,"context_line":"                accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":841,"context_line":"                    context, instance, host.nodename, local_reqspec)"},{"line_number":842,"context_line":"            except Exception as exc:"},{"line_number":843,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":844,"context_line":"                self._cleanup_when_reschedule_fails("}],"source_content_type":"text/x-python","patch_set":26,"id":"b232efa3_4f71182a","line":841,"updated":"2021-01-05 15:50:39.000000000","message":"this looks like a very unrelated bugfix about providing nodename insteaf of hostname.\nPlease split this change to remove this specific bugfix.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"b108a9f58dede9ecf15c453020d339d521dc9880","unresolved":true,"context_lines":[{"line_number":838,"context_line":""},{"line_number":839,"context_line":"            try:"},{"line_number":840,"context_line":"                accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":841,"context_line":"                    context, instance, host.nodename, local_reqspec)"},{"line_number":842,"context_line":"            except Exception as exc:"},{"line_number":843,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":844,"context_line":"                self._cleanup_when_reschedule_fails("}],"source_content_type":"text/x-python","patch_set":26,"id":"f1c1248e_77653377","line":841,"in_reply_to":"b232efa3_4f71182a","updated":"2021-01-05 17:05:58.000000000","message":"its not a bugfix see not below.\nit was using the correct logic before.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1f80d1ba37049d210e4391d8b777802ce6537b93","unresolved":true,"context_lines":[{"line_number":838,"context_line":""},{"line_number":839,"context_line":"            try:"},{"line_number":840,"context_line":"                accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":841,"context_line":"                    context, instance, host.nodename, local_reqspec)"},{"line_number":842,"context_line":"            except Exception as exc:"},{"line_number":843,"context_line":"                LOG.exception(\u0027Failed to reschedule. Reason: %s\u0027, exc)"},{"line_number":844,"context_line":"                self._cleanup_when_reschedule_fails("}],"source_content_type":"text/x-python","patch_set":26,"id":"0ae46361_5be796e2","line":841,"in_reply_to":"f1c1248e_77653377","updated":"2021-01-06 01:24:43.000000000","message":"This need to be use host.nodename, and others all changed in https://review.opendev.org/c/openstack/nova/+/762499/9, pls review the followup patch.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bf97e1f3a835cda85058acbbfdbff457f0dabfaf","unresolved":true,"context_lines":[{"line_number":858,"context_line":"                    limits\u003dhost.limits, host_list\u003dhost_list,"},{"line_number":859,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":860,"context_line":""},{"line_number":861,"context_line":"    def _create_and_bind_arq_for_instance(self, context, instance, hostname,"},{"line_number":862,"context_line":"                                          request_spec):"},{"line_number":863,"context_line":"        try:"},{"line_number":864,"context_line":"            resource_provider_mapping \u003d ("}],"source_content_type":"text/x-python","patch_set":26,"id":"50db2923_aa85454b","line":861,"range":{"start_line":861,"start_character":67,"end_line":861,"end_character":75},"updated":"2021-01-05 15:31:12.000000000","message":"this should be nodenmae","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1f80d1ba37049d210e4391d8b777802ce6537b93","unresolved":true,"context_lines":[{"line_number":858,"context_line":"                    limits\u003dhost.limits, host_list\u003dhost_list,"},{"line_number":859,"context_line":"                    accel_uuids\u003daccel_uuids)"},{"line_number":860,"context_line":""},{"line_number":861,"context_line":"    def _create_and_bind_arq_for_instance(self, context, instance, hostname,"},{"line_number":862,"context_line":"                                          request_spec):"},{"line_number":863,"context_line":"        try:"},{"line_number":864,"context_line":"            resource_provider_mapping \u003d ("}],"source_content_type":"text/x-python","patch_set":26,"id":"b88f4662_8175b70f","line":861,"range":{"start_line":861,"start_character":67,"end_line":861,"end_character":75},"in_reply_to":"50db2923_aa85454b","updated":"2021-01-06 01:24:43.000000000","message":"These all changed in https://review.opendev.org/c/openstack/nova/+/762499/9, pls review the followup patch.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bf97e1f3a835cda85058acbbfdbff457f0dabfaf","unresolved":true,"context_lines":[{"line_number":863,"context_line":"        try:"},{"line_number":864,"context_line":"            resource_provider_mapping \u003d ("},{"line_number":865,"context_line":"                request_spec.get_request_group_mapping())"},{"line_number":866,"context_line":"            # Using nodename instead of hostname. See:"},{"line_number":867,"context_line":"            # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":868,"context_line":"            return self._create_and_bind_arqs("},{"line_number":869,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":870,"context_line":"                hostname, resource_provider_mapping)"}],"source_content_type":"text/x-python","patch_set":26,"id":"610f41ad_b501a754","line":867,"range":{"start_line":866,"start_character":11,"end_line":867,"end_character":102},"updated":"2021-01-05 15:31:12.000000000","message":"this comment should be moved to line 840","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1f80d1ba37049d210e4391d8b777802ce6537b93","unresolved":true,"context_lines":[{"line_number":863,"context_line":"        try:"},{"line_number":864,"context_line":"            resource_provider_mapping \u003d ("},{"line_number":865,"context_line":"                request_spec.get_request_group_mapping())"},{"line_number":866,"context_line":"            # Using nodename instead of hostname. See:"},{"line_number":867,"context_line":"            # http://lists.openstack.org/pipermail/openstack-discuss/2019-November/011044.html  # noqa"},{"line_number":868,"context_line":"            return self._create_and_bind_arqs("},{"line_number":869,"context_line":"                context, instance.uuid, instance.flavor.extra_specs,"},{"line_number":870,"context_line":"                hostname, resource_provider_mapping)"}],"source_content_type":"text/x-python","patch_set":26,"id":"6e66324d_9647bcd6","line":867,"range":{"start_line":866,"start_character":11,"end_line":867,"end_character":102},"in_reply_to":"610f41ad_b501a754","updated":"2021-01-06 01:24:43.000000000","message":"as the same above, I can move this in https://review.opendev.org/c/openstack/nova/+/762499/9.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"90a2183d0b5b9c349697fffc3b62a594a5934d5d","unresolved":true,"context_lines":[{"line_number":1020,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1021,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1022,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1023,"context_line":"                LOG.exception(\u0027Failed to unshelve. Reason: %s\u0027, exc)"},{"line_number":1024,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1025,"context_line":"                    instance.task_state \u003d None"},{"line_number":1026,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"f1269784_95489269","line":1023,"updated":"2021-01-06 08:36:13.000000000","message":"Maybe not your fault, but should we deallocate the resource for placement?","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"e940172fc50ccbd24128d32e332cf0da857c0c87","unresolved":true,"context_lines":[{"line_number":1020,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1021,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1022,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1023,"context_line":"                LOG.exception(\u0027Failed to unshelve. Reason: %s\u0027, exc)"},{"line_number":1024,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1025,"context_line":"                    instance.task_state \u003d None"},{"line_number":1026,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"c10cc87a_da34d9a8","line":1023,"in_reply_to":"2627f49f_eda4829c","updated":"2021-01-13 05:28:02.000000000","message":"if other reviewer fine with a later fix, actually I\u0027m fine too.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a59754595145a489bdacf7ab7945558672187ba9","unresolved":true,"context_lines":[{"line_number":1020,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1021,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1022,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1023,"context_line":"                LOG.exception(\u0027Failed to unshelve. Reason: %s\u0027, exc)"},{"line_number":1024,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1025,"context_line":"                    instance.task_state \u003d None"},{"line_number":1026,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"e5a60a6b_49c17df6","line":1023,"in_reply_to":"66449cbf_f01b4ee2","updated":"2021-01-14 01:07:44.000000000","message":"\u003e tl;dr: this potential problem exists before this patch, so the fix needs to be done independently and also potentially the fix needs to be backported to affected stable branches.\n\u003e \n\nGibi, thanks for helping check this, we can moving forward with later fix now 😊\n\n\u003e Long answer:\n\u003e This is complicated, if self.compute_rpcapi.unshelve_instance() call fails in certain reasons the the compute manager deletes the allocation [1] and the reraise the exception making the allocatino delete here unnecessary. \n\u003e \n\u003e BUT I can imagine that there are cases when such delete is not triggered. E.g.:\n\u003e * we fail to send the RPC so the unshelve_instance RPC handler in the compute manager is not even called\n\u003e * the RPC reaches the compute manager but an exception is raised before the try block  in the compute manager. E.g. instance.save()[2] fails due to intermittent db or network failure. Then the exception bubbles up to here without any allocation delete.\n\u003e \n\nI\u0027m not worry about those case, in those cases, the instance should be stuck at UNSHELVING state, so the user doesn\u0027t have anything can do then delete it, after instance being delete, the allocation will be cleanup.\n\nBut yes, this isn\u0027t prefect for UX, we should allow the user unshelve the instance again, but that is also another topic.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"40d48bc996ca30589b427de2fbb091253dd19c16","unresolved":true,"context_lines":[{"line_number":1020,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1021,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1022,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1023,"context_line":"                LOG.exception(\u0027Failed to unshelve. Reason: %s\u0027, exc)"},{"line_number":1024,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1025,"context_line":"                    instance.task_state \u003d None"},{"line_number":1026,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"2627f49f_eda4829c","line":1023,"in_reply_to":"7c218b06_f3fb0d30","updated":"2021-01-12 09:08:14.000000000","message":"Maybe you are right, it\u0027s better to deallocate the resources from placement here rather in ``compute.unshelve_instance()``, but we can fix this later.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"933ffaf8bcca24b963ed6f348312d8d7e22d23e4","unresolved":true,"context_lines":[{"line_number":1020,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1021,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1022,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1023,"context_line":"                LOG.exception(\u0027Failed to unshelve. Reason: %s\u0027, exc)"},{"line_number":1024,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1025,"context_line":"                    instance.task_state \u003d None"},{"line_number":1026,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"66449cbf_f01b4ee2","line":1023,"in_reply_to":"c10cc87a_da34d9a8","updated":"2021-01-13 10:33:51.000000000","message":"tl;dr: this potential problem exists before this patch, so the fix needs to be done independently and also potentially the fix needs to be backported to affected stable branches.\n\nLong answer:\nThis is complicated, if self.compute_rpcapi.unshelve_instance() call fails in certain reasons the the compute manager deletes the allocation [1] and the reraise the exception making the allocatino delete here unnecessary. \n\nBUT I can imagine that there are cases when such delete is not triggered. E.g.:\n* we fail to send the RPC so the unshelve_instance RPC handler in the compute manager is not even called\n* the RPC reaches the compute manager but an exception is raised before the try block  in the compute manager. E.g. instance.save()[2] fails due to intermittent db or network failure. Then the exception bubbles up to here without any allocation delete.\n\n\n\n[1] https://github.com/openstack/nova/blob/e6f5e814050a19d6f027037424556b2889514ec3/nova/compute/manager.py#L6594\n[2] https://github.com/openstack/nova/blob/e6f5e814050a19d6f027037424556b2889514ec3/nova/compute/manager.py#L6541","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"a043380928b1b915282939af34e35f015c402ab1","unresolved":true,"context_lines":[{"line_number":1020,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1021,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1022,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1023,"context_line":"                LOG.exception(\u0027Failed to unshelve. Reason: %s\u0027, exc)"},{"line_number":1024,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1025,"context_line":"                    instance.task_state \u003d None"},{"line_number":1026,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"7c218b06_f3fb0d30","line":1023,"in_reply_to":"c7bedf79_93b49298","updated":"2021-01-12 01:17:55.000000000","message":"I thought the line 989 call the scheduler, then we clam the resource from the placement, so if anything wrong after that line, I thought we should cleanup those resource allocation. I could be wrong, but I don\u0027t get why we needn\u0027t cleanup those resource.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"d403ecaf4ba2b7d4fb6f1a2df48f69b5e4e17f82","unresolved":true,"context_lines":[{"line_number":1020,"context_line":"                if isinstance(exc, exception.AcceleratorRequestBindingFailed):"},{"line_number":1021,"context_line":"                    cyclient \u003d cyborg.get_client(context)"},{"line_number":1022,"context_line":"                    cyclient.delete_arqs_by_uuid(exc.arqs)"},{"line_number":1023,"context_line":"                LOG.exception(\u0027Failed to unshelve. Reason: %s\u0027, exc)"},{"line_number":1024,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":1025,"context_line":"                    instance.task_state \u003d None"},{"line_number":1026,"context_line":"                    instance.save()"}],"source_content_type":"text/x-python","patch_set":26,"id":"c7bedf79_93b49298","line":1023,"in_reply_to":"f1269784_95489269","updated":"2021-01-12 01:07:54.000000000","message":"IMO, we dont need to dealocate this for placement, in Cyborg we will report the accelerator resources to placement, this just need to go with the original logical.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"bf97e1f3a835cda85058acbbfdbff457f0dabfaf","unresolved":true,"context_lines":[{"line_number":1248,"context_line":"                        # delete the bound arqs, then re-create-and-bound the"},{"line_number":1249,"context_line":"                        # arqs for the instance."},{"line_number":1250,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1251,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1252,"context_line":"                            context, instance, node, request_spec)"},{"line_number":1253,"context_line":"                    else:"},{"line_number":1254,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1255,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":26,"id":"ddd121f8_e096c7db","line":1252,"range":{"start_line":1251,"start_character":4,"end_line":1252,"end_character":66},"updated":"2021-01-05 15:31:12.000000000","message":"this is the second caller where we are passign the nodename as node\nallthough we could have just passed selection\nthis works however. but that why we have other changes with the removal of _rebuild_cyborg_arq","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"b108a9f58dede9ecf15c453020d339d521dc9880","unresolved":true,"context_lines":[{"line_number":1248,"context_line":"                        # delete the bound arqs, then re-create-and-bound the"},{"line_number":1249,"context_line":"                        # arqs for the instance."},{"line_number":1250,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1251,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1252,"context_line":"                            context, instance, node, request_spec)"},{"line_number":1253,"context_line":"                    else:"},{"line_number":1254,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1255,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":26,"id":"63a3c513_36e92b76","line":1252,"range":{"start_line":1251,"start_character":4,"end_line":1252,"end_character":66},"in_reply_to":"55c3dc12_c63906af","updated":"2021-01-05 17:05:58.000000000","message":"_rebuild_cyborg_arq was orginally ment to be reused for shelve but gibi did not want to add a new flag to it to denote shelve vs rebuild.\n\nsince _rebuild_cyborg_arq had only one caller and was nto going to be reused for other actions as originally intened it was factored back into the singel caller.\n\npersonally i would not have done that but that is why this is modifed","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1f80d1ba37049d210e4391d8b777802ce6537b93","unresolved":true,"context_lines":[{"line_number":1248,"context_line":"                        # delete the bound arqs, then re-create-and-bound the"},{"line_number":1249,"context_line":"                        # arqs for the instance."},{"line_number":1250,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1251,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1252,"context_line":"                            context, instance, node, request_spec)"},{"line_number":1253,"context_line":"                    else:"},{"line_number":1254,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1255,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":26,"id":"9702e7f2_0cf0d060","line":1252,"range":{"start_line":1251,"start_character":4,"end_line":1252,"end_character":66},"in_reply_to":"63a3c513_36e92b76","updated":"2021-01-06 01:24:43.000000000","message":"yes, this was talked previous or later with https://review.opendev.org/c/openstack/nova/+/729563/13/nova/conductor/manager.py#1273, that you can review before patch.","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5995605e0919a96802cd00ca7bcc0fd333d40084","unresolved":true,"context_lines":[{"line_number":1248,"context_line":"                        # delete the bound arqs, then re-create-and-bound the"},{"line_number":1249,"context_line":"                        # arqs for the instance."},{"line_number":1250,"context_line":"                        cyclient.delete_arqs_for_instance(instance.uuid)"},{"line_number":1251,"context_line":"                        accel_uuids \u003d self._create_and_bind_arq_for_instance("},{"line_number":1252,"context_line":"                            context, instance, node, request_spec)"},{"line_number":1253,"context_line":"                    else:"},{"line_number":1254,"context_line":"                        accel_uuids \u003d cyclient.get_arq_uuids_for_instance("},{"line_number":1255,"context_line":"                            instance)"}],"source_content_type":"text/x-python","patch_set":26,"id":"55c3dc12_c63906af","line":1252,"range":{"start_line":1251,"start_character":4,"end_line":1252,"end_character":66},"in_reply_to":"ddd121f8_e096c7db","updated":"2021-01-05 15:52:51.000000000","message":"Why are you modifying rebuild_instance() for supporting shelve ?","commit_id":"c4a0b3d056edfe31c1bd87e6403d6b7b60254482"}],"nova/exception.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"febd40769a0c222c7c238fe8e8a430ccdc8bb0ba","unresolved":false,"context_lines":[{"line_number":1618,"context_line":""},{"line_number":1619,"context_line":""},{"line_number":1620,"context_line":"class ShelveError(NovaException):"},{"line_number":1621,"context_line":"    msg_fmt \u003d _(\"Shleve error: %(reason)s\")"},{"line_number":1622,"context_line":""},{"line_number":1623,"context_line":""},{"line_number":1624,"context_line":"class UnshelveException(NovaException):"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f621f24_d8f5c8cc","line":1621,"range":{"start_line":1621,"start_character":17,"end_line":1621,"end_character":23},"updated":"2020-11-16 14:53:53.000000000","message":"Shelve\n\nHowever, I think you should use TooOldComputeService, or ServiceTooOld, which already exist in this file.","commit_id":"5489ad6b870c8a091d0d83b08059197d7142365c"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"2077e85819f0e06083ff39e928f1123b118439a7","unresolved":false,"context_lines":[{"line_number":1618,"context_line":""},{"line_number":1619,"context_line":""},{"line_number":1620,"context_line":"class ShelveError(NovaException):"},{"line_number":1621,"context_line":"    msg_fmt \u003d _(\"Shleve error: %(reason)s\")"},{"line_number":1622,"context_line":""},{"line_number":1623,"context_line":""},{"line_number":1624,"context_line":"class UnshelveException(NovaException):"}],"source_content_type":"text/x-python","patch_set":19,"id":"1f621f24_9db97a7a","line":1621,"range":{"start_line":1621,"start_character":17,"end_line":1621,"end_character":23},"in_reply_to":"1f621f24_d8f5c8cc","updated":"2020-11-17 04:20:11.000000000","message":"Done","commit_id":"5489ad6b870c8a091d0d83b08059197d7142365c"}],"nova/objects/service.py":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"1efe40a6778f5b121f5d63fe37c6b6a950ef12a4","unresolved":false,"context_lines":[{"line_number":189,"context_line":"    # Add accel_uuids (accelerator requests) param to rebuild_instance"},{"line_number":190,"context_line":"    {\u0027compute_rpc\u0027: \u00275.12\u0027},"},{"line_number":191,"context_line":"    # Version 53: Compute RPC v5.13:"},{"line_number":192,"context_line":"    # Add accel_uuids (accelerator requests) param to shelve"},{"line_number":193,"context_line":"    {\u0027compute_rpc\u0027: \u00275.13\u0027},"},{"line_number":194,"context_line":")"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ff570b3c_6a278ecb","line":192,"range":{"start_line":192,"start_character":54,"end_line":192,"end_character":60},"updated":"2020-05-20 10:50:44.000000000","message":"shelve and unshelve","commit_id":"d5bee5f3509bba52eb8f18db9cf75ab489d3abdd"}],"nova/tests/fixtures.py":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a0297cc886893a56e1f2932a4f078c10b6d88fb5","unresolved":false,"context_lines":[{"line_number":2623,"context_line":""},{"line_number":2624,"context_line":"    @staticmethod"},{"line_number":2625,"context_line":"    def fake_delete_arqs_for_instance(instance_uuid):"},{"line_number":2626,"context_line":"        del CyborgFixture.bindings_by_instance[instance_uuid]"},{"line_number":2627,"context_line":""},{"line_number":2628,"context_line":"    def setUp(self):"},{"line_number":2629,"context_line":"        super(CyborgFixture, self).setUp()"}],"source_content_type":"text/x-python","patch_set":12,"id":"9f560f44_f806ed85","line":2626,"updated":"2020-09-09 23:39:30.000000000","message":"This caused by create server failed, will update","commit_id":"bed00da3d7f62f7da83244e3b546eeb0cb56c77a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"df34714c947fd80c0552d0cbfe2136e3f530122a","unresolved":false,"context_lines":[{"line_number":2598,"context_line":"           This function uses bindings indexed by instance UUID to"},{"line_number":2599,"context_line":"           populate the bound ARQ templates in CyborgFixture.bound_arq_list."},{"line_number":2600,"context_line":"        \"\"\""},{"line_number":2601,"context_line":"        arq_host_rp_list \u003d CyborgFixture.bindings_by_instance.get("},{"line_number":2602,"context_line":"                instance_uuid)"},{"line_number":2603,"context_line":"        if not arq_host_rp_list:"},{"line_number":2604,"context_line":"            return []"},{"line_number":2605,"context_line":"        # The above looks like:"},{"line_number":2606,"context_line":"        # [{\u0027hostname\u0027: $hostname,"},{"line_number":2607,"context_line":"        #   \u0027device_rp_uuid\u0027: $device_rp_uuid,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_3dd16acd","line":2604,"range":{"start_line":2601,"start_character":0,"end_line":2604,"end_character":21},"updated":"2020-09-10 15:10:33.000000000","message":"you could use\n\n    arq_host_rp_list \u003d CyborgFixture.bindings_by_instance.get(instance_uuid, [])\n\ninstead. As far as I see the for loop will be noop and then you would simply return []","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3661e6222198fd570ae8262fc4f34b6542f76fa6","unresolved":false,"context_lines":[{"line_number":2598,"context_line":"           This function uses bindings indexed by instance UUID to"},{"line_number":2599,"context_line":"           populate the bound ARQ templates in CyborgFixture.bound_arq_list."},{"line_number":2600,"context_line":"        \"\"\""},{"line_number":2601,"context_line":"        arq_host_rp_list \u003d CyborgFixture.bindings_by_instance.get("},{"line_number":2602,"context_line":"                instance_uuid)"},{"line_number":2603,"context_line":"        if not arq_host_rp_list:"},{"line_number":2604,"context_line":"            return []"},{"line_number":2605,"context_line":"        # The above looks like:"},{"line_number":2606,"context_line":"        # [{\u0027hostname\u0027: $hostname,"},{"line_number":2607,"context_line":"        #   \u0027device_rp_uuid\u0027: $device_rp_uuid,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_7f3463fb","line":2604,"range":{"start_line":2601,"start_character":0,"end_line":2604,"end_character":21},"in_reply_to":"9f560f44_3dd16acd","updated":"2020-09-11 10:44:39.000000000","message":"Sorry, my mistake I mixed arq_host_rp_list with bound_arq_list. Ignore my comment","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"fe5e1dc165f17d09fe881a324c4fa71af8b22102","unresolved":false,"context_lines":[{"line_number":2598,"context_line":"           This function uses bindings indexed by instance UUID to"},{"line_number":2599,"context_line":"           populate the bound ARQ templates in CyborgFixture.bound_arq_list."},{"line_number":2600,"context_line":"        \"\"\""},{"line_number":2601,"context_line":"        arq_host_rp_list \u003d CyborgFixture.bindings_by_instance.get("},{"line_number":2602,"context_line":"                instance_uuid)"},{"line_number":2603,"context_line":"        if not arq_host_rp_list:"},{"line_number":2604,"context_line":"            return []"},{"line_number":2605,"context_line":"        # The above looks like:"},{"line_number":2606,"context_line":"        # [{\u0027hostname\u0027: $hostname,"},{"line_number":2607,"context_line":"        #   \u0027device_rp_uuid\u0027: $device_rp_uuid,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_9a286586","line":2604,"range":{"start_line":2601,"start_character":0,"end_line":2604,"end_character":21},"in_reply_to":"9f560f44_7f3463fb","updated":"2020-09-11 10:48:12.000000000","message":"No problem.","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"}],"nova/tests/functional/integrated_helpers.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":483,"context_line":"    def _shelve_offload_server(self, server):"},{"line_number":484,"context_line":"        \"\"\"Shelve offload a server.\"\"\""},{"line_number":485,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelveOffload\u0027: {}})"},{"line_number":486,"context_line":"        self._wait_for_server_parameter(self.server,"},{"line_number":487,"context_line":"                                        {\u0027status\u0027: \u0027SHELVED_OFFLOADED\u0027,"},{"line_number":488,"context_line":"                                         \u0027OS-EXT-SRV-ATTR:host\u0027: None,"},{"line_number":489,"context_line":"                                         \u0027OS-EXT-AZ:availability_zone\u0027: \u0027\u0027})"}],"source_content_type":"text/x-python","patch_set":21,"id":"a07088d6_1190fab9","line":486,"range":{"start_line":486,"start_character":40,"end_line":486,"end_character":51},"updated":"2020-11-24 16:54:35.000000000","message":"use the server parameter of the call instead.","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"94a483c90c22fa20186b4f809ab3a6381d615b46","unresolved":false,"context_lines":[{"line_number":483,"context_line":"    def _shelve_offload_server(self, server):"},{"line_number":484,"context_line":"        \"\"\"Shelve offload a server.\"\"\""},{"line_number":485,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027shelveOffload\u0027: {}})"},{"line_number":486,"context_line":"        self._wait_for_server_parameter(self.server,"},{"line_number":487,"context_line":"                                        {\u0027status\u0027: \u0027SHELVED_OFFLOADED\u0027,"},{"line_number":488,"context_line":"                                         \u0027OS-EXT-SRV-ATTR:host\u0027: None,"},{"line_number":489,"context_line":"                                         \u0027OS-EXT-AZ:availability_zone\u0027: \u0027\u0027})"}],"source_content_type":"text/x-python","patch_set":21,"id":"4795d64b_4fcad92e","line":486,"range":{"start_line":486,"start_character":40,"end_line":486,"end_character":51},"in_reply_to":"a07088d6_1190fab9","updated":"2020-11-27 09:29:53.000000000","message":"Done","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"844a87b45abc69258eda4b5f857266658c666433","unresolved":false,"context_lines":[{"line_number":8202,"context_line":"        self.flags(shelved_offload_time\u003d-1)"},{"line_number":8203,"context_line":"        self._shelve_server(self.server, \u0027SHELVED\u0027)"},{"line_number":8204,"context_line":"        self._shelve_offload_server(self.server)"},{"line_number":8205,"context_line":"        self._unshelve_server(self.server)"},{"line_number":8206,"context_line":""},{"line_number":8207,"context_line":"    def test_resize_fails(self):"},{"line_number":8208,"context_line":"        ex \u003d self.assertRaises(client.OpenStackApiException,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f560f44_a9372de3","line":8205,"updated":"2020-09-08 15:15:21.000000000","message":"Please assert that the cyborg accelerators are freed and then recreated","commit_id":"5cbb5a546e2bfd090815f4adf98d35e172612986"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":8202,"context_line":"        self.flags(shelved_offload_time\u003d-1)"},{"line_number":8203,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(self.server[\u0027id\u0027])"},{"line_number":8204,"context_line":"        self.assertEqual(len(arqs), 1)"},{"line_number":8205,"context_line":"        self._shelve_server(self.server, \u0027SHELVED\u0027)"},{"line_number":8206,"context_line":"        self._shelve_offload_server(self.server)"},{"line_number":8207,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(self.server[\u0027id\u0027])"},{"line_number":8208,"context_line":"        self.assertEqual(len(arqs), 0)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_a8f551ef","line":8205,"updated":"2020-11-11 16:01:05.000000000","message":"could you assert that after shelve the server still has 1 arq?","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":8202,"context_line":"        self.flags(shelved_offload_time\u003d-1)"},{"line_number":8203,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(self.server[\u0027id\u0027])"},{"line_number":8204,"context_line":"        self.assertEqual(len(arqs), 1)"},{"line_number":8205,"context_line":"        self._shelve_server(self.server, \u0027SHELVED\u0027)"},{"line_number":8206,"context_line":"        self._shelve_offload_server(self.server)"},{"line_number":8207,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(self.server[\u0027id\u0027])"},{"line_number":8208,"context_line":"        self.assertEqual(len(arqs), 0)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_d1daf175","line":8205,"in_reply_to":"1f621f24_a8f551ef","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":8209,"context_line":"        self._unshelve_server(self.server)"},{"line_number":8210,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(self.server[\u0027id\u0027])"},{"line_number":8211,"context_line":"        self.assertEqual(len(arqs), 1)"},{"line_number":8212,"context_line":""},{"line_number":8213,"context_line":"    def test_resize_fails(self):"},{"line_number":8214,"context_line":"        ex \u003d self.assertRaises(client.OpenStackApiException,"},{"line_number":8215,"context_line":"            self.api.post_server_action, self.server[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_68efb91d","line":8212,"updated":"2020-11-11 16:01:05.000000000","message":"Could you add a case when we shelve, then unshelve, without offloading?","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":8209,"context_line":"        self._unshelve_server(self.server)"},{"line_number":8210,"context_line":"        arqs \u003d self.cyborg.fake_get_arqs_for_instance(self.server[\u0027id\u0027])"},{"line_number":8211,"context_line":"        self.assertEqual(len(arqs), 1)"},{"line_number":8212,"context_line":""},{"line_number":8213,"context_line":"    def test_resize_fails(self):"},{"line_number":8214,"context_line":"        ex \u003d self.assertRaises(client.OpenStackApiException,"},{"line_number":8215,"context_line":"            self.api.post_server_action, self.server[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_f160cd03","line":8212,"in_reply_to":"1f621f24_68efb91d","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":8278,"context_line":"            self.api.post_server_action, self.server[\u0027id\u0027],"},{"line_number":8279,"context_line":"            {\u0027shelve\u0027: {}})"},{"line_number":8280,"context_line":"        self.assertEqual(403, ex.response.status_code)"},{"line_number":8281,"context_line":"        self._check_allocations_usage(self.server)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_c857edc9","line":8281,"updated":"2020-11-11 16:01:05.000000000","message":"I think the better test would be to pin the RPC to \u003c 5.13 via the configuration. That way you don\u0027t have to mock anything and therefore you get a more realistic test.\n(See example in https://review.opendev.org/#/c/761458/4/nova/tests/functional/regressions/test_bug_1902925.py)","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":8278,"context_line":"            self.api.post_server_action, self.server[\u0027id\u0027],"},{"line_number":8279,"context_line":"            {\u0027shelve\u0027: {}})"},{"line_number":8280,"context_line":"        self.assertEqual(403, ex.response.status_code)"},{"line_number":8281,"context_line":"        self._check_allocations_usage(self.server)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_8c6fc0fa","line":8281,"in_reply_to":"1f621f24_c857edc9","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":8302,"context_line":""},{"line_number":8303,"context_line":"    def test_shelve_instance_5_0(self):"},{"line_number":8304,"context_line":"        body \u003d {\u0027shelve\u0027: {}}"},{"line_number":8305,"context_line":"        self._test_shelve_instance_with_compute_rpc_pin("},{"line_number":8306,"context_line":"                \u00275.0\u0027, body\u003dbody)"},{"line_number":8307,"context_line":""},{"line_number":8308,"context_line":"    def test_shelve_instance_5_13(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_2c62d50a","line":8305,"range":{"start_line":8305,"start_character":13,"end_line":8305,"end_character":55},"updated":"2020-11-13 16:21:54.000000000","message":"this should fail as shelving a server with accelerators can only happen properly if the RPC can send down the accel_uuids to the compute, but with RPC 5.0 the compute.api does not send the accel_uuids to the compute.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":8302,"context_line":""},{"line_number":8303,"context_line":"    def test_shelve_instance_5_0(self):"},{"line_number":8304,"context_line":"        body \u003d {\u0027shelve\u0027: {}}"},{"line_number":8305,"context_line":"        self._test_shelve_instance_with_compute_rpc_pin("},{"line_number":8306,"context_line":"                \u00275.0\u0027, body\u003dbody)"},{"line_number":8307,"context_line":""},{"line_number":8308,"context_line":"    def test_shelve_instance_5_13(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"1f621f24_9fe344a4","line":8305,"range":{"start_line":8305,"start_character":13,"end_line":8305,"end_character":55},"in_reply_to":"1f621f24_2c62d50a","updated":"2020-11-14 07:38:36.000000000","message":"yes, if we catch the exception in the rpc shelve_instance, we should be test the abnormal scene.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":8301,"context_line":"        self.api.post_server_action(self.server[\u0027id\u0027], body)"},{"line_number":8302,"context_line":"        self._wait_for_state_change(self.server, \u0027SHELVED\u0027)"},{"line_number":8303,"context_line":""},{"line_number":8304,"context_line":"    @mock.patch(\u0027nova.rpc.ClientRouter.client\u0027)"},{"line_number":8305,"context_line":"    def test_shelve_instance_old_compute(self, client):"},{"line_number":8306,"context_line":"        \"\"\"Tests when the dest compute service is too old to call"},{"line_number":8307,"context_line":"        shelve_instance so ShelveError is raised."},{"line_number":8308,"context_line":"        \"\"\""},{"line_number":8309,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":8310,"context_line":"        client.return_value.can_send_version.return_value \u003d False"},{"line_number":8311,"context_line":"        rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":8312,"context_line":"        ex \u003d self.assertRaises("},{"line_number":8313,"context_line":"            exception.TooOldComputeService,"},{"line_number":8314,"context_line":"            rpcapi.shelve_instance,"},{"line_number":8315,"context_line":"            ctxt,"},{"line_number":8316,"context_line":"            instance\u003dself.server,"},{"line_number":8317,"context_line":"            image_id\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":8318,"context_line":"            clean_shutdown\u003dTrue,"},{"line_number":8319,"context_line":"            accel_uuids\u003d[uuids.accel_uuids])"},{"line_number":8320,"context_line":"        self.assertEqual(400, ex.kwargs[\u0027code\u0027])"},{"line_number":8321,"context_line":""},{"line_number":8322,"context_line":"    def test_shelve_instance_5_13(self):"},{"line_number":8323,"context_line":"        body \u003d {\u0027shelve\u0027: {}}"}],"source_content_type":"text/x-python","patch_set":21,"id":"48d0936a_83047de8","line":8320,"range":{"start_line":8304,"start_character":4,"end_line":8320,"end_character":48},"updated":"2020-11-24 16:54:35.000000000","message":"It is not a functional test but a unit test.\n\nYou need a functional test that calls shelve with \u003c 5.13 RPC and assert that the operation fails. However currently the operation does not fail due to a bug. See my comment https://review.opendev.org/c/openstack/nova/+/729563/21/nova/compute/api.py#4204\n\n    def test_shelve_with_compute_rpc_pin_5_0(self,):\n        self.flags(compute\u003d5.0, group\u003d\u0027upgrade_levels\u0027)\n        compute_rpcapi.reset_globals()\n\n        ex  \u003d self.assertRaises(\n            client.OpenStackApiException, self.api.post_server_action,\n            self.server[\u0027id\u0027], {\u0027shelve\u0027: {}})\n\n        self.assertEquals(403, ex.response.status_code)","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"94a483c90c22fa20186b4f809ab3a6381d615b46","unresolved":false,"context_lines":[{"line_number":8301,"context_line":"        self.api.post_server_action(self.server[\u0027id\u0027], body)"},{"line_number":8302,"context_line":"        self._wait_for_state_change(self.server, \u0027SHELVED\u0027)"},{"line_number":8303,"context_line":""},{"line_number":8304,"context_line":"    @mock.patch(\u0027nova.rpc.ClientRouter.client\u0027)"},{"line_number":8305,"context_line":"    def test_shelve_instance_old_compute(self, client):"},{"line_number":8306,"context_line":"        \"\"\"Tests when the dest compute service is too old to call"},{"line_number":8307,"context_line":"        shelve_instance so ShelveError is raised."},{"line_number":8308,"context_line":"        \"\"\""},{"line_number":8309,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":8310,"context_line":"        client.return_value.can_send_version.return_value \u003d False"},{"line_number":8311,"context_line":"        rpcapi \u003d compute_rpcapi.ComputeAPI()"},{"line_number":8312,"context_line":"        ex \u003d self.assertRaises("},{"line_number":8313,"context_line":"            exception.TooOldComputeService,"},{"line_number":8314,"context_line":"            rpcapi.shelve_instance,"},{"line_number":8315,"context_line":"            ctxt,"},{"line_number":8316,"context_line":"            instance\u003dself.server,"},{"line_number":8317,"context_line":"            image_id\u003d\u0027155d900f-4e14-4e4c-a73d-069cbf4541e6\u0027,"},{"line_number":8318,"context_line":"            clean_shutdown\u003dTrue,"},{"line_number":8319,"context_line":"            accel_uuids\u003d[uuids.accel_uuids])"},{"line_number":8320,"context_line":"        self.assertEqual(400, ex.kwargs[\u0027code\u0027])"},{"line_number":8321,"context_line":""},{"line_number":8322,"context_line":"    def test_shelve_instance_5_13(self):"},{"line_number":8323,"context_line":"        body \u003d {\u0027shelve\u0027: {}}"}],"source_content_type":"text/x-python","patch_set":21,"id":"38d6682f_1324c66c","line":8320,"range":{"start_line":8304,"start_character":4,"end_line":8320,"end_character":48},"in_reply_to":"48d0936a_83047de8","updated":"2020-11-27 09:29:53.000000000","message":"Done","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"f894b1e961314dbaac379e229742ce7069259601","unresolved":true,"context_lines":[{"line_number":8325,"context_line":"                \u00275.13\u0027, body\u003dbody)"},{"line_number":8326,"context_line":""},{"line_number":8327,"context_line":"    def _test_shelve_offload_instance_with_compute_rpc_pin("},{"line_number":8328,"context_line":"            self, version_cap, body\u003dNone):"},{"line_number":8329,"context_line":"        self.flags(compute\u003dversion_cap, group\u003d\u0027upgrade_levels\u0027)"},{"line_number":8330,"context_line":""},{"line_number":8331,"context_line":"        self.flags(shelved_offload_time\u003d2)"}],"source_content_type":"text/x-python","patch_set":21,"id":"81322244_de0487a0","line":8328,"range":{"start_line":8328,"start_character":31,"end_line":8328,"end_character":40},"updated":"2020-11-24 16:54:35.000000000","message":"this parameter always have the same actual value, {\u0027shelveOffload\u0027: {}} so you can drop this parameter and use this value directly below.","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"94a483c90c22fa20186b4f809ab3a6381d615b46","unresolved":false,"context_lines":[{"line_number":8325,"context_line":"                \u00275.13\u0027, body\u003dbody)"},{"line_number":8326,"context_line":""},{"line_number":8327,"context_line":"    def _test_shelve_offload_instance_with_compute_rpc_pin("},{"line_number":8328,"context_line":"            self, version_cap, body\u003dNone):"},{"line_number":8329,"context_line":"        self.flags(compute\u003dversion_cap, group\u003d\u0027upgrade_levels\u0027)"},{"line_number":8330,"context_line":""},{"line_number":8331,"context_line":"        self.flags(shelved_offload_time\u003d2)"}],"source_content_type":"text/x-python","patch_set":21,"id":"5b487566_c1417a3f","line":8328,"range":{"start_line":8328,"start_character":31,"end_line":8328,"end_character":40},"in_reply_to":"81322244_de0487a0","updated":"2020-11-27 09:29:53.000000000","message":"Done","commit_id":"adc444ffae39751459b26a032a90690b04bcb619"}],"nova/tests/unit/compute/test_api.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"df34714c947fd80c0552d0cbfe2136e3f530122a","unresolved":false,"context_lines":[{"line_number":7682,"context_line":"            mock_instance_save, mock_record_action, mock_shelve_service"},{"line_number":7683,"context_line":"        ):"},{"line_number":7684,"context_line":"            self.compute_api.shelve(self.context, instance)"},{"line_number":7685,"context_line":"        mock_get_arq_uuids.assert_called_once()"},{"line_number":7686,"context_line":""},{"line_number":7687,"context_line":"    @mock.patch(\u0027nova.accelerator.cyborg._CyborgClient.\u0027"},{"line_number":7688,"context_line":"                \u0027get_arq_uuids_for_instance\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_87fae43f","line":7685,"updated":"2020-09-10 15:10:33.000000000","message":"This shows the tangled implementation of shelve. When we shelve but not shelve offload then arqs should not be changed. But on the compute side shelve and shelve offload handled by the same method and that method expects the arqs so a simple shelve call also needs to send the arqs down even if it wont be used.","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3661e6222198fd570ae8262fc4f34b6542f76fa6","unresolved":false,"context_lines":[{"line_number":7682,"context_line":"            mock_instance_save, mock_record_action, mock_shelve_service"},{"line_number":7683,"context_line":"        ):"},{"line_number":7684,"context_line":"            self.compute_api.shelve(self.context, instance)"},{"line_number":7685,"context_line":"        mock_get_arq_uuids.assert_called_once()"},{"line_number":7686,"context_line":""},{"line_number":7687,"context_line":"    @mock.patch(\u0027nova.accelerator.cyborg._CyborgClient.\u0027"},{"line_number":7688,"context_line":"                \u0027get_arq_uuids_for_instance\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_bf139b64","line":7685,"in_reply_to":"9f560f44_87fae43f","updated":"2020-09-11 10:44:39.000000000","message":"nothing to change here, I\u0027ve just noted why we collect arqs for shelve even if we are not using them later","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"fe5e1dc165f17d09fe881a324c4fa71af8b22102","unresolved":false,"context_lines":[{"line_number":7682,"context_line":"            mock_instance_save, mock_record_action, mock_shelve_service"},{"line_number":7683,"context_line":"        ):"},{"line_number":7684,"context_line":"            self.compute_api.shelve(self.context, instance)"},{"line_number":7685,"context_line":"        mock_get_arq_uuids.assert_called_once()"},{"line_number":7686,"context_line":""},{"line_number":7687,"context_line":"    @mock.patch(\u0027nova.accelerator.cyborg._CyborgClient.\u0027"},{"line_number":7688,"context_line":"                \u0027get_arq_uuids_for_instance\u0027)"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_fa36c1e6","line":7685,"in_reply_to":"9f560f44_bf139b64","updated":"2020-09-11 10:48:12.000000000","message":"ack","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":7679,"context_line":"            mock.patch.object(compute_rpcapi.ComputeAPI, \u0027shelve_instance\u0027),"},{"line_number":7680,"context_line":"        ) as ("},{"line_number":7681,"context_line":"            mock_get_min, mock_volume_backend,"},{"line_number":7682,"context_line":"            mock_instance_save, mock_record_action, mock_shelve_service"},{"line_number":7683,"context_line":"        ):"},{"line_number":7684,"context_line":"            self.compute_api.shelve(self.context, instance)"},{"line_number":7685,"context_line":"        mock_get_arq_uuids.assert_called_once()"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_08e8c5df","line":7682,"range":{"start_line":7682,"start_character":52,"end_line":7682,"end_character":71},"updated":"2020-11-11 16:01:05.000000000","message":"please assert that the rpcapi is called with the arq you provided by the mocked cyborgclient","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":7679,"context_line":"            mock.patch.object(compute_rpcapi.ComputeAPI, \u0027shelve_instance\u0027),"},{"line_number":7680,"context_line":"        ) as ("},{"line_number":7681,"context_line":"            mock_get_min, mock_volume_backend,"},{"line_number":7682,"context_line":"            mock_instance_save, mock_record_action, mock_shelve_service"},{"line_number":7683,"context_line":"        ):"},{"line_number":7684,"context_line":"            self.compute_api.shelve(self.context, instance)"},{"line_number":7685,"context_line":"        mock_get_arq_uuids.assert_called_once()"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_e73c8fc9","line":7682,"range":{"start_line":7682,"start_character":52,"end_line":7682,"end_character":71},"in_reply_to":"1f621f24_08e8c5df","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"}],"nova/tests/unit/compute/test_rpcapi.py":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0fbee7ef4c6888337a72ba57769a891219faeb5b","unresolved":false,"context_lines":[{"line_number":864,"context_line":"    def test_shelve_instance(self):"},{"line_number":865,"context_line":"        self._test_compute_api(\u0027shelve_instance\u0027, \u0027cast\u0027,"},{"line_number":866,"context_line":"                instance\u003dself.fake_instance_obj, image_id\u003d\u0027image_id\u0027,"},{"line_number":867,"context_line":"                clean_shutdown\u003dTrue, version\u003d\u00275.0\u0027)"},{"line_number":868,"context_line":""},{"line_number":869,"context_line":"    def test_shelve_offload_instance(self):"},{"line_number":870,"context_line":"        self._test_compute_api(\u0027shelve_offload_instance\u0027, \u0027cast\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf51134e_b37bdd89","side":"PARENT","line":867,"range":{"start_line":867,"start_character":36,"end_line":867,"end_character":51},"updated":"2020-06-26 08:44:52.000000000","message":"This need to test the old compute rpc version (shelve_instance rpc api) is ok.","commit_id":"6fa38a3ab923fafb99932adb0ba0376a036f5826"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"0fbee7ef4c6888337a72ba57769a891219faeb5b","unresolved":false,"context_lines":[{"line_number":869,"context_line":"    def test_shelve_offload_instance(self):"},{"line_number":870,"context_line":"        self._test_compute_api(\u0027shelve_offload_instance\u0027, \u0027cast\u0027,"},{"line_number":871,"context_line":"                instance\u003dself.fake_instance_obj,"},{"line_number":872,"context_line":"                clean_shutdown\u003dTrue, version\u003d\u00275.0\u0027)"},{"line_number":873,"context_line":""},{"line_number":874,"context_line":"    def test_unshelve_instance(self):"},{"line_number":875,"context_line":"        self._test_compute_api(\u0027unshelve_instance\u0027, \u0027cast\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf51134e_136f29c5","side":"PARENT","line":872,"range":{"start_line":872,"start_character":37,"end_line":872,"end_character":50},"updated":"2020-06-26 08:44:52.000000000","message":"ditto the \u0027shelve_offload_instance\u0027 rpc api test.","commit_id":"6fa38a3ab923fafb99932adb0ba0376a036f5826"}],"nova/tests/unit/compute/test_shelve.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"ca077d79c8c9048fcce79d7227e30e8f8b98ddec","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        mock_spawn.assert_called_once_with(self.context, instance,"},{"line_number":367,"context_line":"                test.MatchType(objects.ImageMeta), injected_files\u003d[],"},{"line_number":368,"context_line":"                admin_password\u003dNone, allocations\u003d{}, network_info\u003d[],"},{"line_number":369,"context_line":"                block_device_info\u003d\u0027fake_bdm\u0027,accel_info\u003d[])"},{"line_number":370,"context_line":"        self.mock_get_allocations.assert_called_once_with(self.context,"},{"line_number":371,"context_line":"                                                          instance.uuid)"},{"line_number":372,"context_line":"        mock_get_power_state.assert_called_once_with(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":3,"id":"bf51134e_22b77d88","line":369,"updated":"2020-06-26 05:09:41.000000000","message":"pep8: E231 missing whitespace after \u0027,\u0027","commit_id":"9e6a4ec790fe9e80f054974348297fa9c8869a80"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"41e3e6670b08a5e5e2736e65f77610597d87dffe","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        mock_spawn.assert_called_once_with(self.context, instance,"},{"line_number":367,"context_line":"                test.MatchType(objects.ImageMeta), injected_files\u003d[],"},{"line_number":368,"context_line":"                admin_password\u003dNone, allocations\u003d{}, network_info\u003d[],"},{"line_number":369,"context_line":"                block_device_info\u003d\u0027fake_bdm\u0027,accel_info\u003d[])"},{"line_number":370,"context_line":"        self.mock_get_allocations.assert_called_once_with(self.context,"},{"line_number":371,"context_line":"                                                          instance.uuid)"},{"line_number":372,"context_line":"        mock_get_power_state.assert_called_once_with(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf51134e_4eaa53d2","line":369,"updated":"2020-07-02 02:22:55.000000000","message":"pep8: E231 missing whitespace after \u0027,\u0027","commit_id":"420be00fab55959f30fe00afdf9e887c9b767bc0"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"99938a1a9c145f18ee4aa07119d997259ae9ece1","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        mock_spawn.assert_called_once_with(self.context, instance,"},{"line_number":367,"context_line":"                test.MatchType(objects.ImageMeta), injected_files\u003d[],"},{"line_number":368,"context_line":"                admin_password\u003dNone, allocations\u003d{}, network_info\u003d[],"},{"line_number":369,"context_line":"                block_device_info\u003d\u0027fake_bdm\u0027,accel_info\u003d[])"},{"line_number":370,"context_line":"        self.mock_get_allocations.assert_called_once_with(self.context,"},{"line_number":371,"context_line":"                                                          instance.uuid)"},{"line_number":372,"context_line":"        mock_get_power_state.assert_called_once_with(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":5,"id":"bf51134e_22758f33","line":369,"updated":"2020-07-17 12:19:08.000000000","message":"pep8: E231 missing whitespace after \u0027,\u0027","commit_id":"c4c67b99b304526076735eec1c141d06d6114ae5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"df34714c947fd80c0552d0cbfe2136e3f530122a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"9f560f44_c7633c19","updated":"2020-09-10 15:10:33.000000000","message":"the additional logic in unshelve is not covered","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"f9960ff6996e29d10faa05a3aae9df815e010e33","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":13,"id":"9f560f44_3ad2f9fd","in_reply_to":"9f560f44_c7633c19","updated":"2020-09-11 11:24:24.000000000","message":"Done","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"df34714c947fd80c0552d0cbfe2136e3f530122a","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                \u0027delete_arqs_for_instance\u0027)"},{"line_number":188,"context_line":"    def test_shelve_and_offload_with_accel_uuids(self, mock_del_arqs):"},{"line_number":189,"context_line":"        self._shelve_instance(0, accel_uuids\u003d[uuids.fake])"},{"line_number":190,"context_line":"        mock_del_arqs.assert_called_once()"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    @mock.patch.object(nova.virt.fake.SmallFakeDriver, \u0027power_off\u0027)"},{"line_number":193,"context_line":"    def test_shelve_offload(self, mock_power_off):"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_678a30bc","line":190,"updated":"2020-09-10 15:10:33.000000000","message":"Would be nice to have the other test where we shelve but not offload and assert that even though arqs are passed in they are not deleted.","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":31412,"name":"Wenping Song","email":"songwenping@inspur.com","username":"songwenping"},"change_message_id":"f9960ff6996e29d10faa05a3aae9df815e010e33","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                \u0027delete_arqs_for_instance\u0027)"},{"line_number":188,"context_line":"    def test_shelve_and_offload_with_accel_uuids(self, mock_del_arqs):"},{"line_number":189,"context_line":"        self._shelve_instance(0, accel_uuids\u003d[uuids.fake])"},{"line_number":190,"context_line":"        mock_del_arqs.assert_called_once()"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"    @mock.patch.object(nova.virt.fake.SmallFakeDriver, \u0027power_off\u0027)"},{"line_number":193,"context_line":"    def test_shelve_offload(self, mock_power_off):"}],"source_content_type":"text/x-python","patch_set":13,"id":"9f560f44_9a06a585","line":190,"in_reply_to":"9f560f44_678a30bc","updated":"2020-09-11 11:24:24.000000000","message":"Done","commit_id":"6f5c0563fd26fbdff50de87b827a32a421b87b89"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"09345a50a8af070d39d65c34e072430a307a4e61","unresolved":false,"context_lines":[{"line_number":402,"context_line":"    def test_unshelve_with_arqs(self, mock_get_arqs):"},{"line_number":403,"context_line":"        self.test_unshelve(accel_uuids\u003d[uuids.fake])"},{"line_number":404,"context_line":"        mock_get_arqs.assert_called_once()"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    @mock.patch(\u0027nova.objects.BlockDeviceMappingList.get_by_instance_uuid\u0027)"},{"line_number":407,"context_line":"    @mock.patch(\u0027nova.compute.utils.notify_about_instance_action\u0027)"},{"line_number":408,"context_line":"    @mock.patch.object(nova.compute.resource_tracker.ResourceTracker,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_93a246ad","line":405,"updated":"2020-11-11 16:01:05.000000000","message":"could you please add an error case and assert that it cleans up properly? I.e. cover the exception handling at https://review.opendev.org/#/c/729563/14/nova/compute/manager.py@6647","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"a34ff030e05d42bb6e5005a29654e1b003761ae5","unresolved":false,"context_lines":[{"line_number":402,"context_line":"    def test_unshelve_with_arqs(self, mock_get_arqs):"},{"line_number":403,"context_line":"        self.test_unshelve(accel_uuids\u003d[uuids.fake])"},{"line_number":404,"context_line":"        mock_get_arqs.assert_called_once()"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    @mock.patch(\u0027nova.objects.BlockDeviceMappingList.get_by_instance_uuid\u0027)"},{"line_number":407,"context_line":"    @mock.patch(\u0027nova.compute.utils.notify_about_instance_action\u0027)"},{"line_number":408,"context_line":"    @mock.patch.object(nova.compute.resource_tracker.ResourceTracker,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1f621f24_2bff7167","line":405,"in_reply_to":"1f621f24_93a246ad","updated":"2020-11-12 10:51:41.000000000","message":"Done","commit_id":"7eb3beb79b06e94d034a5ed7d586c644511fccb9"}],"releasenotes/notes/bp-cyborg-rebuild-and-evacuate-97bba59988b8b072.yaml":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Add Cyborg shelve/unshelve support."},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    On shleve, the instance will always be bound by ARQs."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"    On shelve offload an instance will be deleted the instance\u0027s ARQs"},{"line_number":9,"context_line":"    binding info to free up the bound ARQs in Cyborg service."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"1f621f24_4c7ab1b9","line":6,"range":{"start_line":6,"start_character":4,"end_line":6,"end_character":57},"updated":"2020-11-13 16:21:54.000000000","message":"After shelve the ARQs are still kept bound to the instance.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Add Cyborg shelve/unshelve support."},{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    On shleve, the instance will always be bound by ARQs."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"    On shelve offload an instance will be deleted the instance\u0027s ARQs"},{"line_number":9,"context_line":"    binding info to free up the bound ARQs in Cyborg service."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"1f621f24_1f40d406","line":6,"range":{"start_line":6,"start_character":4,"end_line":6,"end_character":57},"in_reply_to":"1f621f24_4c7ab1b9","updated":"2020-11-14 07:38:36.000000000","message":"Done","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    On shleve, the instance will always be bound by ARQs."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"    On shelve offload an instance will be deleted the instance\u0027s ARQs"},{"line_number":9,"context_line":"    binding info to free up the bound ARQs in Cyborg service."},{"line_number":10,"context_line":"    And this change passes the ARQs to spawn during unshelve an instance."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"1f621f24_ac4ee593","line":9,"range":{"start_line":8,"start_character":4,"end_line":9,"end_character":61},"updated":"2020-11-13 16:21:54.000000000","message":"After shelve offload the ARQs of the instance will be feered in Cyborg.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":5,"context_line":""},{"line_number":6,"context_line":"    On shleve, the instance will always be bound by ARQs."},{"line_number":7,"context_line":""},{"line_number":8,"context_line":"    On shelve offload an instance will be deleted the instance\u0027s ARQs"},{"line_number":9,"context_line":"    binding info to free up the bound ARQs in Cyborg service."},{"line_number":10,"context_line":"    And this change passes the ARQs to spawn during unshelve an instance."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"1f621f24_ff42380e","line":9,"range":{"start_line":8,"start_character":4,"end_line":9,"end_character":61},"in_reply_to":"1f621f24_ac4ee593","updated":"2020-11-14 07:38:36.000000000","message":"Done","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"84fc83a697970e9a6c96248d1318679160793b32","unresolved":false,"context_lines":[{"line_number":7,"context_line":""},{"line_number":8,"context_line":"    On shelve offload an instance will be deleted the instance\u0027s ARQs"},{"line_number":9,"context_line":"    binding info to free up the bound ARQs in Cyborg service."},{"line_number":10,"context_line":"    And this change passes the ARQs to spawn during unshelve an instance."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"1f621f24_ec445d76","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":73},"updated":"2020-11-13 16:21:54.000000000","message":"During unshelve the ARQs will be reallocated and bound to the instance if needed.","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"b90ef6c61a0c9fd12a9e53d52db86878fe014ae6","unresolved":false,"context_lines":[{"line_number":7,"context_line":""},{"line_number":8,"context_line":"    On shelve offload an instance will be deleted the instance\u0027s ARQs"},{"line_number":9,"context_line":"    binding info to free up the bound ARQs in Cyborg service."},{"line_number":10,"context_line":"    And this change passes the ARQs to spawn during unshelve an instance."}],"source_content_type":"text/x-yaml","patch_set":17,"id":"1f621f24_5f4d2c3c","line":10,"range":{"start_line":10,"start_character":4,"end_line":10,"end_character":73},"in_reply_to":"1f621f24_ec445d76","updated":"2020-11-14 07:38:36.000000000","message":"Done","commit_id":"e97ccc4b7475c89cf7a8345a0ef2b2a71c0c5196"}]}
