)]}'
{"nova/virt/hyperv/vmops.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f07def1c9082efcb649f74a35d7742fd27065685","unresolved":false,"context_lines":[{"line_number":310,"context_line":"        try:"},{"line_number":311,"context_line":"            # NOTE(claudiub): async calls to bind the neutron ports will be"},{"line_number":312,"context_line":"            # done when network_info is being accessed."},{"line_number":313,"context_line":"            events \u003d self._get_neutron_events(network_info)"},{"line_number":314,"context_line":"            with self._virtapi.wait_for_instance_event("},{"line_number":315,"context_line":"                    instance, events, deadline\u003dtimeout,"},{"line_number":316,"context_line":"                    error_callback\u003dself._neutron_failed_callback):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff6b8bd7_563b25d0","line":313,"updated":"2018-03-06 23:46:56.000000000","message":"I\u0027m not sure why this needed to be moved inside the try/except block.","commit_id":"b80c245ba529ab603910b5c0e2fa466bf0b6a146"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"f65e74751bbff15469379637dee71882c70e1967","unresolved":false,"context_lines":[{"line_number":310,"context_line":"        try:"},{"line_number":311,"context_line":"            # NOTE(claudiub): async calls to bind the neutron ports will be"},{"line_number":312,"context_line":"            # done when network_info is being accessed."},{"line_number":313,"context_line":"            events \u003d self._get_neutron_events(network_info)"},{"line_number":314,"context_line":"            with self._virtapi.wait_for_instance_event("},{"line_number":315,"context_line":"                    instance, events, deadline\u003dtimeout,"},{"line_number":316,"context_line":"                    error_callback\u003dself._neutron_failed_callback):"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_f8492832","line":313,"in_reply_to":"ff6b8bd7_563b25d0","updated":"2018-03-07 09:47:10.000000000","message":"so the PortBindingFailed exception would be caught in this block. IMO, this looks better than having this particular line of code wrapped in a try-except block, and having this one other try-except block.\n\nas I\u0027ve mentioned in the comment above, network_info is a lazy loading object, and when accessed / iterated over (in _get_neutron_events), it will load and bind the neutron ports, which could fail with a PortBindingFailed [1].\n\nI\u0027ve included a trace in the bug report [2].\n\n[1] https://github.com/openstack/nova/blob/ac60fda9e59855b3dc86d5777150814aa5eb48d2/nova/network/neutronv2/api.py#L470\n\n[2] http://paste.openstack.org/show/646888/","commit_id":"b80c245ba529ab603910b5c0e2fa466bf0b6a146"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f07def1c9082efcb649f74a35d7742fd27065685","unresolved":false,"context_lines":[{"line_number":321,"context_line":"                        \u0027instance.\u0027, instance\u003dinstance)"},{"line_number":322,"context_line":"            if CONF.vif_plugging_is_fatal:"},{"line_number":323,"context_line":"                raise exception.VirtualInterfaceCreateException()"},{"line_number":324,"context_line":"        except exception.PortBindingFailed:"},{"line_number":325,"context_line":"            LOG.warning("},{"line_number":326,"context_line":"                \"Neutron failed to bind a port to this host. Make sure that \""},{"line_number":327,"context_line":"                \"an L2 agent is alive and registered from this node (neutron \""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_dcdb017b","line":324,"range":{"start_line":324,"start_character":25,"end_line":324,"end_character":42},"updated":"2018-03-06 23:46:56.000000000","message":"Is this right? Wouldn\u0027t we get VirtualInterfaceCreateException because that\u0027s what _neutron_failed_callback raises?","commit_id":"b80c245ba529ab603910b5c0e2fa466bf0b6a146"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"f65e74751bbff15469379637dee71882c70e1967","unresolved":false,"context_lines":[{"line_number":321,"context_line":"                        \u0027instance.\u0027, instance\u003dinstance)"},{"line_number":322,"context_line":"            if CONF.vif_plugging_is_fatal:"},{"line_number":323,"context_line":"                raise exception.VirtualInterfaceCreateException()"},{"line_number":324,"context_line":"        except exception.PortBindingFailed:"},{"line_number":325,"context_line":"            LOG.warning("},{"line_number":326,"context_line":"                \"Neutron failed to bind a port to this host. Make sure that \""},{"line_number":327,"context_line":"                \"an L2 agent is alive and registered from this node (neutron \""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_b8c41042","line":324,"range":{"start_line":324,"start_character":25,"end_line":324,"end_character":42},"in_reply_to":"df7087c5_dcdb017b","updated":"2018-03-07 09:47:10.000000000","message":"as I\u0027ve mentioned above, PortBindingFailed would be generated when accessing network_info, which is lazy loading, when it tries to bind the ports. PortBindingFailed can be generated each and every single time (if Neutron has no way of binding a particular port to this host due to various reasons explained in the warning), but VirtualInterfaceCreateException is generated only if vif_plugging_is_fatal is set to True.\n\nVirtualInterfaceCreateException is generated after: the neutron ports have been succesfully been bound to this host, after we\u0027ve already created the VM and all its NICs. It will happen when we\u0027re starting to wait for the VIF plugging event from Neutron and the time limit exceeded.\n\nSo, the point of the patch is to treat only the PortBindingFailed exception. I\u0027ve been asked plenty of times about this type of error and they all had the same answer.","commit_id":"b80c245ba529ab603910b5c0e2fa466bf0b6a146"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1f0509d2b7046fb7c2554fa08d94fd05156f0810","unresolved":false,"context_lines":[{"line_number":345,"context_line":"        # already up will not undergo that transition, and for"},{"line_number":346,"context_line":"        # anything that might be stale (cache-wise) assume it\u0027s"},{"line_number":347,"context_line":"        # already up so we don\u0027t block on it."},{"line_number":348,"context_line":"        if utils.is_neutron() and CONF.vif_plugging_timeout:"},{"line_number":349,"context_line":"            return [(\u0027network-vif-plugged\u0027, vif[\u0027id\u0027])"},{"line_number":350,"context_line":"                    for vif in network_info if vif.get(\u0027active\u0027) is False]"},{"line_number":351,"context_line":"        else:"},{"line_number":352,"context_line":"            return []"},{"line_number":353,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_caf4815e","line":350,"range":{"start_line":348,"start_character":8,"end_line":350,"end_character":74},"updated":"2018-03-07 14:51:13.000000000","message":"Where does this bind ports? I don\u0027t get where any of this can raise PortBindingFailed.\n\n\u003clater\u003e\n\nOK looking at http://paste.openstack.org/show/646888/ I can see how it\u0027s happening. I know how the network async wrapper works, I guess I just wasn\u0027t tying that back to the compute manager doing the allocate_for_instance call to create/update (bind) the ports on the host.","commit_id":"b80c245ba529ab603910b5c0e2fa466bf0b6a146"}]}
