)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c2881c26efcfda808b3a8eed8e224b56d47c3139","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Reject unshelve with port having resource request"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Nova does not consider the resource request of a Neutron port as of now."},{"line_number":10,"context_line":"So this patch makes sure that server unshelve request on servers that"},{"line_number":11,"context_line":"was offload is rejected if it involves a port that has resource request."},{"line_number":12,"context_line":"When the feature is ready on the nova side this limitation will be lifted."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"blueprint: bandwidth-resource-provider"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9fdfeff1_15fe346b","line":11,"range":{"start_line":10,"start_character":57,"end_line":11,"end_character":11},"updated":"2019-02-04 14:32:15.000000000","message":"servers that were offloaded","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"}],"nova/api/openstack/compute/shelve.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1e6eeb06c60c6c6b1a94b137b13a210d9639412e","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        context.can(shelve_policies.POLICY_ROOT % \u0027unshelve\u0027)"},{"line_number":83,"context_line":"        instance \u003d common.get_instance(self.compute_api, context, id)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if (instance.vm_state \u003d\u003d vm_states.SHELVED_OFFLOADED"},{"line_number":86,"context_line":"                and common.instance_has_port_with_resource_request("},{"line_number":87,"context_line":"                    context, instance.uuid, self.network_api)"},{"line_number":88,"context_line":"                and not common.supports_port_resource_request_during_move("}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_465482ff","line":85,"range":{"start_line":85,"start_character":43,"end_line":85,"end_character":60},"updated":"2019-01-28 18:22:28.000000000","message":"OK I guess you\u0027re checking this because the compute API unshelve method allows unshelving for both shelved and shelved_offloaded:\n\n    @check_instance_state(vm_state\u003d[vm_states.SHELVED,\n        vm_states.SHELVED_OFFLOADED])\n    def unshelve(self, context, instance):\n\nAnd in the case of shelved (not offloaded) the port resource requests still apply to the host on which the instance \u0027lives\u0027. That\u0027s potentially racy if the nova-compute service automatically offloads the server while we\u0027re doing this check (the _poll_shelved_instances periodic task), but that task should also be setting the task_state so the API would reject the unshelve while the periodic task is running (I\u0027m sure we could still miss that window but it\u0027s always existed so nothing new to worry about here).","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3847abccdb7b5ccd7f989a471b70a88d394fea98","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        context.can(shelve_policies.POLICY_ROOT % \u0027unshelve\u0027)"},{"line_number":83,"context_line":"        instance \u003d common.get_instance(self.compute_api, context, id)"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"        if (instance.vm_state \u003d\u003d vm_states.SHELVED_OFFLOADED"},{"line_number":86,"context_line":"                and common.instance_has_port_with_resource_request("},{"line_number":87,"context_line":"                    context, instance.uuid, self.network_api)"},{"line_number":88,"context_line":"                and not common.supports_port_resource_request_during_move("}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_803d49de","line":85,"range":{"start_line":85,"start_character":43,"end_line":85,"end_character":60},"in_reply_to":"9fdfeff1_465482ff","updated":"2019-01-30 16:21:20.000000000","message":"Yes, it is safe to unshelve a not offloaded instance as the allocation is still in place.\n\nI agree that there is a window of possible race. If we want o play safe then we can reject unshelve even if the instance is not offloaded at the moment of this check. It is safer but a bit more restrictive.","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1e6eeb06c60c6c6b1a94b137b13a210d9639412e","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    req)):"},{"line_number":90,"context_line":"            msg \u003d _(\"The unshelve server operation on a shelve offloaded \""},{"line_number":91,"context_line":"                    \"server with port having QoS policy is not supported.\")"},{"line_number":92,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            self.compute_api.unshelve(context, instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_c6db9279","line":92,"range":{"start_line":92,"start_character":22,"end_line":92,"end_character":36},"updated":"2019-01-28 18:22:28.000000000","message":"I was wondering if we should be using a 409 for these errors but looking at MultiattachNotSupportedOldMicroversion we handle those as a 400 error. One could maybe argue that you could perform the operation if you detach the ports and thus get around a 409 conflict case, but maybe that\u0027s just slitting hairs.","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3847abccdb7b5ccd7f989a471b70a88d394fea98","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    req)):"},{"line_number":90,"context_line":"            msg \u003d _(\"The unshelve server operation on a shelve offloaded \""},{"line_number":91,"context_line":"                    \"server with port having QoS policy is not supported.\")"},{"line_number":92,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            self.compute_api.unshelve(context, instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_200fbd37","line":92,"range":{"start_line":92,"start_character":22,"end_line":92,"end_character":36},"in_reply_to":"9fdfeff1_3ab94ee8","updated":"2019-01-30 16:21:20.000000000","message":"I\u0027m really not sure what would be a good HTTP response code for these rejects. I went with the consistent 400 but I can accept any agreed code as a solution.","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3136656178ee6ff4ae3d40846ad4e3dbfb38010d","unresolved":false,"context_lines":[{"line_number":89,"context_line":"                    req)):"},{"line_number":90,"context_line":"            msg \u003d _(\"The unshelve server operation on a shelve offloaded \""},{"line_number":91,"context_line":"                    \"server with port having QoS policy is not supported.\")"},{"line_number":92,"context_line":"            raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        try:"},{"line_number":95,"context_line":"            self.compute_api.unshelve(context, instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_3ab94ee8","line":92,"range":{"start_line":92,"start_character":22,"end_line":92,"end_character":36},"in_reply_to":"9fdfeff1_c6db9279","updated":"2019-01-28 19:29:04.000000000","message":"s/slitting/splitting/","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"}],"nova/tests/unit/api/openstack/compute/test_shelve.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1e6eeb06c60c6c6b1a94b137b13a210d9639412e","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API.list_ports\u0027)"},{"line_number":67,"context_line":"    @mock.patch(\u0027nova.api.openstack.common.get_instance\u0027)"},{"line_number":68,"context_line":"    def test_unshelve_offloaded_with_port_resource_request_old_microversion("},{"line_number":69,"context_line":"            self, get_instance_mock, mock_list_ports):"},{"line_number":70,"context_line":"        mock_list_ports.return_value \u003d {\u0027ports\u0027: ["},{"line_number":71,"context_line":"            {\u0027resource_request\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_26393ea3","line":68,"range":{"start_line":68,"start_character":8,"end_line":68,"end_character":75},"updated":"2019-01-28 18:22:28.000000000","message":"Redundant with the functional test so I\u0027m not sure we need this.","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3847abccdb7b5ccd7f989a471b70a88d394fea98","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API.list_ports\u0027)"},{"line_number":67,"context_line":"    @mock.patch(\u0027nova.api.openstack.common.get_instance\u0027)"},{"line_number":68,"context_line":"    def test_unshelve_offloaded_with_port_resource_request_old_microversion("},{"line_number":69,"context_line":"            self, get_instance_mock, mock_list_ports):"},{"line_number":70,"context_line":"        mock_list_ports.return_value \u003d {\u0027ports\u0027: ["},{"line_number":71,"context_line":"            {\u0027resource_request\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_9b005803","line":68,"range":{"start_line":68,"start_character":8,"end_line":68,"end_character":75},"in_reply_to":"9fdfeff1_26393ea3","updated":"2019-01-30 16:21:20.000000000","message":"Yeah, let\u0027s keep the functional.","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ed19a9b32f7f3d26fb6ac78efae37388e8d2bc7","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    @mock.patch(\u0027nova.network.neutronv2.api.API.list_ports\u0027)"},{"line_number":67,"context_line":"    @mock.patch(\u0027nova.api.openstack.common.get_instance\u0027)"},{"line_number":68,"context_line":"    def test_unshelve_offloaded_with_port_resource_request_old_microversion("},{"line_number":69,"context_line":"            self, get_instance_mock, mock_list_ports):"},{"line_number":70,"context_line":"        mock_list_ports.return_value \u003d {\u0027ports\u0027: ["},{"line_number":71,"context_line":"            {\u0027resource_request\u0027: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_04ffe434","line":68,"range":{"start_line":68,"start_character":8,"end_line":68,"end_character":75},"in_reply_to":"9fdfeff1_9b005803","updated":"2019-02-04 18:11:27.000000000","message":"Done","commit_id":"0b92325fe14eda062c78de2c3423ca4834861152"}]}
