)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ce363b5038d0e494cc897528b912244d277385e9","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add Routed Networks support to Neutron API"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adds to allocate_for_instance in the Neutron API support for Routed Networks"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Iea41a65c18a11a3898658d4a1d187ff5ce0797d4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1aa78d24_1faf2582","line":10,"updated":"2016-07-05 17:14:55.000000000","message":"note this should have the blueprint in here.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"90a0ad64d567095e6ce3d71c12e4df6961935123","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add Routed Networks support to Neutron API"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Adds to allocate_for_instance in the Neutron API support for Routed Networks"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"Change-Id: Iea41a65c18a11a3898658d4a1d187ff5ce0797d4"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"1aa78d24_87f583cc","line":10,"in_reply_to":"1aa78d24_1faf2582","updated":"2016-07-05 22:36:47.000000000","message":"Will do in PS2","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":229,"context_line":""},{"line_number":230,"context_line":"    def _populate_ip_allocation_value(self, context, port_client,"},{"line_number":231,"context_line":"                                      port_req_body):"},{"line_number":232,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dport_client)"},{"line_number":233,"context_line":"        if constants.SEGMENT_EXT in self.extensions:"},{"line_number":234,"context_line":"            port_req_body[\u0027port\u0027][\u0027ip_allocation\u0027] \u003d \u0027deferred\u0027"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_1fa1e5a3","line":232,"updated":"2016-07-05 17:14:16.000000000","message":"we can\u0027t call refresh all the time, we need to extract that, see below.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":230,"context_line":"    def _populate_ip_allocation_value(self, context, port_client,"},{"line_number":231,"context_line":"                                      port_req_body):"},{"line_number":232,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dport_client)"},{"line_number":233,"context_line":"        if constants.SEGMENT_EXT in self.extensions:"},{"line_number":234,"context_line":"            port_req_body[\u0027port\u0027][\u0027ip_allocation\u0027] \u003d \u0027deferred\u0027"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _create_port_minimal(self, context, port_client, instance, network_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_bfca516c","line":233,"updated":"2016-07-05 17:14:16.000000000","message":"we should extract that inot the helper function.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                                      port_req_body):"},{"line_number":232,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dport_client)"},{"line_number":233,"context_line":"        if constants.SEGMENT_EXT in self.extensions:"},{"line_number":234,"context_line":"            port_req_body[\u0027port\u0027][\u0027ip_allocation\u0027] \u003d \u0027deferred\u0027"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _create_port_minimal(self, context, port_client, instance, network_id,"},{"line_number":237,"context_line":"                             fixed_ip\u003dNone, security_group_ids\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_5fa24daf","line":234,"updated":"2016-07-05 17:14:16.000000000","message":"Hmm, does this happen by default when you have routed_networks turned on?\n\nWhat does this mean if we are providing a fixed_ip address?","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"90a0ad64d567095e6ce3d71c12e4df6961935123","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                                      port_req_body):"},{"line_number":232,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dport_client)"},{"line_number":233,"context_line":"        if constants.SEGMENT_EXT in self.extensions:"},{"line_number":234,"context_line":"            port_req_body[\u0027port\u0027][\u0027ip_allocation\u0027] \u003d \u0027deferred\u0027"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _create_port_minimal(self, context, port_client, instance, network_id,"},{"line_number":237,"context_line":"                             fixed_ip\u003dNone, security_group_ids\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_9e6789e8","line":234,"in_reply_to":"1aa78d24_5fa24daf","updated":"2016-07-05 22:36:47.000000000","message":"We might not need to do this. This part of the Routed Network API is still in flux, while Carl Baldwin works on it. So deferred ip address might be the default value during port creation. In that case, we may need to modify the case in line 255 below, because there we are creating the port with an ip address explicitly. I included these lines in the patchset precisely to trigger this conversation\n\nIn my opinion, in making the decision which is going to be the default behavior with routed networks, we need to remember that they will not operate in isolation. I think that most operators will use routed networks and L2 networks at the same time. Maybe we are going to have the following in the Neutron API:\n\n1) For routed networks, deferred ip allocation is going to be the default\n2) For routed networks, if the user specifies an ip address, deferred ip doesn\u0027t apply\n3) For L2 networks, ip allocation wil not apply and ip addresses will be assigned immediately\n\nIf these 3 points are true, then we don\u0027t need these lines and lines 255 - 256 below are not affected. I\u0027ll wait for Carl to chime in","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d00b38b43445b0798bdb72d975a80adbb3219bf4","unresolved":false,"context_lines":[{"line_number":231,"context_line":"                                      port_req_body):"},{"line_number":232,"context_line":"        self._refresh_neutron_extensions_cache(context, neutron\u003dport_client)"},{"line_number":233,"context_line":"        if constants.SEGMENT_EXT in self.extensions:"},{"line_number":234,"context_line":"            port_req_body[\u0027port\u0027][\u0027ip_allocation\u0027] \u003d \u0027deferred\u0027"},{"line_number":235,"context_line":""},{"line_number":236,"context_line":"    def _create_port_minimal(self, context, port_client, instance, network_id,"},{"line_number":237,"context_line":"                             fixed_ip\u003dNone, security_group_ids\u003dNone):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_81a3aeff","line":234,"in_reply_to":"1aa78d24_9e6789e8","updated":"2016-07-05 23:20:30.000000000","message":"We shouldn\u0027t need to provide this. In fact, the way it is specified now this is a read-only option.  The create response should come back with this populated appropriately depending on the kind of network.\n\n1.  Yes, deferred will be the default for routed networks.\n2.  We need to expose segment_id on the fixed_ip dict from the API. I can\u0027t remember if we started a patch for that already.  I remember chatting with blogan about it. It will be straight-forward, I think.  We should also check the IPAM aware segment unit tests to be sure that we have tested requesting a specific IP.\n3.  Yes, when the ip_allocation extension is loaded you\u0027ll get \"ip_allocation\": \"immediate\" and an IP will be allocated. That\u0027s practically the same as if the extension is not loaded and you get the old behavior (just without the new attribute telling you it is immediate).","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        try:"},{"line_number":254,"context_line":"            if fixed_ip:"},{"line_number":255,"context_line":"                port_req_body[\u0027port\u0027][\u0027fixed_ips\u0027] \u003d ["},{"line_number":256,"context_line":"                    {\u0027ip_address\u0027: str(fixed_ip)}]"},{"line_number":257,"context_line":"            port_req_body[\u0027port\u0027][\u0027network_id\u0027] \u003d network_id"},{"line_number":258,"context_line":"            port_req_body[\u0027port\u0027][\u0027admin_state_up\u0027] \u003d True"},{"line_number":259,"context_line":"            port_req_body[\u0027port\u0027][\u0027tenant_id\u0027] \u003d instance.project_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_9f595501","line":256,"updated":"2016-07-05 17:14:16.000000000","message":"Does this not cause an issue with segments as well? i.e. the user specified a particular fixed_ip?\n\nShould we check the port we get back has a segment id?","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d00b38b43445b0798bdb72d975a80adbb3219bf4","unresolved":false,"context_lines":[{"line_number":253,"context_line":"        try:"},{"line_number":254,"context_line":"            if fixed_ip:"},{"line_number":255,"context_line":"                port_req_body[\u0027port\u0027][\u0027fixed_ips\u0027] \u003d ["},{"line_number":256,"context_line":"                    {\u0027ip_address\u0027: str(fixed_ip)}]"},{"line_number":257,"context_line":"            port_req_body[\u0027port\u0027][\u0027network_id\u0027] \u003d network_id"},{"line_number":258,"context_line":"            port_req_body[\u0027port\u0027][\u0027admin_state_up\u0027] \u003d True"},{"line_number":259,"context_line":"            port_req_body[\u0027port\u0027][\u0027tenant_id\u0027] \u003d instance.project_id"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_213e3a8c","line":256,"in_reply_to":"1aa78d24_9f595501","updated":"2016-07-05 23:20:30.000000000","message":"I\u0027m having trouble thinking of a good use case for this.  I think people who are accustomed to requesting specific addresses in this way will soon learn not to with routed networks.  It only constrains where their instance can be placed.\n\nIf there are use cases for specifying a specific IP address, those will be very uncommon, I think.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d00b38b43445b0798bdb72d975a80adbb3219bf4","unresolved":false,"context_lines":[{"line_number":320,"context_line":"                        {\u0027mac\u0027: mac_address, \u0027network\u0027: network_id},"},{"line_number":321,"context_line":"                        instance\u003dinstance)"},{"line_number":322,"context_line":"            raise exception.PortInUse(port_id\u003dmac_address)"},{"line_number":323,"context_line":"        except neutron_client_exc.IpAddressGenerationFailureClient:"},{"line_number":324,"context_line":"            LOG.warning(_LW(\u0027Neutron error: Network %(net_id)s has no more \u0027"},{"line_number":325,"context_line":"                            \u0027ip addresses available\u0027),"},{"line_number":326,"context_line":"                        {\u0027net_id\u0027: network_id}, instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_21a8fa8c","line":323,"range":{"start_line":323,"start_character":34,"end_line":323,"end_character":66},"updated":"2016-07-05 23:20:30.000000000","message":"Actually, this might be the key to what I was working on this afternoon.  I was trying to figure out when to abort the build because deferred IP allocation failed.\n\nIt is very timely that I found this right now.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        except neutron_client_exc.IpAddressGenerationFailureClient:"},{"line_number":324,"context_line":"            LOG.warning(_LW(\u0027Neutron error: Network %(net_id)s has no more \u0027"},{"line_number":325,"context_line":"                            \u0027ip addresses available\u0027),"},{"line_number":326,"context_line":"                        {\u0027net_id\u0027: network_id}, instance\u003dinstance)"},{"line_number":327,"context_line":"            raise exception.NoMoreFixedIps(net\u003dnetwork_id)"},{"line_number":328,"context_line":""},{"line_number":329,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_1c83b399","line":326,"updated":"2016-07-05 17:14:16.000000000","message":"Nit: I would move line 309 to line 324, so its defined nearer to where it is used (and so the unit tests will be less of a pain to fix).","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":437,"context_line":"                    # Make sure that the port has a segment id assigned to it"},{"line_number":438,"context_line":"                    # if it was created with a fixed ip and the segments"},{"line_number":439,"context_line":"                    # extension is enbaled in Neutron"},{"line_number":440,"context_line":"                    self._refresh_neutron_extensions_cache(context,"},{"line_number":441,"context_line":"                                                           neutron\u003dneutron)"},{"line_number":442,"context_line":"                    if constants.SEGMENT_EXT in self.extensions:"},{"line_number":443,"context_line":"                        if (port.get(\u0027fixed_ips\u0027) and"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_7f5bc92e","line":440,"updated":"2016-07-05 17:14:16.000000000","message":"I think we really shouldn\u0027t do so many refreshes of the neutron extensions during a single allocate_for_instance, so we should fix that before we add another one.\n\nNote this is happening per requested network :(\n\nNote we do this refresh here:\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L779\n\nI think we probably want to do this check, and port binding, at the top of here:\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L691","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":439,"context_line":"                    # extension is enbaled in Neutron"},{"line_number":440,"context_line":"                    self._refresh_neutron_extensions_cache(context,"},{"line_number":441,"context_line":"                                                           neutron\u003dneutron)"},{"line_number":442,"context_line":"                    if constants.SEGMENT_EXT in self.extensions:"},{"line_number":443,"context_line":"                        if (port.get(\u0027fixed_ips\u0027) and"},{"line_number":444,"context_line":"                            not port.get(\u0027segment_id\u0027)):"},{"line_number":445,"context_line":"                            raise exception.PortRequiresSegmentId("}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_bf3d31bd","line":442,"updated":"2016-07-05 17:14:16.000000000","message":"Please don\u0027t do this here, create a new function like this one:\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L869","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d00b38b43445b0798bdb72d975a80adbb3219bf4","unresolved":false,"context_lines":[{"line_number":441,"context_line":"                                                           neutron\u003dneutron)"},{"line_number":442,"context_line":"                    if constants.SEGMENT_EXT in self.extensions:"},{"line_number":443,"context_line":"                        if (port.get(\u0027fixed_ips\u0027) and"},{"line_number":444,"context_line":"                            not port.get(\u0027segment_id\u0027)):"},{"line_number":445,"context_line":"                            raise exception.PortRequiresSegmentId("},{"line_number":446,"context_line":"                                port_id\u003drequest.port_id)"},{"line_number":447,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_e150b2d6","line":444,"range":{"start_line":444,"start_character":32,"end_line":444,"end_character":56},"updated":"2016-07-05 23:20:30.000000000","message":"I don\u0027t think this will be where the segment_id is found on the port because  it could be mis-understood in the face of hierarchical port binding.  I\u0027m really leaning toward exposing the segment_id as part of the fixed ip with the ip address and the subnet id, etc.\n\nOr, I guess we could expose it as \"ipam_segment_id\" or something to be sure it isn\u0027t confused with something else.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":442,"context_line":"                    if constants.SEGMENT_EXT in self.extensions:"},{"line_number":443,"context_line":"                        if (port.get(\u0027fixed_ips\u0027) and"},{"line_number":444,"context_line":"                            not port.get(\u0027segment_id\u0027)):"},{"line_number":445,"context_line":"                            raise exception.PortRequiresSegmentId("},{"line_number":446,"context_line":"                                port_id\u003drequest.port_id)"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"                    # Make sure that if the user assigned a value to the port\u0027s"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_3fd4a145","line":445,"updated":"2016-07-05 17:14:16.000000000","message":"If it has a fixed IP, make sure it has a segment, I guess?","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"d00b38b43445b0798bdb72d975a80adbb3219bf4","unresolved":false,"context_lines":[{"line_number":442,"context_line":"                    if constants.SEGMENT_EXT in self.extensions:"},{"line_number":443,"context_line":"                        if (port.get(\u0027fixed_ips\u0027) and"},{"line_number":444,"context_line":"                            not port.get(\u0027segment_id\u0027)):"},{"line_number":445,"context_line":"                            raise exception.PortRequiresSegmentId("},{"line_number":446,"context_line":"                                port_id\u003drequest.port_id)"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"                    # Make sure that if the user assigned a value to the port\u0027s"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_810d6eea","line":445,"in_reply_to":"1aa78d24_3fd4a145","updated":"2016-07-05 23:20:30.000000000","message":"We\u0027re not going to require a segment just because the extension is loaded. It is going to depend on the network, if it is a routed network. I think we should just look for a segment on the port and, if it exists, use it in scheduling.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cabaff07ed75c9cb37a7079c0503c68910bb5b56","unresolved":false,"context_lines":[{"line_number":683,"context_line":"        # TODO(mlavalle) For ports that were created by the user with an IP"},{"line_number":684,"context_line":"        # address and passed to Nova, the data structure returned by this"},{"line_number":685,"context_line":"        # method has to include the asociated segment_id so the scheduler can"},{"line_number":686,"context_line":"        # use it in the placement decision"},{"line_number":687,"context_line":"        return requests_and_created_ports"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"    def allocate_for_instance(self, context, instance, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_3fd78124","line":686,"updated":"2016-07-05 17:14:16.000000000","message":"So we should probably start returning the create_port, but thats only needed once we do the final split, as you say.\n\nI have a patch that does that by populating a network_info object with all the details like segment_id.","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"90a0ad64d567095e6ce3d71c12e4df6961935123","unresolved":false,"context_lines":[{"line_number":683,"context_line":"        # TODO(mlavalle) For ports that were created by the user with an IP"},{"line_number":684,"context_line":"        # address and passed to Nova, the data structure returned by this"},{"line_number":685,"context_line":"        # method has to include the asociated segment_id so the scheduler can"},{"line_number":686,"context_line":"        # use it in the placement decision"},{"line_number":687,"context_line":"        return requests_and_created_ports"},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"    def allocate_for_instance(self, context, instance, **kwargs):"}],"source_content_type":"text/x-python","patch_set":1,"id":"1aa78d24_7e561dcf","line":686,"in_reply_to":"1aa78d24_3fd78124","updated":"2016-07-05 22:36:47.000000000","message":"Yes, I am well aware of the wip patchset where you are saving the ports in a network_info object. However, since I based this patchset on the merged code, I just wanted to point out that it needs to be done. I don\u0027t intend to do anything in this regard. I am assuming that it will be addressed by you wip patchset","commit_id":"73e2ca07b1cf2243641e30b26f40eef9a6dd635c"}]}
