)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8c93008d30900ebac1eeef959ded7029d024303d","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Carl Baldwin \u003ccarl.baldwin@hpe.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-03-30 19:28:54 +0000"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[WIP] Do something about the check for fixed_ips"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When booting a VM using an existing port, Nova checks that the port"},{"line_number":10,"context_line":"has fixed ips and fails if it doesn\u0027t.  We\u0027ve discussed this in the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"5a18252c_b6bd826a","line":7,"range":{"start_line":7,"start_character":6,"end_line":7,"end_character":48},"updated":"2016-04-13 15:20:35.000000000","message":"The title should probably be something like, allow IP allocation on a Neutron port to be deferred until host binding.  Or, something to that effect.","commit_id":"94b196d3bee1c17044a485e4f4008c321538f565"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8ba9ded15c5711327bf02d470246e56ffca0be6a","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When booting a VM using an existing port, Nova checks that the port"},{"line_number":10,"context_line":"has fixed ips and fails if it doesn\u0027t.  We\u0027ve discussed this in the"},{"line_number":11,"context_line":"context of Neutron routed networks where the port may not have an IP"},{"line_number":12,"context_line":"address because address allocation was deferred."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch is the minimum that I had to locally to allow deferring IP"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a122d0e_a87fa864","line":11,"updated":"2016-04-19 20:41:53.000000000","message":"Not just routed networks, but things like trunk ports also need ports without an IP assigned, right?","commit_id":"bfde17d39fd9d45b5e4714d5aa6f6ad25370472b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0cd5258a9c889a5f247fcba500a2977a24ea21e3","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When booting a VM using an existing port, Nova checks that the port"},{"line_number":10,"context_line":"has fixed ips and fails if it doesn\u0027t.  We\u0027ve discussed this in the"},{"line_number":11,"context_line":"context of Neutron routed networks where the port may not have an IP"},{"line_number":12,"context_line":"address because address allocation was deferred."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch is the minimum that I had to locally to allow deferring IP"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"dab17558_0c0ad878","line":11,"in_reply_to":"1a122d0e_a87fa864","updated":"2016-05-17 21:19:57.000000000","message":"There is a blueprint [1] that talks about this a little bit.  Should the spec be respun to cover this?\n\n [1] https://blueprints.launchpad.net/nova/+spec/vm-boot-with-unaddressed-port","commit_id":"bfde17d39fd9d45b5e4714d5aa6f6ad25370472b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8ba9ded15c5711327bf02d470246e56ffca0be6a","unresolved":false,"context_lines":[{"line_number":12,"context_line":"address because address allocation was deferred."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch is the minimum that I had to locally to allow deferring IP"},{"line_number":15,"context_line":"allocation.  It may need some work."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I03f2e02377a743f4dd10ca12e6c31bb71ee36767"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a122d0e_08997cc4","line":15,"updated":"2016-04-19 20:41:53.000000000","message":"Well, at a minimum, the fact that no unit tests were changed or removed will be a problem. Secondly, how does Nova know what API version of Neutron allows to create a port without a fixed IP address? Or has that functionality existed for a while and this block of code in Nova was merely to achieve parity with nova-network\u0027s legacy code?","commit_id":"bfde17d39fd9d45b5e4714d5aa6f6ad25370472b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0cd5258a9c889a5f247fcba500a2977a24ea21e3","unresolved":false,"context_lines":[{"line_number":12,"context_line":"address because address allocation was deferred."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"This patch is the minimum that I had to locally to allow deferring IP"},{"line_number":15,"context_line":"allocation.  It may need some work."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I03f2e02377a743f4dd10ca12e6c31bb71ee36767"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"dab17558_8c1ec8b8","line":15,"in_reply_to":"1a122d0e_08997cc4","updated":"2016-05-17 21:19:57.000000000","message":"Right, I threw this up as a placeholder for the discussion.  Sorry I\u0027ve been away for this patch for so long.  I now plan to return to this actively.","commit_id":"bfde17d39fd9d45b5e4714d5aa6f6ad25370472b"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8721df9fb7221cae6ab87e2de5673de78b9c96f1","unresolved":false,"context_lines":[{"line_number":17,"context_line":"previous behavior."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I03f2e02377a743f4dd10ca12e6c31bb71ee36767"},{"line_number":20,"context_line":"Depends-On: I591d32df512712e4de36fe20e389b3a14d58157f"},{"line_number":21,"context_line":"Partially-Implements: blueprint neutron-routed-networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3aaa91ec_bd8199c5","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":53},"updated":"2016-06-23 20:37:46.000000000","message":"I\u0027m not sure this needs to be a hard dependency.  I mean, without it, the code works exactly the way it did before.  It is just that the new code isn\u0027t useful until this dependency lands.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"223712020196a292e9729a86348fa1eb059beede","unresolved":false,"context_lines":[{"line_number":17,"context_line":"previous behavior."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I03f2e02377a743f4dd10ca12e6c31bb71ee36767"},{"line_number":20,"context_line":"Depends-On: I591d32df512712e4de36fe20e389b3a14d58157f"},{"line_number":21,"context_line":"Partially-Implements: blueprint neutron-routed-networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3aaa91ec_49e0b496","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":53},"in_reply_to":"3aaa91ec_34c30659","updated":"2016-06-29 20:51:41.000000000","message":"Fair enough.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0a2117b6aa820cf137380318ea61d3b466a921f","unresolved":false,"context_lines":[{"line_number":17,"context_line":"previous behavior."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I03f2e02377a743f4dd10ca12e6c31bb71ee36767"},{"line_number":20,"context_line":"Depends-On: I591d32df512712e4de36fe20e389b3a14d58157f"},{"line_number":21,"context_line":"Partially-Implements: blueprint neutron-routed-networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3aaa91ec_34c30659","line":20,"range":{"start_line":20,"start_character":0,"end_line":20,"end_character":53},"in_reply_to":"3aaa91ec_bd8199c5","updated":"2016-06-29 16:39:43.000000000","message":"It matters if we defer the check to host binding at which point we\u0027ll be failing in the compute, which is much costlier than failing fast in the API (where the validation happens today).","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"}],"nova/api/openstack/compute/servers.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"9ac64a49cea5ab853e15e91452d83e54731f5e3f","unresolved":false,"context_lines":[{"line_number":484,"context_line":"                    if request.address is not None:"},{"line_number":485,"context_line":"                        msg \u003d _(\"Specified Fixed IP \u0027%(addr)s\u0027 cannot be used \""},{"line_number":486,"context_line":"                                \"with port \u0027%(port)s\u0027: the two cannot be \""},{"line_number":487,"context_line":"                                \"specified together.\") % {"},{"line_number":488,"context_line":"                                    \"addr\": request.address,"},{"line_number":489,"context_line":"                                    \"port\": request.port_id}"},{"line_number":490,"context_line":"                        raise exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3aaa91ec_fdc68198","line":487,"updated":"2016-06-23 20:30:27.000000000","message":"This code was pointed out by Matt in the change comments.  The code works fine for the deferred IP case but the error message is misleading.  The code doesn\u0027t check that a fixed IP is allocated.  It only checks if an fixed_ip was requested at the same time as the port_id.  So, really, this error message is that the two are mutually exclusive options.","commit_id":"5e0365c7cab3bbdde421721c9a1c7245485a26f9"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8721df9fb7221cae6ab87e2de5673de78b9c96f1","unresolved":false,"context_lines":[{"line_number":484,"context_line":"                    if request.address is not None:"},{"line_number":485,"context_line":"                        msg \u003d _(\"Specified Fixed IP \u0027%(addr)s\u0027 cannot be used \""},{"line_number":486,"context_line":"                                \"with port \u0027%(port)s\u0027: the two cannot be \""},{"line_number":487,"context_line":"                                \"specified together.\") % {"},{"line_number":488,"context_line":"                                    \"addr\": request.address,"},{"line_number":489,"context_line":"                                    \"port\": request.port_id}"},{"line_number":490,"context_line":"                        raise exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_fdfa0174","line":487,"updated":"2016-06-23 20:37:46.000000000","message":"This code was pointed out by Matt in the change comments.  The code works fine for the deferred IP case but the error message is misleading.  The code doesn\u0027t check that a fixed IP is allocated.  It only checks if an fixed_ip was requested at the same time as the port_id.  So, really, this error message is that the two are mutually exclusive options.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d0f326599ff893184e1080f58c127823da4a0950","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                    if request.address is not None:"},{"line_number":475,"context_line":"                        msg \u003d _(\"Specified Fixed IP \u0027%(addr)s\u0027 cannot be used \""},{"line_number":476,"context_line":"                                \"with port \u0027%(port)s\u0027: the two cannot be \""},{"line_number":477,"context_line":"                                \"specified together.\") % {"},{"line_number":478,"context_line":"                                    \"addr\": request.address,"},{"line_number":479,"context_line":"                                    \"port\": request.port_id}"},{"line_number":480,"context_line":"                        raise exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_08f5ffeb","line":477,"updated":"2016-07-12 09:08:03.000000000","message":"Nit: its tempted to have this in a separate change, but it is related.","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4be5f6dfcab59f1000b2e06fb75da4284451e18f","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                    if request.address is not None:"},{"line_number":475,"context_line":"                        msg \u003d _(\"Specified Fixed IP \u0027%(addr)s\u0027 cannot be used \""},{"line_number":476,"context_line":"                                \"with port \u0027%(port)s\u0027: the two cannot be \""},{"line_number":477,"context_line":"                                \"specified together.\") % {"},{"line_number":478,"context_line":"                                    \"addr\": request.address,"},{"line_number":479,"context_line":"                                    \"port\": request.port_id}"},{"line_number":480,"context_line":"                        raise exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_4e237858","line":477,"in_reply_to":"1aa78d24_08f5ffeb","updated":"2016-07-12 16:39:14.000000000","message":"I wrestled with this a little bit.  At first glance, it does appear unrelated and I\u0027m pretty firm against including unrelated changes in a patch.  But, this patch does change the circumstances under which this message will be produced.  While it could be put in a separate patch set, unless others think it needs to go in another patch a little more strongly, I\u0027ll leave it here.","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c4847b4b4bd40c39228e36a718c4fe470c3b61f8","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                    if request.address is not None:"},{"line_number":475,"context_line":"                        msg \u003d _(\"Specified Fixed IP \u0027%(addr)s\u0027 cannot be used \""},{"line_number":476,"context_line":"                                \"with port \u0027%(port)s\u0027: the two cannot be \""},{"line_number":477,"context_line":"                                \"specified together.\") % {"},{"line_number":478,"context_line":"                                    \"addr\": request.address,"},{"line_number":479,"context_line":"                                    \"port\": request.port_id}"},{"line_number":480,"context_line":"                        raise exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_98e3aba3","line":477,"in_reply_to":"1aa78d24_4e237858","updated":"2016-07-13 14:43:02.000000000","message":"+1 on all that. I went through the same thought process.","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8c93008d30900ebac1eeef959ded7029d024303d","unresolved":false,"context_lines":[{"line_number":1107,"context_line":"                    port \u003d self._show_port(context, request.port_id,"},{"line_number":1108,"context_line":"                                           neutron_client\u003dneutron)"},{"line_number":1109,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1110,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1111,"context_line":"                    if not port.get(\u0027fixed_ips\u0027):"},{"line_number":1112,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1113,"context_line":"                            port_id\u003drequest.port_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_e95bfd2c","side":"PARENT","line":1110,"updated":"2016-04-13 15:20:35.000000000","message":"This has been brought up in another patch that hasn\u0027t gone anywhere [1].  I\u0027ll review the feedback there but basically, I have this patch up to get guidance from Nova folks on what needs to happen to lift this constraint for deferred IPs.  The spec for that change is here [2].  Feedback on that spec may be relevant here.\n\nWe could consider piggy-backing off of that work.  Here are the blueprints [3][4]\n\n [1] https://review.openstack.org/#/c/202882/4/nova/network/neutronv2/api.py@1044\n [2] https://review.openstack.org/#/c/239276/\n [3] https://blueprints.launchpad.net/neutron/+spec/vm-without-l3-address\n [4] https://blueprints.launchpad.net/nova/+spec/vm-boot-with-unaddressed-port","commit_id":"c21d2685478e19bb3a5cd230d6bc192a45320bc0"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"8ba9ded15c5711327bf02d470246e56ffca0be6a","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1151,"context_line":"                    if not port.get(\u0027fixed_ips\u0027):"},{"line_number":1152,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1153,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1154,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"},{"line_number":1155,"context_line":"                else:"},{"line_number":1156,"context_line":"                    ports_needed_per_instance +\u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_e8952087","side":"PARENT","line":1153,"updated":"2016-04-19 20:41:53.000000000","message":"So, yeah, technically I don\u0027t see any reason why ports specified in the nova boot command need to have an IP address associated with them at all...","commit_id":"3d4f257aa920380075e1e73922c42152922cc3d0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0cd5258a9c889a5f247fcba500a2977a24ea21e3","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1151,"context_line":"                    if not port.get(\u0027fixed_ips\u0027):"},{"line_number":1152,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1153,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1154,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"},{"line_number":1155,"context_line":"                else:"},{"line_number":1156,"context_line":"                    ports_needed_per_instance +\u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_2c519c62","side":"PARENT","line":1153,"in_reply_to":"1a122d0e_e8952087","updated":"2016-05-17 21:19:57.000000000","message":"The unaddressed port spec has a little bit of history of people who seem to think there is more to this.  It might be worth a review.\n\nAlso, mriedem pointed out the patch that added this check [2].  That shows some of the history.\n\n [1] https://review.openstack.org/#/c/239276/\n [2] https://review.openstack.org/#/c/79801/","commit_id":"3d4f257aa920380075e1e73922c42152922cc3d0"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b8998c5a39af05098783c5813bf6dabfadda67cf","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1151,"context_line":"                    if not port.get(\u0027fixed_ips\u0027):"},{"line_number":1152,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1153,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1154,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"},{"line_number":1155,"context_line":"                else:"},{"line_number":1156,"context_line":"                    ports_needed_per_instance +\u003d 1"}],"source_content_type":"text/x-python","patch_set":2,"id":"dab17558_0c3938f2","side":"PARENT","line":1153,"in_reply_to":"1a122d0e_e8952087","updated":"2016-05-17 21:18:39.000000000","message":"This was the change that added the check:\n\nhttps://review.openstack.org/#/c/79801/\n\nSo port security is a related issue, and has been a problem for us for a long time, see:\n\nhttps://bugs.launchpad.net/nova/+bug/1175464\n\nand:\n\nhttps://review.openstack.org/#/c/301372/","commit_id":"3d4f257aa920380075e1e73922c42152922cc3d0"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"aa9bc88b4a3bd1405fb21998c4ad1f8b0866fef8","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"3aaa91ec_94b8fac9","line":1164,"updated":"2016-06-23 20:08:34.000000000","message":"In the case of deferred IP, we don\u0027t do this check at all.  Should I run this check on the compute host when it does the host binding?  I\u0027m not familiar enough with the Nova code to know how to do that.","commit_id":"22d1be5c70c7670f1fe294c0a7817751a271defa"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"223712020196a292e9729a86348fa1eb059beede","unresolved":false,"context_lines":[{"line_number":612,"context_line":"                self._populate_neutron_extension_values("},{"line_number":613,"context_line":"                    context, instance, request.pci_request_id, port_req_body,"},{"line_number":614,"context_line":"                    network\u003dnetwork, neutron\u003dneutron,"},{"line_number":615,"context_line":"                    bind_host_id\u003dbind_host_id)"},{"line_number":616,"context_line":"                self._populate_mac_address(instance, request.pci_request_id,"},{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_64d95522","line":615,"range":{"start_line":615,"start_character":33,"end_line":615,"end_character":45},"updated":"2016-06-29 20:51:41.000000000","message":"I didn\u0027t notice before that the bind_host_id is set here.  It does look like this is where the port is updated with host binding information.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4ea5bef6115e4226959e5b16414e0b55b69fd0af","unresolved":false,"context_lines":[{"line_number":612,"context_line":"                self._populate_neutron_extension_values("},{"line_number":613,"context_line":"                    context, instance, request.pci_request_id, port_req_body,"},{"line_number":614,"context_line":"                    network\u003dnetwork, neutron\u003dneutron,"},{"line_number":615,"context_line":"                    bind_host_id\u003dbind_host_id)"},{"line_number":616,"context_line":"                self._populate_mac_address(instance, request.pci_request_id,"},{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_5f74e234","line":615,"range":{"start_line":615,"start_character":33,"end_line":615,"end_character":45},"in_reply_to":"3aaa91ec_64d95522","updated":"2016-06-29 21:09:35.000000000","message":"This is populating part of the port_req_body which is then used to update the port, yeah.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"31c3980bacc48c2578f9e295df0c73aa74443d77","unresolved":false,"context_lines":[{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"},{"line_number":619,"context_line":"                    port \u003d ports[request.port_id]"},{"line_number":620,"context_line":"                    port_client.update_port(port[\u0027id\u0027], port_req_body)"},{"line_number":621,"context_line":"                    preexisting_port_ids.append(port[\u0027id\u0027])"},{"line_number":622,"context_line":"                    ports_in_requested_order.append(port[\u0027id\u0027])"},{"line_number":623,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_346786b8","line":620,"updated":"2016-06-29 16:37:40.000000000","message":"If you\u0027re talking about waiting to validate that the port has a fixed IP after we update the port with the host binding details here, then my question is, with deferred IP allocation, is this going to be synchronous? i.e. will neutron block the port update call until a fixed IP is allocated and associated with the port before we get a response back?","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3d179ce3a06b3a26a2464861bed78e2025940d07","unresolved":false,"context_lines":[{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"},{"line_number":619,"context_line":"                    port \u003d ports[request.port_id]"},{"line_number":620,"context_line":"                    port_client.update_port(port[\u0027id\u0027], port_req_body)"},{"line_number":621,"context_line":"                    preexisting_port_ids.append(port[\u0027id\u0027])"},{"line_number":622,"context_line":"                    ports_in_requested_order.append(port[\u0027id\u0027])"},{"line_number":623,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_04ec5c91","line":620,"in_reply_to":"3aaa91ec_00eafa73","updated":"2016-07-01 19:55:53.000000000","message":"We\u0027d fail to create the instance, which would be bad (or attach a VIF to an instance which is less bad since that\u0027s synchronous from the API - although we could hit an RPC timeout with the RPC call from nova-api to nova-compute).\n\nIn generally we hate synchronous anything, but changing the semantics of a port update for deferred IP allocation would suck, because nova would have to check for that and then expect to poll until there is a fixed IP (or timeout). I don\u0027t know - I guess maybe if neutron changed the port status while doing this we could work with that? But I\u0027m not sure what would happen with vif plugging in that case if the port is considered \u0027down\u0027 - but if we moved the timeout to our normal vif plug timeout then maybe that\u0027s less of a problem.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e25e79943472777e8b8bcc3219bb36e0bcf013f8","unresolved":false,"context_lines":[{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"},{"line_number":619,"context_line":"                    port \u003d ports[request.port_id]"},{"line_number":620,"context_line":"                    port_client.update_port(port[\u0027id\u0027], port_req_body)"},{"line_number":621,"context_line":"                    preexisting_port_ids.append(port[\u0027id\u0027])"},{"line_number":622,"context_line":"                    ports_in_requested_order.append(port[\u0027id\u0027])"},{"line_number":623,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_9945f571","line":620,"in_reply_to":"3aaa91ec_04ec5c91","updated":"2016-07-05 16:46:32.000000000","message":"I don\u0027t see this as much of a problem if the built-in IPAM is used.  It basically boils down to a couple of database queries.  We\u0027ve even done work during the Newton cycle to remove most of the contention from it.  It is pretty reliably responsive these days.\n\nThe only concern is if the cloud uses an external pluggable system.  If this system is online, I expect it to be reasonably responsive.  If it is offline, no new instances will be able to boot regardless of what we do here until the system is restored.\n\nIPAM isn\u0027t really comparable to something like initializing disk space, downloading images, or something else truly expensive and error prone.  I mean, it is essentially just allocating a unique integer to the instance for the network it will boot on.\n\nHow would you envision the port status changing?  Are you suggesting adding a state to the port status to indicate that IP allocation is pending?\n\nI don\u0027t understand \"if we moved the timout to our normal vif plug timeout then maybe that\u0027s less of a problem.\"  Could you elaborate?","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"223712020196a292e9729a86348fa1eb059beede","unresolved":false,"context_lines":[{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"},{"line_number":619,"context_line":"                    port \u003d ports[request.port_id]"},{"line_number":620,"context_line":"                    port_client.update_port(port[\u0027id\u0027], port_req_body)"},{"line_number":621,"context_line":"                    preexisting_port_ids.append(port[\u0027id\u0027])"},{"line_number":622,"context_line":"                    ports_in_requested_order.append(port[\u0027id\u0027])"},{"line_number":623,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_89373cfe","line":620,"in_reply_to":"3aaa91ec_346786b8","updated":"2016-06-29 20:51:41.000000000","message":"Yes, it will be synchronous. The response is expected to contain the fixed_ips at that point in response to port update.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4ea5bef6115e4226959e5b16414e0b55b69fd0af","unresolved":false,"context_lines":[{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"},{"line_number":619,"context_line":"                    port \u003d ports[request.port_id]"},{"line_number":620,"context_line":"                    port_client.update_port(port[\u0027id\u0027], port_req_body)"},{"line_number":621,"context_line":"                    preexisting_port_ids.append(port[\u0027id\u0027])"},{"line_number":622,"context_line":"                    ports_in_requested_order.append(port[\u0027id\u0027])"},{"line_number":623,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_df96123d","line":620,"in_reply_to":"3aaa91ec_89373cfe","updated":"2016-06-29 21:09:35.000000000","message":"Is there a timeout possibility there?","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"afe19d88c3f84bcffd9fe806220f993ca63be040","unresolved":false,"context_lines":[{"line_number":617,"context_line":"                                           port_req_body)"},{"line_number":618,"context_line":"                if request.port_id:"},{"line_number":619,"context_line":"                    port \u003d ports[request.port_id]"},{"line_number":620,"context_line":"                    port_client.update_port(port[\u0027id\u0027], port_req_body)"},{"line_number":621,"context_line":"                    preexisting_port_ids.append(port[\u0027id\u0027])"},{"line_number":622,"context_line":"                    ports_in_requested_order.append(port[\u0027id\u0027])"},{"line_number":623,"context_line":"                else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_00eafa73","line":620,"in_reply_to":"3aaa91ec_df96123d","updated":"2016-07-01 00:13:47.000000000","message":"If an external IPAM driver is used with Neutron and that external system is *very* slow to respond then I guess there could be a possibility.  If the external system is unavailable, you\u0027d get another error from the neutron API but not a timeout.  What will happen in the face of a timeout here now?  What would need to change?  FWIW, I think there has always been some chance of timeout.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8721df9fb7221cae6ab87e2de5673de78b9c96f1","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_3d4809cc","line":1164,"updated":"2016-06-23 20:37:46.000000000","message":"In the case of deferred IP, we don\u0027t do this check at all.  Should I run this check on the compute host when it does the host binding?  I\u0027m not familiar enough with the Nova code to know how to do that.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e25e79943472777e8b8bcc3219bb36e0bcf013f8","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_4699f31e","line":1164,"in_reply_to":"1aa78d24_38586532","updated":"2016-07-05 16:46:32.000000000","message":"Miguel, it shouldn\u0027t matter.  If the extension is not enabled, it\u0027ll return None which will be interpreted as not deferred.  Do you think it is worth adding extra code?  The end result would be the same.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"7fed73381757949a271de40eb2fb85929de3b847","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_3eb815c8","line":1164,"in_reply_to":"1aa78d24_4699f31e","updated":"2016-07-05 22:39:22.000000000","message":"No, it is not worth adding the extra check.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"257dcd77298dc609cb8ba4d10003ff325da6a376","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_65ecd78f","line":1164,"in_reply_to":"1aa78d24_5919cd87","updated":"2016-07-05 19:45:55.000000000","message":"Matt\u0027s link to compute/manager moved, just pinning it down [1].\n\n [1] https://github.com/openstack/nova/blob/4f33047d07f5a11b208c344fe206aba01cd8e6fe/nova/compute/manager.py#L1916","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4ea5bef6115e4226959e5b16414e0b55b69fd0af","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_3fbf56ab","line":1164,"in_reply_to":"3aaa91ec_244d8d3e","updated":"2016-06-29 21:09:35.000000000","message":"\"So, do you want to run a check similar to this one at that point? What sort of exception should be raised at that point? Would the same exception raised here be sufficient?\"\n\nI think that\u0027s what we\u0027d do - if it\u0027s not deferred allocation and there isn\u0027t a fixed IP on the port, fail fast in the API (here). If it is deferred allocation and the port (after host binding) doesn\u0027t have a fixed IP, then it\u0027s a failure and we have to abort the build.\n\nSince we\u0027d want to abort the build, we\u0027d have to either raise the same PortRequiresFixedIP exception and handle that here:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/manager.py#L1916\n\nOr raise VirtualInterfaceCreateException which is already handled in the compute manager and will abort the build due to network allocation failing.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5acf8ef9eede0d84337099b22d96c19a4661b9d8","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_d19c5410","line":1164,"in_reply_to":"3aaa91ec_3d4809cc","updated":"2016-06-29 16:34:35.000000000","message":"This also comes to mind, if you request a port and fixed IP address in the same network request today it blows up:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/servers.py#L409\n\nAnd the error message says the port already has a fixed IP, which for deferred ports it wouldn\u0027t, but we don\u0027t know that in that code.\n\n--\n\nI\u0027m not really following the \"Should I run this check on the compute host when it does the host binding?\" logic/question. Do you mean have this check you have already, but then fail if there isn\u0027t a fixed IP on the port after nova updates it, in allocate_for_instance above? See L618.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"e25e79943472777e8b8bcc3219bb36e0bcf013f8","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_5919cd87","line":1164,"in_reply_to":"3aaa91ec_3fbf56ab","updated":"2016-07-05 16:46:32.000000000","message":"@Matt Done","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"9d4c58652c88b5770456729391a3d39dbf4bf382","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_38586532","line":1164,"in_reply_to":"3aaa91ec_3fbf56ab","updated":"2016-07-05 00:28:50.000000000","message":"Before doing this check, we need to check that the \u0027Segments\u0027 extension is enabled in Neutron. I added in the following patchset the constant \u0027SEGMENT_EXT\u0027 for this purpose:\n\nhttps://review.openstack.org/#/c/337387/","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"223712020196a292e9729a86348fa1eb059beede","unresolved":false,"context_lines":[{"line_number":1161,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1162,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1163,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1164,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1165,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1166,"context_line":"                            port_id\u003drequest.port_id)"},{"line_number":1167,"context_line":"                    request.network_id \u003d port[\u0027network_id\u0027]"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_244d8d3e","line":1164,"in_reply_to":"3aaa91ec_d19c5410","updated":"2016-06-29 20:51:41.000000000","message":"In the code you reference, \"request.address\" comes from the fixed_ip in the \"networks\" object that was passed in to the Nova API.  It isn\u0027t the fixed_ip on the Neutron port.  So, this isn\u0027t an issue.  The code is checking if both a port id and fixed_ip were requested through the Nova API which is still relevant to this case.\n\n  -- \n\nIs L618 where the host id is updated on the port?  Looking at it now, it does look like it is.  When is that code run and from where?  I guess it was my understanding that that port update would be run from the compute host.  But, I\u0027m not really sure.\n\nSo, do you want to run a check similar to this one at that point?  What sort of exception should be raised at that point?  Would the same exception raised here be sufficient?","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"8f0ec3200c2c3848af726cfafa61e914cfa18d9c","unresolved":false,"context_lines":[{"line_number":643,"context_line":"                    created_port_ids.append(created_port_id)"},{"line_number":644,"context_line":"                    ports_in_requested_order.append(created_port_id)"},{"line_number":645,"context_line":"                else:"},{"line_number":646,"context_line":"                    self._update_port("},{"line_number":647,"context_line":"                        port_client, instance, request.port_id, port_req_body)"},{"line_number":648,"context_line":"                    preexisting_port_ids.append(request.port_id)"},{"line_number":649,"context_line":"                    ports_in_requested_order.append(request.port_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_204c429d","line":646,"range":{"start_line":646,"start_character":25,"end_line":646,"end_character":37},"updated":"2016-07-06 18:44:38.000000000","message":"It occurred to me that in the case of a deferred IP port, if this call to update the port does not succeed in allocating an IP address, it will return an error.  It should raise an neutron_client_exc.IpAddressGenerationFailureClient if I\u0027m not mistaken.\n\nAssuming this is true, do we need an additional explicit check for an IP address here?  I would think it would be sufficient to handle the IpAddressGenerationFailureClient exception correctly (probably converting it to PortRequiresFixedIP and then handling that by aborting the build [2].)  Miguel actually added some code to his patch [1] that I might borrow for this patch.\n\nI\u0027m going off to play with it in my routed networks setup to be sure that this is the case and we have tests in place in Neutron to ensure it.\n\n [1] https://review.openstack.org/#/c/337387/1/nova/network/neutronv2/api.py@323\n [2] https://github.com/openstack/nova/blob/4f33047d07f5a11b208c344fe206aba01cd8e6fe/nova/compute/manager.py#L1916","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"184533a1a1f65a976c93defb0a021c055a3a8bda","unresolved":false,"context_lines":[{"line_number":643,"context_line":"                    created_port_ids.append(created_port_id)"},{"line_number":644,"context_line":"                    ports_in_requested_order.append(created_port_id)"},{"line_number":645,"context_line":"                else:"},{"line_number":646,"context_line":"                    self._update_port("},{"line_number":647,"context_line":"                        port_client, instance, request.port_id, port_req_body)"},{"line_number":648,"context_line":"                    preexisting_port_ids.append(request.port_id)"},{"line_number":649,"context_line":"                    ports_in_requested_order.append(request.port_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_54b5822f","line":646,"range":{"start_line":646,"start_character":25,"end_line":646,"end_character":37},"in_reply_to":"1aa78d24_204c429d","updated":"2016-07-07 21:45:54.000000000","message":"I wrote a test [1] in Neutron to ensure that port update fails with IpAddressGenerationFailure is generated when the port update doesn\u0027t allocate an IP address when host binding information is provided.\n\nSo, if a deferred IP port is allowed to get to this point because of L1185 then it will either have an IP after this update or the update will fail.  I think this is pretty good.\n\n [1] https://review.openstack.org/339247","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"244cb48af59b8ef2c51c726f40dba1124a6d2688","unresolved":false,"context_lines":[{"line_number":643,"context_line":"                    created_port_ids.append(created_port_id)"},{"line_number":644,"context_line":"                    ports_in_requested_order.append(created_port_id)"},{"line_number":645,"context_line":"                else:"},{"line_number":646,"context_line":"                    self._update_port("},{"line_number":647,"context_line":"                        port_client, instance, request.port_id, port_req_body)"},{"line_number":648,"context_line":"                    preexisting_port_ids.append(request.port_id)"},{"line_number":649,"context_line":"                    ports_in_requested_order.append(request.port_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_5ba90adf","line":646,"range":{"start_line":646,"start_character":25,"end_line":646,"end_character":37},"in_reply_to":"1aa78d24_54b5822f","updated":"2016-07-08 14:32:38.000000000","message":"You are right, if this raises an error on IP allocation failures, thats probably enough.\n\nSo in summary:\n\n* if not differed, must have IP for every port passed into Nova\n* if differed, we just be sure to handle the port binding update to watch out of IP allocation failures at that point.","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"64f1d6344d345204221f570e32cdc5c9481d158e","unresolved":false,"context_lines":[{"line_number":643,"context_line":"                    created_port_ids.append(created_port_id)"},{"line_number":644,"context_line":"                    ports_in_requested_order.append(created_port_id)"},{"line_number":645,"context_line":"                else:"},{"line_number":646,"context_line":"                    self._update_port("},{"line_number":647,"context_line":"                        port_client, instance, request.port_id, port_req_body)"},{"line_number":648,"context_line":"                    preexisting_port_ids.append(request.port_id)"},{"line_number":649,"context_line":"                    ports_in_requested_order.append(request.port_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_8435cef8","line":646,"range":{"start_line":646,"start_character":25,"end_line":646,"end_character":37},"in_reply_to":"1aa78d24_5ba90adf","updated":"2016-07-08 16:44:40.000000000","message":"Thanks, John.  I just tried this in my environment just to see it with my own eyes.  I saw this [1] on the compute.\n\nI was surprised to see that my instance later went active.  I quickly noticed that Nova had rescheduled the instance to another compute host on my other segment which still had IPs available.  Is this the behavior that we want.\n\n [1] http://paste.openstack.org/show/528624/","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e6fa74411780d05a50c71a2a53c15d748e524f7a","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_bbc3ce89","line":659,"updated":"2016-07-08 14:34:24.000000000","message":"FWIW  IpAddressGenerationFailureClient should trigger this clean up, and then we re-raise tje exception and cause the build to fail (actually I might case the build to retry several times until the limit, but either way, it should fail).","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"64f1d6344d345204221f570e32cdc5c9481d158e","unresolved":false,"context_lines":[{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_673424de","line":659,"in_reply_to":"1aa78d24_bbc3ce89","updated":"2016-07-08 16:44:40.000000000","message":"It did retry and landed on a compute host attached to a different segment where there were IPs available.  So, the retry succeeded.","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"90c60ce3d9562af0cec8fe56e4b6c0cdbae2b02e","unresolved":false,"context_lines":[{"line_number":1181,"context_line":"                                           neutron_client\u003dneutron)"},{"line_number":1182,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1183,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1184,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1185,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1186,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1187,"context_line":"                            port_id\u003drequest.port_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_e8b6b3da","line":1184,"updated":"2016-07-12 09:10:40.000000000","message":"Nit: I wonder if we should add a note saying that if a deferred port fails to get an IP address, an exception is raised when the port gets bound?","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"4be5f6dfcab59f1000b2e06fb75da4284451e18f","unresolved":false,"context_lines":[{"line_number":1181,"context_line":"                                           neutron_client\u003dneutron)"},{"line_number":1182,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1183,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1184,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1185,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1186,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1187,"context_line":"                            port_id\u003drequest.port_id)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_eed86455","line":1184,"in_reply_to":"1aa78d24_e8b6b3da","updated":"2016-07-12 16:39:14.000000000","message":"Sure, that\u0027s a good idea.","commit_id":"ce33b716c83801af495961aca97c5fc68ac3763c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"10056ed132d56075e25d2d73843e68df452bb8a2","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_7f7fb7ab","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"updated":"2016-07-13 18:56:55.000000000","message":"I guess this should handle the case I\u0027m worried about wrt orphaned ports on a reschedule.","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"0e62fb7b93849832f8682b7acd6a32b4aca65564","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_54a427b8","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"1aa78d24_19ee58b4","updated":"2016-07-14 18:40:43.000000000","message":"I adjusted Neutron so that only one IP address was available.  I passed \"--nic net-id\u003d\u003cnet-id\u003e --nic port-id\u003d\u003cdeferred-ip-port-id\u003e\" so that the Nova created port would get the last available IP on the segment.  I observed that the port update failed as expected [1] and the Nova created port was cleaned up.  I confirmed with a \"neutron port-list\" that didn\u0027t show any orphaned ports.\n\nThe instance came up on the next node with the two ports on the right segment.\n\nNext I tried swapping the two --nic args so that the port update comes first and is successful.\n\nIn this case, the failure happened on the Nova created port after successfully updating the pre-created port with an IP on the segment.  This left the pre-created port with an IP address on the first segment.  It also left an orphaned port.  The VM went in to an error state.\n\nI found this error [2] in the conductor logs.  The port id is the id of the port I pre-created.\n\n [1] http://paste.openstack.org/show/532901/\n [2] http://paste.openstack.org/show/532906/","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"212099598349af4c2c6d40558381141988b9f626","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_bd4d67c6","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"1aa78d24_236de2cc","updated":"2016-07-14 21:26:51.000000000","message":"So we still had a bug, this should fix it:\n\nhttps://review.openstack.org/#/c/342416/","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0644cebf34bafa59cef51652e82e7a0ca8e735e4","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_236de2cc","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"1aa78d24_54a427b8","updated":"2016-07-14 18:47:25.000000000","message":"The failure in [2] is fixed by this:\n\nhttps://review.openstack.org/#/c/341102/\n\nSo you need to rebase. It would be good to know that scenario is good once you have the latest nova.","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ee99527b79d0de68ee214930d825e4fcbe163b81","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_19ee58b4","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"1aa78d24_7201926a","updated":"2016-07-14 17:58:13.000000000","message":"Wouldn\u0027t _unbind_ports handle that?","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"27cb7c2a292b28fc36fe8340d666217b4fda7520","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1aa78d24_7201926a","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"1aa78d24_7f7fb7ab","updated":"2016-07-14 08:59:23.000000000","message":"Yes, that does the clean up before we re-schedule.\n\nNow I think its possible a port that is passed in gets an IP and is bound to a segment we might want it to be bound to later, but I think we can leave that concern for now. Once we schedule properly, this gets us over most of those problems anyways.","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"ee758bbdc702e4c2a6433c6f7eef261ca526bcda","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"dada55a8_8282de50","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"1aa78d24_bd4d67c6","updated":"2016-07-18 20:06:49.000000000","message":"@Matt, rebasing past that last patch helped.  We still have one more problem but I tend to think that we need to solve this one from the Neutron side.\n\nThe port that got created by the first compute host got cleaned up and the VM came up on a host on the second segment.  However, the problem I encountered is that the deferred ip port that I gave Nova with \"--nic port-id\u003d\u003cid\u003e\" ended up with an IP from the wrong segment.  This is because the host binding on the first host succeeded before the instance was rescheduled.  Then, Neutron happily let host binding to the new host on the second segment succeed without regard to the fact that it had an IP address on the first segment.  I need to be sure that a port cannot be bound to a host if it has IP addresses on a segment the host cannot reach.\n\nThe above change will prevent this situation where an instance has ports with IPs from different segments.  That should cause this instance to go in to an error state.  We might have to provide some way to also remove the IP addresses from a port sending it back to its deferred IP state.","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1a361882f52e7dbe385bdd26a04fc27e37276bf3","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"dada55a8_a82b812f","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"dada55a8_8282de50","updated":"2016-07-18 20:53:26.000000000","message":"\"We might have to provide some way to also remove the IP addresses from a port sending it back to its deferred IP state.\"\n\n*We* being Neutron? Are you thinking Nova needs to do something special in the case of a deferred IP allocation port (maybe when nova is deallocating and wiping out the host binding details on the port). If so, I\u0027d think Neutron would just deallocate the fixed IPs from the port when the host binding is removed (by Nova).","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"db894c5991e16e5ecb8c30dd60f5754e906c1e92","unresolved":false,"context_lines":[{"line_number":651,"context_line":"                self._update_port_dns_name(context, instance, network,"},{"line_number":652,"context_line":"                                           ports_in_requested_order[-1],"},{"line_number":653,"context_line":"                                           neutron)"},{"line_number":654,"context_line":"            except Exception:"},{"line_number":655,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":656,"context_line":"                    self._unbind_ports(context,"},{"line_number":657,"context_line":"                                       preexisting_port_ids,"},{"line_number":658,"context_line":"                                       neutron, port_client)"},{"line_number":659,"context_line":"                    self._delete_ports(neutron, instance, created_port_ids)"},{"line_number":660,"context_line":"        nw_info \u003d self.get_instance_nw_info("},{"line_number":661,"context_line":"            context, instance, networks\u003dnets_in_requested_order,"},{"line_number":662,"context_line":"            port_ids\u003dports_in_requested_order,"}],"source_content_type":"text/x-python","patch_set":7,"id":"dada55a8_b8675ce9","line":659,"range":{"start_line":654,"start_character":12,"end_line":659,"end_character":75},"in_reply_to":"dada55a8_a82b812f","updated":"2016-07-22 21:31:43.000000000","message":"@Matt, per our discussion at the mid-cycle, we won\u0027t be trying to get the port back to its deferred IP state.\n\nI didn\u0027t have anyone in particular in mind when I said \"we.\" Since my comment was really very vague, I didn\u0027t have a specific solution in mind yet.","commit_id":"63f0d9ad3011b4d7c7ee5ae13a76be899e69e835"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a316d9f15dcede7a10183d236b3393609b993a53","unresolved":false,"context_lines":[{"line_number":1414,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1415,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1416,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1417,"context_line":"                    # NOTE A deferred IP port doesn\u0027t have an address here."},{"line_number":1418,"context_line":"                    # If it fails to get one later when nova updates it with"},{"line_number":1419,"context_line":"                    # host info, Neutron will error which raises an exception."},{"line_number":1420,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_bd390edb","line":1417,"range":{"start_line":1417,"start_character":22,"end_line":1417,"end_character":26},"updated":"2016-07-22 21:08:18.000000000","message":"nit: NOTE(carl_baldwin) or whatever in case you respin.\n\nIt might not be a bad idea to have a TODO or something to explain that later we should handle a specific kind of exception from neutron in case we fail and reschedule and try to bind a port with fixed IPs from the wrong segment so we can trigger a BuildAbortException. That\u0027s what the 2nd dependency in the commit message is for anyway.","commit_id":"0d0f7c37767f96a0de7ad02aabd1ba9ade1e0251"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2293eeef0f3181d88550cbe8cf95b059fabb8169","unresolved":false,"context_lines":[{"line_number":1414,"context_line":"                    if port.get(\u0027device_id\u0027, None):"},{"line_number":1415,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1416,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1417,"context_line":"                    # NOTE A deferred IP port doesn\u0027t have an address here."},{"line_number":1418,"context_line":"                    # If it fails to get one later when nova updates it with"},{"line_number":1419,"context_line":"                    # host info, Neutron will error which raises an exception."},{"line_number":1420,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_4a371db0","line":1417,"range":{"start_line":1417,"start_character":22,"end_line":1417,"end_character":26},"in_reply_to":"dada55a8_bd390edb","updated":"2016-07-25 22:31:33.000000000","message":"Done. I\u0027m just used to not annotating notes with a name in Neutron.","commit_id":"0d0f7c37767f96a0de7ad02aabd1ba9ade1e0251"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bda19e0e11c4209085515107575e1c62149bd300","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1416,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1417,"context_line":"                    # NOTE(carl_baldwin) A deferred IP port doesn\u0027t have an"},{"line_number":1418,"context_line":"                    # address here. If it fails to get one later when nova"},{"line_number":1419,"context_line":"                    # updates it with host info, Neutron will error which"},{"line_number":1420,"context_line":"                    # raises an exception."},{"line_number":1421,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1422,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1423,"context_line":"                            port_id\u003drequest.port_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_ced05a56","line":1420,"range":{"start_line":1418,"start_character":36,"end_line":1420,"end_character":42},"updated":"2016-07-29 01:36:30.000000000","message":"Should we have a TODO to handle HostNotCompatibleWithFixedIps in python-neutronclient when updating the port\u0027s host binding and then handle that and raise it up to the compute manager so it can do a BuildAbortException rather than reschedule? I just don\u0027t want to lose the long-term plan for handling that.","commit_id":"54b8d7770ac7ba0ab49417ceacf82ebc708a3b3b"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6940f9a8f83eaeacb3f4fa9c050732a29f789322","unresolved":false,"context_lines":[{"line_number":1415,"context_line":"                        raise exception.PortInUse(port_id\u003drequest.port_id)"},{"line_number":1416,"context_line":"                    deferred_ip \u003d port.get(\u0027ip_allocation\u0027) \u003d\u003d \u0027deferred\u0027"},{"line_number":1417,"context_line":"                    # NOTE(carl_baldwin) A deferred IP port doesn\u0027t have an"},{"line_number":1418,"context_line":"                    # address here. If it fails to get one later when nova"},{"line_number":1419,"context_line":"                    # updates it with host info, Neutron will error which"},{"line_number":1420,"context_line":"                    # raises an exception."},{"line_number":1421,"context_line":"                    if not deferred_ip and not port.get(\u0027fixed_ips\u0027):"},{"line_number":1422,"context_line":"                        raise exception.PortRequiresFixedIP("},{"line_number":1423,"context_line":"                            port_id\u003drequest.port_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_cf29cef4","line":1420,"range":{"start_line":1418,"start_character":36,"end_line":1420,"end_character":42},"in_reply_to":"bacf61ea_ced05a56","updated":"2016-08-02 14:04:16.000000000","message":"Hmm, we should track that.","commit_id":"54b8d7770ac7ba0ab49417ceacf82ebc708a3b3b"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4c1c0c3242b54f1744a0d4d41e21b37ddf824eae","unresolved":false,"context_lines":[{"line_number":1762,"context_line":"                          api.validate_networks,"},{"line_number":1763,"context_line":"                          self.context, requested_networks, 1)"},{"line_number":1764,"context_line":""},{"line_number":1765,"context_line":"    def test_validate_networks_port_no_subnet_id_immediate_allocation(self):"},{"line_number":1766,"context_line":"        port_a \u003d self.port_data3[0]"},{"line_number":1767,"context_line":"        port_a[\u0027device_id\u0027] \u003d None"},{"line_number":1768,"context_line":"        port_a[\u0027device_owner\u0027] \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"3aaa91ec_5f4ce2c7","line":1765,"updated":"2016-06-29 21:11:25.000000000","message":"Don\u0027t add new tests to TestNeutronv2 with the big setup with all of the mox garbage, throw new tests under on of the other classes that use mock, like TestNeutronv2WithMock or whatever it\u0027s called.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"c4d5f8fd38d0aed5df3ddcab2c76a5e70334a06a","unresolved":false,"context_lines":[{"line_number":1762,"context_line":"                          api.validate_networks,"},{"line_number":1763,"context_line":"                          self.context, requested_networks, 1)"},{"line_number":1764,"context_line":""},{"line_number":1765,"context_line":"    def test_validate_networks_port_no_subnet_id_immediate_allocation(self):"},{"line_number":1766,"context_line":"        port_a \u003d self.port_data3[0]"},{"line_number":1767,"context_line":"        port_a[\u0027device_id\u0027] \u003d None"},{"line_number":1768,"context_line":"        port_a[\u0027device_owner\u0027] \u003d None"}],"source_content_type":"text/x-python","patch_set":5,"id":"1aa78d24_bb141c44","line":1765,"in_reply_to":"3aaa91ec_5f4ce2c7","updated":"2016-07-05 20:12:15.000000000","message":"I\u0027ll look in to this.  I didn\u0027t really notice the heterogenous testing styles.  I just went for the style that I saw first.","commit_id":"2a7cdcec67a0d6c596b17377ce38b2a5d90c165c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a316d9f15dcede7a10183d236b3393609b993a53","unresolved":false,"context_lines":[{"line_number":3083,"context_line":""},{"line_number":3084,"context_line":"        requested_networks \u003d objects.NetworkRequestList("},{"line_number":3085,"context_line":"            objects\u003d[objects.NetworkRequest(port_id\u003dport[\u0027id\u0027])])"},{"line_number":3086,"context_line":"        self.api.validate_networks(self.context, requested_networks, 1)"},{"line_number":3087,"context_line":""},{"line_number":3088,"context_line":"    @mock.patch(\u0027oslo_concurrency.lockutils.lock\u0027)"},{"line_number":3089,"context_line":"    def test_get_instance_nw_info_locks_per_instance(self, mock_lock):"}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_bd958e89","line":3086,"updated":"2016-07-22 21:08:18.000000000","message":"Should probably at least assert we get 1 back.\n\nI\u0027m actually surprised if this passes the test since you didn\u0027t mock out show_quota:\n\nhttps://review.openstack.org/#/c/299591/9/nova/network/neutronv2/api.py@1490","commit_id":"0d0f7c37767f96a0de7ad02aabd1ba9ade1e0251"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"2293eeef0f3181d88550cbe8cf95b059fabb8169","unresolved":false,"context_lines":[{"line_number":3083,"context_line":""},{"line_number":3084,"context_line":"        requested_networks \u003d objects.NetworkRequestList("},{"line_number":3085,"context_line":"            objects\u003d[objects.NetworkRequest(port_id\u003dport[\u0027id\u0027])])"},{"line_number":3086,"context_line":"        self.api.validate_networks(self.context, requested_networks, 1)"},{"line_number":3087,"context_line":""},{"line_number":3088,"context_line":"    @mock.patch(\u0027oslo_concurrency.lockutils.lock\u0027)"},{"line_number":3089,"context_line":"    def test_get_instance_nw_info_locks_per_instance(self, mock_lock):"}],"source_content_type":"text/x-python","patch_set":9,"id":"dada55a8_9abfa2fb","line":3086,"in_reply_to":"dada55a8_bd958e89","updated":"2016-07-25 22:31:33.000000000","message":"Done","commit_id":"0d0f7c37767f96a0de7ad02aabd1ba9ade1e0251"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"bda19e0e11c4209085515107575e1c62149bd300","unresolved":false,"context_lines":[{"line_number":3083,"context_line":""},{"line_number":3084,"context_line":"        requested_networks \u003d objects.NetworkRequestList("},{"line_number":3085,"context_line":"            objects\u003d[objects.NetworkRequest(port_id\u003dport[\u0027id\u0027])])"},{"line_number":3086,"context_line":"        count \u003d self.api.validate_networks(self.context, requested_networks, 1)"},{"line_number":3087,"context_line":"        self.assertEqual(1, count)"},{"line_number":3088,"context_line":""},{"line_number":3089,"context_line":"    @mock.patch(\u0027oslo_concurrency.lockutils.lock\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_2e92d69f","line":3086,"updated":"2016-07-29 01:36:30.000000000","message":"I\u0027m still surprised this passes since you don\u0027t have to mock out neutronclient.show_quota which is used in validate_networks. I might need to look into that a bit further. I\u0027m wondering if a global mock somewhere is making this pass.","commit_id":"54b8d7770ac7ba0ab49417ceacf82ebc708a3b3b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f9e44cf22562bae53a1a4c7cbf8b0bfcc780f591","unresolved":false,"context_lines":[{"line_number":3083,"context_line":""},{"line_number":3084,"context_line":"        requested_networks \u003d objects.NetworkRequestList("},{"line_number":3085,"context_line":"            objects\u003d[objects.NetworkRequest(port_id\u003dport[\u0027id\u0027])])"},{"line_number":3086,"context_line":"        count \u003d self.api.validate_networks(self.context, requested_networks, 1)"},{"line_number":3087,"context_line":"        self.assertEqual(1, count)"},{"line_number":3088,"context_line":""},{"line_number":3089,"context_line":"    @mock.patch(\u0027oslo_concurrency.lockutils.lock\u0027)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bacf61ea_4ee8eae2","line":3086,"in_reply_to":"bacf61ea_2e92d69f","updated":"2016-07-29 01:43:31.000000000","message":"Oh I see why it passes. _ports_needed_per_instance returns 0 because ports_needed_per_instance never gets changed since there is a singe NetworkRequest with a port already provided, so nova won\u0027t be trying to create one, so we don\u0027t check quota.","commit_id":"54b8d7770ac7ba0ab49417ceacf82ebc708a3b3b"}]}
