)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"fd066b0320b274ca90d502228010996e9e1a967e","unresolved":false,"context_lines":[{"line_number":16,"context_line":"reject such request."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I7e1edede827cf8469771c0496b1dce55c627cf5d"},{"line_number":19,"context_line":"blueprint: bandwidth-resource-provider"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_48280fe1","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":38},"updated":"2018-05-24 22:00:28.000000000","message":"This patch breaks things that work today. Previously we agreed this is okay because we consider the current behavior to be a bug, not a missing feature. So should we open a bug and refer to it here?","commit_id":"699cc474aed0919688ba3ee5f07c6fcc66eb7f80"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"6fe5bf6afe525c4928f7485a9b552cb6feace6b2","unresolved":false,"context_lines":[{"line_number":16,"context_line":"reject such request."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I7e1edede827cf8469771c0496b1dce55c627cf5d"},{"line_number":19,"context_line":"blueprint: bandwidth-resource-provider"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_333484fb","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":38},"in_reply_to":"5f7c97a3_3c5dac78","updated":"2018-06-05 12:07:08.000000000","message":"Sounds reasonable. That\u0027s better if we don\u0027t break anything.","commit_id":"699cc474aed0919688ba3ee5f07c6fcc66eb7f80"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fb8500d80953917d26e0360320315079776c6413","unresolved":false,"context_lines":[{"line_number":16,"context_line":"reject such request."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I7e1edede827cf8469771c0496b1dce55c627cf5d"},{"line_number":19,"context_line":"blueprint: bandwidth-resource-provider"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5f7c97a3_3c5dac78","line":19,"range":{"start_line":19,"start_character":0,"end_line":19,"end_character":38},"in_reply_to":"5f7c97a3_48280fe1","updated":"2018-05-31 09:57:10.000000000","message":"I always end up in this discussion with myself too. :)\n\nThe only backend that implements minimum bandwidth policy is the SRIOV backend [1]. So there could be Neutron network with QoS minimum bandwidth policy backed by SRIOV backends.\nIf the user creates a server and specifies this network in the request then we could have a problem. BUT I expect that nova fails already today as nova only creates PCI request internally if an SRIOV port is requested [2] in the server create not a network. This also hinted by the networking guide by having a pre-created port in the SRIOV example [3].\n\n\nI\u0027ve updated the commit message of both patch with explanation.\n\n[1]https://docs.openstack.org/neutron/latest/admin/config-qos.html#supported-qos-rule-types\n[2] https://github.com/openstack/nova/blob/881103c9bfc2606ec9e1b7ae9447c88f0d1813be/nova/network/neutronv2/api.py#L1584-L1587\n[3] https://docs.openstack.org/neutron/latest/admin/config-sriov.html#launching-instances-with-sr-iov-ports","commit_id":"699cc474aed0919688ba3ee5f07c6fcc66eb7f80"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7867608f1fb6f95523f4f9c3b982949fbbdb5ef5","unresolved":false,"context_lines":[{"line_number":13,"context_line":"of scope for the first iteration of this feature."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"To avoid resource allocation inconsistencies this patch propose to"},{"line_number":16,"context_line":"reject such request. This rejection does not break any existing as"},{"line_number":17,"context_line":"minimum bandwidth policy rule only supported by the SRIOV Neutron"},{"line_number":18,"context_line":"backend but Nova only support booting with SRIOV port if those ports"},{"line_number":19,"context_line":"are precreated in Neutron."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"9fdfeff1_4c1e1771","line":16,"range":{"start_line":16,"start_character":55,"end_line":16,"end_character":63},"updated":"2019-01-24 19:21:33.000000000","message":"existing what? use cases?","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":13,"context_line":"of scope for the first iteration of this feature."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"To avoid resource allocation inconsistencies this patch propose to"},{"line_number":16,"context_line":"reject such request. This rejection does not break any existing as"},{"line_number":17,"context_line":"minimum bandwidth policy rule only supported by the SRIOV Neutron"},{"line_number":18,"context_line":"backend but Nova only support booting with SRIOV port if those ports"},{"line_number":19,"context_line":"are precreated in Neutron."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":18,"id":"9fdfeff1_a280d0c0","line":16,"range":{"start_line":16,"start_character":55,"end_line":16,"end_character":63},"in_reply_to":"9fdfeff1_4c1e1771","updated":"2019-01-26 16:33:53.000000000","message":"Done.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9e75c3f881d0990883a39d011bb69240afe7e8f0","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When nova needs to create ports in Neutron in a network that has minimum"},{"line_number":10,"context_line":"bandwidth policy Nova would need to create allocation for the bandwidth"},{"line_number":11,"context_line":"resources. The port creation happens in the compute manager after the"},{"line_number":12,"context_line":"scheduling and resource claiming. Supporting for this is considered out"},{"line_number":13,"context_line":"of scope for the first iteration of this feature."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"To avoid resource allocation inconsistencies this patch propose to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":20,"id":"9fdfeff1_f570ac0a","line":12,"range":{"start_line":12,"start_character":34,"end_line":12,"end_character":44},"updated":"2019-01-29 13:24:24.000000000","message":"Support","commit_id":"8364abecfafdbe2a7f65ea5e7b787bcbb6412844"}],"nova/api/openstack/compute/attach_interfaces.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7867608f1fb6f95523f4f9c3b982949fbbdb5ef5","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                exception.AttachInterfaceNotSupported,"},{"line_number":139,"context_line":"                exception.SecurityGroupCannotBeApplied,"},{"line_number":140,"context_line":"                exception.NetworkInterfaceTaggedAttachNotSupported,"},{"line_number":141,"context_line":"                exception.NetworksWithQoSPolicyNotSupported) as e:"},{"line_number":142,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":143,"context_line":"        except (exception.InstanceIsLocked,"},{"line_number":144,"context_line":"                exception.FixedIpAlreadyInUse,"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_f770f4a7","line":141,"updated":"2019-01-24 19:21:33.000000000","message":"We don\u0027t handle this in https://github.com/openstack/nova/blob/56811efa3583dfa3c03f9e43a9802bbe21e45bbd/nova/api/openstack/compute/servers.py#L561 for server create because by the time we\u0027d hit that error we have returned the response to the caller.\n\nHowever, what happens to the server if we fail during server create? Do we reschedule or abort the build and put the instance into error status?\n\nWe call network_api.allocate_for_instance starting here in compute:\n\nhttps://github.com/openstack/nova/blob/56811efa3583dfa3c03f9e43a9802bbe21e45bbd/nova/compute/manager.py#L2267\n\nBut because of the NetworkInfoAsyncWrapper, I don\u0027t think we\u0027ll handle the error here:\n\nhttps://github.com/openstack/nova/blob/56811efa3583dfa3c03f9e43a9802bbe21e45bbd/nova/compute/manager.py#L2282\n\nI think we end up handling it here:\n\nhttps://github.com/openstack/nova/blob/56811efa3583dfa3c03f9e43a9802bbe21e45bbd/nova/compute/manager.py#L2206\n\nWhich triggers a reschedule that is just going to fail (unless it hits an older compute that doesn\u0027t have that check, but that\u0027s also bad as we\u0027re not accounting for resource usage).\n\nSo I think like other networking failures that trigger a build abort exception, you need to handle that new exception here:\n\nhttps://github.com/openstack/nova/blob/56811efa3583dfa3c03f9e43a9802bbe21e45bbd/nova/compute/manager.py#L2168","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":138,"context_line":"                exception.AttachInterfaceNotSupported,"},{"line_number":139,"context_line":"                exception.SecurityGroupCannotBeApplied,"},{"line_number":140,"context_line":"                exception.NetworkInterfaceTaggedAttachNotSupported,"},{"line_number":141,"context_line":"                exception.NetworksWithQoSPolicyNotSupported) as e:"},{"line_number":142,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":143,"context_line":"        except (exception.InstanceIsLocked,"},{"line_number":144,"context_line":"                exception.FixedIpAlreadyInUse,"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_02919c4e","line":141,"in_reply_to":"9fdfeff1_f770f4a7","updated":"2019-01-26 16:33:53.000000000","message":"You are right. I followed your suggestion. See more details in my reply in the functional test of the server create.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"}],"nova/exception.py":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"fd066b0320b274ca90d502228010996e9e1a967e","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"                \"instance %(instance_uuid)s.\")"},{"line_number":2107,"context_line":""},{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"class NetworksWithQoSPolicyNotSupported(Invalid):"},{"line_number":2110,"context_line":"    msg_fmt \u003d _(\"Using networks with QoS policy is not supported for \""},{"line_number":2111,"context_line":"                \"instance %(instance_uuid)s.\")"},{"line_number":2112,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_28703308","line":2109,"range":{"start_line":2109,"start_character":27,"end_line":2109,"end_character":39},"updated":"2018-05-24 22:00:28.000000000","message":"I\u0027m not familiar with nova exception naming standards but in my mind there\u0027s a difference between NotSupported (ever) and NotImplemented (yet). Maybe the latter would be a better name. The same in msg_fmt.","commit_id":"699cc474aed0919688ba3ee5f07c6fcc66eb7f80"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fb8500d80953917d26e0360320315079776c6413","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"                \"instance %(instance_uuid)s.\")"},{"line_number":2107,"context_line":""},{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"class NetworksWithQoSPolicyNotSupported(Invalid):"},{"line_number":2110,"context_line":"    msg_fmt \u003d _(\"Using networks with QoS policy is not supported for \""},{"line_number":2111,"context_line":"                \"instance %(instance_uuid)s.\")"},{"line_number":2112,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_fcabb4d2","line":2109,"range":{"start_line":2109,"start_character":27,"end_line":2109,"end_character":39},"in_reply_to":"5f7c97a3_28703308","updated":"2018-05-31 09:57:10.000000000","message":"Looking at the existing exception names [1]. It feels that nova use the not supported term in (almost) every case to regardless if the situation of the support might change in the future or not. For example if a virt driver does not support interface attach to a running instance then AttachInterfaceNotSupported is raised. However that is also something that can be implemented in a driver later. \n\n[1] http://paste.openstack.org/show/722272/","commit_id":"699cc474aed0919688ba3ee5f07c6fcc66eb7f80"},{"author":{"_account_id":20722,"name":"Yikun Jiang","email":"yikunkero@gmail.com","username":"yikunkero"},"change_message_id":"83f20010afd2bdc148757b00ccb63eb1509b4b4a","unresolved":false,"context_lines":[{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"class NetworksWithQoSPolicyNotSupported(Invalid):"},{"line_number":2110,"context_line":"    msg_fmt \u003d _(\"Using networks with QoS policy is not supported for \""},{"line_number":2111,"context_line":"                \"instance %(instance_uuid)s.\")"},{"line_number":2112,"context_line":""},{"line_number":2113,"context_line":""},{"line_number":2114,"context_line":"class InstanceDiagnosticsNotSupported(Invalid):"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_03158ce5","line":2111,"range":{"start_line":2111,"start_character":28,"end_line":2111,"end_character":41},"updated":"2018-06-15 07:29:09.000000000","message":"Same suggestion, we need give the network id rather than instance_uuid.","commit_id":"b6591211b37f12a27ff48fbb8e61d77cae419e57"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"6115bfd7a3cbd8095b0212cbac275fb08de76782","unresolved":false,"context_lines":[{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"class NetworksWithQoSPolicyNotSupported(Invalid):"},{"line_number":2110,"context_line":"    msg_fmt \u003d _(\"Using networks with QoS policy is not supported for \""},{"line_number":2111,"context_line":"                \"instance %(instance_uuid)s.\")"},{"line_number":2112,"context_line":""},{"line_number":2113,"context_line":""},{"line_number":2114,"context_line":"class InstanceDiagnosticsNotSupported(Invalid):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_7efee138","line":2111,"range":{"start_line":2111,"start_character":28,"end_line":2111,"end_character":41},"in_reply_to":"5f7c97a3_03158ce5","updated":"2018-09-28 15:37:58.000000000","message":"Both is added now. Done.","commit_id":"b6591211b37f12a27ff48fbb8e61d77cae419e57"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"fd066b0320b274ca90d502228010996e9e1a967e","unresolved":false,"context_lines":[{"line_number":439,"context_line":""},{"line_number":440,"context_line":"            port \u003d port_response[\u0027port\u0027]"},{"line_number":441,"context_line":"            port_id \u003d port[\u0027id\u0027]"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"            if port.get(\u0027resource_request\u0027, None):"},{"line_number":444,"context_line":"                port_client.delete_port(port_id)"},{"line_number":445,"context_line":"                raise exception.NetworksWithQoSPolicyNotSupported("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_281b53ca","line":442,"updated":"2018-05-24 22:00:28.000000000","message":"What about adding a comment here: This is to be removed when port creation happens before scheduling? You may also refer to:\n\nhttps://specs.openstack.org/openstack/nova-specs/specs/pike/approved/prep-for-network-aware-scheduling-pike.html","commit_id":"699cc474aed0919688ba3ee5f07c6fcc66eb7f80"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"fb8500d80953917d26e0360320315079776c6413","unresolved":false,"context_lines":[{"line_number":439,"context_line":""},{"line_number":440,"context_line":"            port \u003d port_response[\u0027port\u0027]"},{"line_number":441,"context_line":"            port_id \u003d port[\u0027id\u0027]"},{"line_number":442,"context_line":""},{"line_number":443,"context_line":"            if port.get(\u0027resource_request\u0027, None):"},{"line_number":444,"context_line":"                port_client.delete_port(port_id)"},{"line_number":445,"context_line":"                raise exception.NetworksWithQoSPolicyNotSupported("}],"source_content_type":"text/x-python","patch_set":1,"id":"5f7c97a3_fc52d466","line":442,"in_reply_to":"5f7c97a3_281b53ca","updated":"2018-05-31 09:57:10.000000000","message":"Sure I can do that. Done.","commit_id":"699cc474aed0919688ba3ee5f07c6fcc66eb7f80"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"fd5bc5419ac8a2ac012dfd824f54ad8c71fff9c1","unresolved":false,"context_lines":[{"line_number":506,"context_line":"            port \u003d port_response[\u0027port\u0027]"},{"line_number":507,"context_line":"            port_id \u003d port[\u0027id\u0027]"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"            if port.get(\u0027resource_request\u0027, None):"},{"line_number":510,"context_line":"                port_client.delete_port(port_id)"},{"line_number":511,"context_line":"                # NOTE(gibi): This limitation can be removed when the port"},{"line_number":512,"context_line":"                # creation is moved to the conductor."}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_8a3cdfea","line":509,"updated":"2018-11-06 01:01:11.000000000","message":"Note to self: if the created port is on a network with QoS policy, the port will have the \u0027resource_request\u0027 response parameter in it.\n\nhttps://developer.openstack.org/api-ref/network/v2/index.html?expanded\u003dcreate-port-detail#id57","commit_id":"8790a18433db0df7b0267ff96f8ed0db34096243"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"292d109beb7ad41a7f1862fd178592e307f38a98","unresolved":false,"context_lines":[{"line_number":487,"context_line":"        :raises NoMoreFixedIps: If neutron fails with"},{"line_number":488,"context_line":"            IpAddressGenerationFailure error."},{"line_number":489,"context_line":"        :raises: PortBindingFailed: If port binding failed."},{"line_number":490,"context_line":"        \"\"\""},{"line_number":491,"context_line":"        # Set the device_id so it\u0027s clear who this port was created for,"},{"line_number":492,"context_line":"        # and to stop other instances trying to use it"},{"line_number":493,"context_line":"        port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: instance.uuid}}"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_a354a1c6","line":490,"updated":"2018-12-03 14:57:26.000000000","message":"Could be mentioned here:\n\n:raises exception.NetworksWithQoSPolicyNotSupported:","commit_id":"ebd39f10cf45a4ba7bbd12d37b6e5b05c2a60253"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"30079d609bfac11c979390206527600b80d71654","unresolved":false,"context_lines":[{"line_number":487,"context_line":"        :raises NoMoreFixedIps: If neutron fails with"},{"line_number":488,"context_line":"            IpAddressGenerationFailure error."},{"line_number":489,"context_line":"        :raises: PortBindingFailed: If port binding failed."},{"line_number":490,"context_line":"        \"\"\""},{"line_number":491,"context_line":"        # Set the device_id so it\u0027s clear who this port was created for,"},{"line_number":492,"context_line":"        # and to stop other instances trying to use it"},{"line_number":493,"context_line":"        port_req_body \u003d {\u0027port\u0027: {\u0027device_id\u0027: instance.uuid}}"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_46383bcb","line":490,"in_reply_to":"3f79a3b5_a354a1c6","updated":"2018-12-03 15:14:29.000000000","message":"Done","commit_id":"ebd39f10cf45a4ba7bbd12d37b6e5b05c2a60253"},{"author":{"_account_id":17685,"name":"Elod Illes","email":"elod.illes@est.tech","username":"elod.illes"},"change_message_id":"5ef7e1032c800efd01178c0e65d48e6960fa0b7c","unresolved":false,"context_lines":[{"line_number":488,"context_line":"            IpAddressGenerationFailure error."},{"line_number":489,"context_line":"        :raises: PortBindingFailed: If port binding failed."},{"line_number":490,"context_line":"        :raises NetworksWithQoSPolicyNotSupported: if the created port has"},{"line_number":491,"context_line":"                resource request."},{"line_number":492,"context_line":"        \"\"\""},{"line_number":493,"context_line":"        # Set the device_id so it\u0027s clear who this port was created for,"},{"line_number":494,"context_line":"        # and to stop other instances trying to use it"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_797b982a","line":491,"range":{"start_line":491,"start_character":12,"end_line":491,"end_character":16},"updated":"2018-12-03 16:08:25.000000000","message":"nit: indent :]","commit_id":"c7f0765bad59f7602cb77e15994c23f735165cab"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7867608f1fb6f95523f4f9c3b982949fbbdb5ef5","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            # need resource allocation manipulation in placement but might also"},{"line_number":514,"context_line":"            # need a new scheduling if resource on this host is not available."},{"line_number":515,"context_line":"            if port.get(\u0027resource_request\u0027, None):"},{"line_number":516,"context_line":"                port_client.delete_port(port_id)"},{"line_number":517,"context_line":"                # NOTE(gibi): This limitation regarding server create can be"},{"line_number":518,"context_line":"                # removed when the port creation is moved to the conductor. But"},{"line_number":519,"context_line":"                # this code also limits attaching a network that has QoS"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_cc09a731","line":516,"range":{"start_line":516,"start_character":16,"end_line":516,"end_character":48},"updated":"2019-01-24 19:21:33.000000000","message":"You might want to wrap this cleanup in a try/except and just log it if the port deletion fails.\n\nYou may also want to split this off into a helper method.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            # need resource allocation manipulation in placement but might also"},{"line_number":514,"context_line":"            # need a new scheduling if resource on this host is not available."},{"line_number":515,"context_line":"            if port.get(\u0027resource_request\u0027, None):"},{"line_number":516,"context_line":"                port_client.delete_port(port_id)"},{"line_number":517,"context_line":"                # NOTE(gibi): This limitation regarding server create can be"},{"line_number":518,"context_line":"                # removed when the port creation is moved to the conductor. But"},{"line_number":519,"context_line":"                # this code also limits attaching a network that has QoS"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_a2e450e1","line":516,"range":{"start_line":516,"start_character":16,"end_line":516,"end_character":48},"in_reply_to":"9fdfeff1_cc09a731","updated":"2019-01-26 16:33:53.000000000","message":"Done","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7867608f1fb6f95523f4f9c3b982949fbbdb5ef5","unresolved":false,"context_lines":[{"line_number":517,"context_line":"                # NOTE(gibi): This limitation regarding server create can be"},{"line_number":518,"context_line":"                # removed when the port creation is moved to the conductor. But"},{"line_number":519,"context_line":"                # this code also limits attaching a network that has QoS"},{"line_number":520,"context_line":"                # minimum bandwidth rule"},{"line_number":521,"context_line":"                raise exception.NetworksWithQoSPolicyNotSupported("},{"line_number":522,"context_line":"                    instance_uuid\u003dinstance.uuid, network_id\u003dnetwork_id)"},{"line_number":523,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_5703000e","line":520,"range":{"start_line":520,"start_character":36,"end_line":520,"end_character":40},"updated":"2019-01-24 19:21:33.000000000","message":"rule.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":517,"context_line":"                # NOTE(gibi): This limitation regarding server create can be"},{"line_number":518,"context_line":"                # removed when the port creation is moved to the conductor. But"},{"line_number":519,"context_line":"                # this code also limits attaching a network that has QoS"},{"line_number":520,"context_line":"                # minimum bandwidth rule"},{"line_number":521,"context_line":"                raise exception.NetworksWithQoSPolicyNotSupported("},{"line_number":522,"context_line":"                    instance_uuid\u003dinstance.uuid, network_id\u003dnetwork_id)"},{"line_number":523,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_c2e954b7","line":520,"range":{"start_line":520,"start_character":36,"end_line":520,"end_character":40},"in_reply_to":"9fdfeff1_5703000e","updated":"2019-01-26 16:33:53.000000000","message":"Done","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"792a56613ac26d2ae572cc930f754799b1800171","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        except neutron_client_exc.NeutronClientException:"},{"line_number":479,"context_line":"            LOG.exception("},{"line_number":480,"context_line":"                \u0027Failed to delete port %(port_id)s while cleaning up after an \u0027"},{"line_number":481,"context_line":"                \u0027error during server create.\u0027, {\u0027port_id\u0027: port_id},"},{"line_number":482,"context_line":"                instance\u003dinstance)"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    def _create_port_minimal(self, port_client, instance, network_id,"}],"source_content_type":"text/x-python","patch_set":19,"id":"9fdfeff1_d4e5800a","line":481,"range":{"start_line":481,"start_character":22,"end_line":481,"end_character":43},"updated":"2019-01-28 14:24:46.000000000","message":"nit: I would remove this to keep the method generic. You could also hit this during port attach right?","commit_id":"651318bf522a4b997f5cb39df50bf9f07d6e15d0"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6db68492670094ae71612ebbf5ce18c0b91bf62b","unresolved":false,"context_lines":[{"line_number":478,"context_line":"        except neutron_client_exc.NeutronClientException:"},{"line_number":479,"context_line":"            LOG.exception("},{"line_number":480,"context_line":"                \u0027Failed to delete port %(port_id)s while cleaning up after an \u0027"},{"line_number":481,"context_line":"                \u0027error during server create.\u0027, {\u0027port_id\u0027: port_id},"},{"line_number":482,"context_line":"                instance\u003dinstance)"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"    def _create_port_minimal(self, port_client, instance, network_id,"}],"source_content_type":"text/x-python","patch_set":19,"id":"9fdfeff1_14030875","line":481,"range":{"start_line":481,"start_character":22,"end_line":481,"end_character":43},"in_reply_to":"9fdfeff1_d4e5800a","updated":"2019-01-28 14:50:54.000000000","message":"Done","commit_id":"651318bf522a4b997f5cb39df50bf9f07d6e15d0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9e75c3f881d0990883a39d011bb69240afe7e8f0","unresolved":false,"context_lines":[{"line_number":521,"context_line":"            # such ports are currently not supported as they would at least"},{"line_number":522,"context_line":"            # need resource allocation manipulation in placement but might also"},{"line_number":523,"context_line":"            # need a new scheduling if resource on this host is not available."},{"line_number":524,"context_line":"            if port.get(\u0027resource_request\u0027, None):"},{"line_number":525,"context_line":"                self._cleanup_created_port(port_client, port_id, instance)"},{"line_number":526,"context_line":"                # NOTE(gibi): This limitation regarding server create can be"},{"line_number":527,"context_line":"                # removed when the port creation is moved to the conductor. But"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_35d954f2","line":524,"updated":"2019-01-29 13:24:24.000000000","message":"nit: might be nice to have an INFO log here stating that the auto-created port is being deleted due to the network having a QoS policy on it.","commit_id":"8364abecfafdbe2a7f65ea5e7b787bcbb6412844"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0a3d1365a74160a0010d229d985d9f3fadc8448a","unresolved":false,"context_lines":[{"line_number":521,"context_line":"            # such ports are currently not supported as they would at least"},{"line_number":522,"context_line":"            # need resource allocation manipulation in placement but might also"},{"line_number":523,"context_line":"            # need a new scheduling if resource on this host is not available."},{"line_number":524,"context_line":"            if port.get(\u0027resource_request\u0027, None):"},{"line_number":525,"context_line":"                self._cleanup_created_port(port_client, port_id, instance)"},{"line_number":526,"context_line":"                # NOTE(gibi): This limitation regarding server create can be"},{"line_number":527,"context_line":"                # removed when the port creation is moved to the conductor. But"}],"source_content_type":"text/x-python","patch_set":20,"id":"9fdfeff1_07d985f1","line":524,"in_reply_to":"9fdfeff1_35d954f2","updated":"2019-01-29 16:19:37.000000000","message":"Done in a fup","commit_id":"8364abecfafdbe2a7f65ea5e7b787bcbb6412844"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7867608f1fb6f95523f4f9c3b982949fbbdb5ef5","unresolved":false,"context_lines":[{"line_number":5410,"context_line":"        # created in the network that is attached. Make sure that neutron"},{"line_number":5411,"context_line":"        # returns a port that has resource request."},{"line_number":5412,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5413,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5414,"context_line":""},{"line_number":5415,"context_line":"        # try to attach a network"},{"line_number":5416,"context_line":"        post \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_97b40837","line":5413,"range":{"start_line":5413,"start_character":48,"end_line":5413,"end_character":74},"updated":"2019-01-24 19:21:33.000000000","message":"I guess this uses network_1 in the fixture. Alternative to this mock is we could define a network_2 or something and then port_with_resource_request is on that network, so when you try to attach from that network you get back port_with_resource_request from the fixture.\n\nAnyway, you don\u0027t have to make that change here and now, just something to think about if we have to do this mock dance in lots of functional tests.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"53fe898ee16d433482185444389b86c86ba43812","unresolved":false,"context_lines":[{"line_number":5410,"context_line":"        # created in the network that is attached. Make sure that neutron"},{"line_number":5411,"context_line":"        # returns a port that has resource request."},{"line_number":5412,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5413,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5414,"context_line":""},{"line_number":5415,"context_line":"        # try to attach a network"},{"line_number":5416,"context_line":"        post \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_575432ff","line":5413,"range":{"start_line":5413,"start_character":48,"end_line":5413,"end_character":74},"in_reply_to":"9fdfeff1_3465ec1e","updated":"2019-01-28 14:54:54.000000000","message":"Nova uses the auto-allocated-topology API yes, but not the is_default field. Are you saying that went into neutron at the same time as the auto-allocated-topology stuff?","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2109b836ed9e42a52e1f0646f35b24bf173c707a","unresolved":false,"context_lines":[{"line_number":5410,"context_line":"        # created in the network that is attached. Make sure that neutron"},{"line_number":5411,"context_line":"        # returns a port that has resource request."},{"line_number":5412,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5413,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5414,"context_line":""},{"line_number":5415,"context_line":"        # try to attach a network"},{"line_number":5416,"context_line":"        post \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_7e64a122","line":5413,"range":{"start_line":5413,"start_character":48,"end_line":5413,"end_character":74},"in_reply_to":"9fdfeff1_575432ff","updated":"2019-01-29 08:32:35.000000000","message":"at least right now there is is_default in the neutron API for networks.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":5410,"context_line":"        # created in the network that is attached. Make sure that neutron"},{"line_number":5411,"context_line":"        # returns a port that has resource request."},{"line_number":5412,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5413,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5414,"context_line":""},{"line_number":5415,"context_line":"        # try to attach a network"},{"line_number":5416,"context_line":"        post \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_a2fd306f","line":5413,"range":{"start_line":5413,"start_character":48,"end_line":5413,"end_character":74},"in_reply_to":"9fdfeff1_97b40837","updated":"2019-01-26 16:33:53.000000000","message":"Globally pre-defining network_2 breaks all of our tests that are using \u0027auto\u0027 network allocation as nova will reject \u0027auto\u0027 due to ambiguity. \n\nLocally in this test we could register a second network and adapt the fixture to return the port_with_resource_request after port create in that network but that will be more code in the fixture than this single line mock here. So I\u0027m not eager to do that.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"792a56613ac26d2ae572cc930f754799b1800171","unresolved":false,"context_lines":[{"line_number":5410,"context_line":"        # created in the network that is attached. Make sure that neutron"},{"line_number":5411,"context_line":"        # returns a port that has resource request."},{"line_number":5412,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5413,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5414,"context_line":""},{"line_number":5415,"context_line":"        # try to attach a network"},{"line_number":5416,"context_line":"        post \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_d4db4079","line":5413,"range":{"start_line":5413,"start_character":48,"end_line":5413,"end_character":74},"in_reply_to":"9fdfeff1_a2fd306f","updated":"2019-01-28 14:24:46.000000000","message":"OK fair enough. I know at one point Hongbin was pushing for a \u0027default\u0027 field on neutron networks which nova could then use to determine which network to use if there were multiple. I guess if that ever happens we can rely on that field.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"6db68492670094ae71612ebbf5ce18c0b91bf62b","unresolved":false,"context_lines":[{"line_number":5410,"context_line":"        # created in the network that is attached. Make sure that neutron"},{"line_number":5411,"context_line":"        # returns a port that has resource request."},{"line_number":5412,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5413,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5414,"context_line":""},{"line_number":5415,"context_line":"        # try to attach a network"},{"line_number":5416,"context_line":"        post \u003d {"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_3465ec1e","line":5413,"range":{"start_line":5413,"start_character":48,"end_line":5413,"end_character":74},"in_reply_to":"9fdfeff1_d4db4079","updated":"2019-01-28 14:50:54.000000000","message":"Now that you said that I opened Neutron API and there is such a thing https://developer.openstack.org/api-ref/network/v2/?expanded\u003dshow-network-details-detail,show-auto-allocated-topology-details-detail#show-auto-allocated-topology-details \n\nAnd now I found that nova actually use that API from microversion 2.37. So I guess I could fix every test that uses \u003e2.37 to use the network_1 from the fixture by implementing the above neutron call. I will try that in a separate patch","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0653d3229bba0619515f549f224c9086ef788997","unresolved":false,"context_lines":[{"line_number":5434,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5435,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5436,"context_line":""},{"line_number":5437,"context_line":"        server_req \u003d self._build_minimal_create_server_request("},{"line_number":5438,"context_line":"            self.api, \u0027trait-based-server\u0027,"},{"line_number":5439,"context_line":"            image_uuid\u003d\u002776fa36fc-c930-4bf3-8c8a-ea2a2420deb6\u0027,"},{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_7755e4c5","line":5437,"range":{"start_line":5437,"start_character":26,"end_line":5437,"end_character":62},"updated":"2019-01-24 19:23:10.000000000","message":"Why not use self._create_server here?","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":5434,"context_line":"        mock_neutron_create_port.return_value \u003d ("},{"line_number":5435,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5436,"context_line":""},{"line_number":5437,"context_line":"        server_req \u003d self._build_minimal_create_server_request("},{"line_number":5438,"context_line":"            self.api, \u0027trait-based-server\u0027,"},{"line_number":5439,"context_line":"            image_uuid\u003d\u002776fa36fc-c930-4bf3-8c8a-ea2a2420deb6\u0027,"},{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_c202b46f","line":5437,"range":{"start_line":5437,"start_character":26,"end_line":5437,"end_character":62},"in_reply_to":"9fdfeff1_7755e4c5","updated":"2019-01-26 16:33:53.000000000","message":"You are right.\nDone.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0653d3229bba0619515f549f224c9086ef788997","unresolved":false,"context_lines":[{"line_number":5435,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5436,"context_line":""},{"line_number":5437,"context_line":"        server_req \u003d self._build_minimal_create_server_request("},{"line_number":5438,"context_line":"            self.api, \u0027trait-based-server\u0027,"},{"line_number":5439,"context_line":"            image_uuid\u003d\u002776fa36fc-c930-4bf3-8c8a-ea2a2420deb6\u0027,"},{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"},{"line_number":5441,"context_line":"            networks\u003d[{\u0027uuid\u0027: self.neutron.network_1[\u0027id\u0027]}])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_d7461022","line":5438,"range":{"start_line":5438,"start_character":23,"end_line":5438,"end_character":28},"updated":"2019-01-24 19:23:10.000000000","message":"?","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":5435,"context_line":"            {\u0027port\u0027: copy.deepcopy(self.neutron.port_with_resource_request)})"},{"line_number":5436,"context_line":""},{"line_number":5437,"context_line":"        server_req \u003d self._build_minimal_create_server_request("},{"line_number":5438,"context_line":"            self.api, \u0027trait-based-server\u0027,"},{"line_number":5439,"context_line":"            image_uuid\u003d\u002776fa36fc-c930-4bf3-8c8a-ea2a2420deb6\u0027,"},{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"},{"line_number":5441,"context_line":"            networks\u003d[{\u0027uuid\u0027: self.neutron.network_1[\u0027id\u0027]}])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_62fbc878","line":5438,"range":{"start_line":5438,"start_character":23,"end_line":5438,"end_character":28},"in_reply_to":"9fdfeff1_d7461022","updated":"2019-01-26 16:33:53.000000000","message":"It was a badly made copy-paste :)","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7867608f1fb6f95523f4f9c3b982949fbbdb5ef5","unresolved":false,"context_lines":[{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"},{"line_number":5441,"context_line":"            networks\u003d[{\u0027uuid\u0027: self.neutron.network_1[\u0027id\u0027]}])"},{"line_number":5442,"context_line":""},{"line_number":5443,"context_line":"        # create a server"},{"line_number":5444,"context_line":"        server \u003d self.api.post_server(server\u003d{\u0027server\u0027: server_req})"},{"line_number":5445,"context_line":"        server \u003d self._wait_for_state_change(self.admin_api, server, \u0027ERROR\u0027)"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":"        self.assertEqual(400, server[\u0027fault\u0027][\u0027code\u0027])"},{"line_number":5448,"context_line":"        self.assertIn(\u0027Using networks with QoS policy is not supported for \u0027"},{"line_number":5449,"context_line":"                      \u0027instance\u0027,"},{"line_number":5450,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_37d3dc62","line":5450,"range":{"start_line":5443,"start_character":8,"end_line":5450,"end_character":49},"updated":"2019-01-24 19:21:33.000000000","message":"How is this working unless the test is using the CastAsCall fixture? The API should cast off to conductor which will cast off to compute which should hit the failure. The API user shouldn\u0027t see the 400 for this error when nova-compute is creating the server. I don\u0027t see PortResourceRequestBasedSchedulingTestBase or ProviderUsageBaseTestCase using the CastAsCall fixture though.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"},{"line_number":5441,"context_line":"            networks\u003d[{\u0027uuid\u0027: self.neutron.network_1[\u0027id\u0027]}])"},{"line_number":5442,"context_line":""},{"line_number":5443,"context_line":"        # create a server"},{"line_number":5444,"context_line":"        server \u003d self.api.post_server(server\u003d{\u0027server\u0027: server_req})"},{"line_number":5445,"context_line":"        server \u003d self._wait_for_state_change(self.admin_api, server, \u0027ERROR\u0027)"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":"        self.assertEqual(400, server[\u0027fault\u0027][\u0027code\u0027])"},{"line_number":5448,"context_line":"        self.assertIn(\u0027Using networks with QoS policy is not supported for \u0027"},{"line_number":5449,"context_line":"                      \u0027instance\u0027,"},{"line_number":5450,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_a2a8d08b","line":5450,"range":{"start_line":5443,"start_character":8,"end_line":5450,"end_character":49},"in_reply_to":"9fdfeff1_299373fc","updated":"2019-01-26 16:33:53.000000000","message":"OK now I see it. \nThe functional test setup is not complete / correct. :/ The fake virt driver\u0027s spawn() function does not trigger the completion of the _allocate_network_async() and therefore in the functional test the reschedule code path is not hit. Instead after the spawn a notification sending triggers the async execution by reading the network_info during the functional test. \n\nNow I changed the fake virt driver to trigger the async exec during spawn() and therefore I see your re-schedule problem.\n\nGood catch! Thanks!\n\nConverting the exception into BuildAbortException has the effect that here the fault code becomes 500 and the message becomes a generic message: \n\n\"Build of instance 77902ce0-42e9-4419-9044-2f364eaa8e94 aborted: Failed to allocate the network(s), not rescheduling.\"\n\nBut the logs are still containing the specific exception message with stacktrace.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bc29fb5c4f32b76615012438dcef2ab5334758af","unresolved":false,"context_lines":[{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"},{"line_number":5441,"context_line":"            networks\u003d[{\u0027uuid\u0027: self.neutron.network_1[\u0027id\u0027]}])"},{"line_number":5442,"context_line":""},{"line_number":5443,"context_line":"        # create a server"},{"line_number":5444,"context_line":"        server \u003d self.api.post_server(server\u003d{\u0027server\u0027: server_req})"},{"line_number":5445,"context_line":"        server \u003d self._wait_for_state_change(self.admin_api, server, \u0027ERROR\u0027)"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":"        self.assertEqual(400, server[\u0027fault\u0027][\u0027code\u0027])"},{"line_number":5448,"context_line":"        self.assertIn(\u0027Using networks with QoS policy is not supported for \u0027"},{"line_number":5449,"context_line":"                      \u0027instance\u0027,"},{"line_number":5450,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_d7e29001","line":5450,"range":{"start_line":5443,"start_character":8,"end_line":5450,"end_character":49},"in_reply_to":"9fdfeff1_37d3dc62","updated":"2019-01-24 19:29:36.000000000","message":"Oh nevermind, this is not a response, it\u0027s the fault on the server. That\u0027s good since CastAsCall isn\u0027t being used.\n\nHowever, I think it\u0027s hitting this because of:\n\nhttps://github.com/openstack/nova/blob/56811efa3583dfa3c03f9e43a9802bbe21e45bbd/nova/compute/manager.py#L1941\n\nSince there are no more hosts, there is nothing to retry.","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"e07b16fbe980c055854ae6f4062f375ab0dfc65a","unresolved":false,"context_lines":[{"line_number":5440,"context_line":"            flavor_id\u003dself.flavor[\u0027id\u0027],"},{"line_number":5441,"context_line":"            networks\u003d[{\u0027uuid\u0027: self.neutron.network_1[\u0027id\u0027]}])"},{"line_number":5442,"context_line":""},{"line_number":5443,"context_line":"        # create a server"},{"line_number":5444,"context_line":"        server \u003d self.api.post_server(server\u003d{\u0027server\u0027: server_req})"},{"line_number":5445,"context_line":"        server \u003d self._wait_for_state_change(self.admin_api, server, \u0027ERROR\u0027)"},{"line_number":5446,"context_line":""},{"line_number":5447,"context_line":"        self.assertEqual(400, server[\u0027fault\u0027][\u0027code\u0027])"},{"line_number":5448,"context_line":"        self.assertIn(\u0027Using networks with QoS policy is not supported for \u0027"},{"line_number":5449,"context_line":"                      \u0027instance\u0027,"},{"line_number":5450,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_299373fc","line":5450,"range":{"start_line":5443,"start_character":8,"end_line":5450,"end_character":49},"in_reply_to":"9fdfeff1_d7e29001","updated":"2019-01-25 14:30:32.000000000","message":"I don\u0027t see how this hits reschedule. Based on the logs this test hits https://github.com/openstack/nova/blob/56811efa3583dfa3c03f9e43a9802bbe21e45bbd/nova/compute/manager.py#L2017 Of course that is not optimal either.\n\nI can avoid the unexpectedness of NetworksWithQoSPolicyNotSupported if I make it derive both from Invalid (for the http error code for the interface attach) and from BuildAbortException (to make it an expected exception during create)","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7867608f1fb6f95523f4f9c3b982949fbbdb5ef5","unresolved":false,"context_lines":[{"line_number":3862,"context_line":"                                  \u0027(Network ID is %(net_id)s)\u0027 %"},{"line_number":3863,"context_line":"                                  {\u0027instance\u0027: instance.uuid,"},{"line_number":3864,"context_line":"                                   \u0027net_id\u0027: uuids.my_netid1})"},{"line_number":3865,"context_line":"        self.assertEqual(expected_exception_msg, str(exc))"},{"line_number":3866,"context_line":""},{"line_number":3867,"context_line":"    def test_get_network_detail_not_found(self):"},{"line_number":3868,"context_line":"        api \u003d neutronapi.API()"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_57d6a051","line":3865,"range":{"start_line":3865,"start_character":49,"end_line":3865,"end_character":52},"updated":"2019-01-24 19:21:33.000000000","message":"nit: typically six.text_type is used in case there is unicode (but since we control the message that is likely not a problem here).","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"21c26897ebadb92f57aabe63d05a5322b04a1794","unresolved":false,"context_lines":[{"line_number":3862,"context_line":"                                  \u0027(Network ID is %(net_id)s)\u0027 %"},{"line_number":3863,"context_line":"                                  {\u0027instance\u0027: instance.uuid,"},{"line_number":3864,"context_line":"                                   \u0027net_id\u0027: uuids.my_netid1})"},{"line_number":3865,"context_line":"        self.assertEqual(expected_exception_msg, str(exc))"},{"line_number":3866,"context_line":""},{"line_number":3867,"context_line":"    def test_get_network_detail_not_found(self):"},{"line_number":3868,"context_line":"        api \u003d neutronapi.API()"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_224620c2","line":3865,"range":{"start_line":3865,"start_character":49,"end_line":3865,"end_character":52},"in_reply_to":"9fdfeff1_57d6a051","updated":"2019-01-26 16:33:53.000000000","message":"Done","commit_id":"fbd57c388c5442cde6e53eeb3f4cae48faa46d1f"}]}
