)]}'
{"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f50b0c70c0897dd0d89e1ac48ebd582db84ecb5","unresolved":false,"context_lines":[{"line_number":1761,"context_line":"            LOG.warning(msg, instance\u003dinstance)"},{"line_number":1762,"context_line":"            raise exception.VolumeLimitExceeded()"},{"line_number":1763,"context_line":""},{"line_number":1764,"context_line":"        except exception.VolumeAttachFailed:"},{"line_number":1765,"context_line":"            raise"},{"line_number":1766,"context_line":""},{"line_number":1767,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_07b71e3a","line":1764,"range":{"start_line":1764,"start_character":25,"end_line":1764,"end_character":43},"updated":"2016-03-07 17:30:25.000000000","message":"This is a bit confusing, since driver_block_device.attach_block_devices not only calls os-initialize_connection on the cinder API but also os-attach, so just looking at this w/o knowing what\u0027s raising it from the block device code in the virt layer, I could think that the actual os-attach call failed, and it\u0027s not a problem making the connection to the storage host. So I think we should be more specific with this exception, maybe call it something like VolumeHostInitConnnectionFailed?","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"a8b03f8100b65132bf64518d6f75f8ae66975413","unresolved":false,"context_lines":[{"line_number":1761,"context_line":"            LOG.warning(msg, instance\u003dinstance)"},{"line_number":1762,"context_line":"            raise exception.VolumeLimitExceeded()"},{"line_number":1763,"context_line":""},{"line_number":1764,"context_line":"        except exception.VolumeAttachFailed:"},{"line_number":1765,"context_line":"            raise"},{"line_number":1766,"context_line":""},{"line_number":1767,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_592622bb","line":1764,"range":{"start_line":1764,"start_character":25,"end_line":1764,"end_character":43},"in_reply_to":"5aef4532_07b71e3a","updated":"2016-03-07 20:59:11.000000000","message":"Done","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f50b0c70c0897dd0d89e1ac48ebd582db84ecb5","unresolved":false,"context_lines":[{"line_number":1762,"context_line":"            raise exception.VolumeLimitExceeded()"},{"line_number":1763,"context_line":""},{"line_number":1764,"context_line":"        except exception.VolumeAttachFailed:"},{"line_number":1765,"context_line":"            raise"},{"line_number":1766,"context_line":""},{"line_number":1767,"context_line":"        except Exception:"},{"line_number":1768,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_c79376a2","line":1765,"range":{"start_line":1765,"start_character":12,"end_line":1765,"end_character":17},"updated":"2016-03-07 17:30:25.000000000","message":"I\u0027d probably put a comment in here that we\u0027re handling this separately so we don\u0027t abort the build but rather use it to trigger a reschedule.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"a8b03f8100b65132bf64518d6f75f8ae66975413","unresolved":false,"context_lines":[{"line_number":1762,"context_line":"            raise exception.VolumeLimitExceeded()"},{"line_number":1763,"context_line":""},{"line_number":1764,"context_line":"        except exception.VolumeAttachFailed:"},{"line_number":1765,"context_line":"            raise"},{"line_number":1766,"context_line":""},{"line_number":1767,"context_line":"        except Exception:"},{"line_number":1768,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_392b5684","line":1765,"range":{"start_line":1765,"start_character":12,"end_line":1765,"end_character":17},"in_reply_to":"5aef4532_c79376a2","updated":"2016-03-07 20:59:11.000000000","message":"Done","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0f50b0c70c0897dd0d89e1ac48ebd582db84ecb5","unresolved":false,"context_lines":[{"line_number":2168,"context_line":"            block_device_info \u003d self._prep_block_device(context, instance,"},{"line_number":2169,"context_line":"                    block_device_mapping)"},{"line_number":2170,"context_line":"            resources[\u0027block_device_info\u0027] \u003d block_device_info"},{"line_number":2171,"context_line":"        except (exception.InstanceNotFound,"},{"line_number":2172,"context_line":"                exception.UnexpectedDeletingTaskStateError):"},{"line_number":2173,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":2174,"context_line":"                # Make sure the async call finishes"},{"line_number":2175,"context_line":"                if network_info is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_473c8693","line":2172,"range":{"start_line":2171,"start_character":8,"end_line":2172,"end_character":60},"updated":"2016-03-07 17:30:25.000000000","message":"Why not add to this list so we wait for network setup to finish?","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3b0c50ec7fa4df81c6fa370e9570393cd327c1bc","unresolved":false,"context_lines":[{"line_number":2168,"context_line":"            block_device_info \u003d self._prep_block_device(context, instance,"},{"line_number":2169,"context_line":"                    block_device_mapping)"},{"line_number":2170,"context_line":"            resources[\u0027block_device_info\u0027] \u003d block_device_info"},{"line_number":2171,"context_line":"        except (exception.InstanceNotFound,"},{"line_number":2172,"context_line":"                exception.UnexpectedDeletingTaskStateError):"},{"line_number":2173,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":2174,"context_line":"                # Make sure the async call finishes"},{"line_number":2175,"context_line":"                if network_info is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_2a4c9f6f","line":2172,"range":{"start_line":2171,"start_character":8,"end_line":2172,"end_character":60},"in_reply_to":"5aef4532_473c8693","updated":"2016-03-07 17:44:50.000000000","message":"Doesn\u0027t matter to me if it\u0027s added here or kept separate, but it does need to wait for the network setup to finish.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"a8b03f8100b65132bf64518d6f75f8ae66975413","unresolved":false,"context_lines":[{"line_number":2168,"context_line":"            block_device_info \u003d self._prep_block_device(context, instance,"},{"line_number":2169,"context_line":"                    block_device_mapping)"},{"line_number":2170,"context_line":"            resources[\u0027block_device_info\u0027] \u003d block_device_info"},{"line_number":2171,"context_line":"        except (exception.InstanceNotFound,"},{"line_number":2172,"context_line":"                exception.UnexpectedDeletingTaskStateError):"},{"line_number":2173,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":2174,"context_line":"                # Make sure the async call finishes"},{"line_number":2175,"context_line":"                if network_info is not None:"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_f91a8e6d","line":2172,"range":{"start_line":2171,"start_character":8,"end_line":2172,"end_character":60},"in_reply_to":"5aef4532_473c8693","updated":"2016-03-07 20:59:11.000000000","message":"Done","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":1785,"context_line":"            LOG.info(_LI(\u0027Took %0.2f seconds to build instance.\u0027),"},{"line_number":1786,"context_line":"                     timer.elapsed(), instance\u003dinstance)"},{"line_number":1787,"context_line":"            return build_results.ACTIVE"},{"line_number":1788,"context_line":"        except exception.RescheduledException as e:"},{"line_number":1789,"context_line":"            retry \u003d filter_properties.get(\u0027retry\u0027)"},{"line_number":1790,"context_line":"            if not retry:"},{"line_number":1791,"context_line":"                # no retry information, do not reschedule."}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_9862a4d7","line":1788,"updated":"2016-10-04 16:55:37.000000000","message":"As far as I can tell we don\u0027t do any volume cleanup in here on reschedule, so we\u0027re orphaning volumes that nova created but failed to attach.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"}],"nova/exception.py":[{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"283fbe091b36e7f96fbb23209a3e378ed5cb8b49","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 IBM Corp."},{"line_number":2,"context_line":"# Copyright 2010 United States Government as represented by the"},{"line_number":3,"context_line":"# Administrator of the National Aeronautics and Space Administration."},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":3,"id":"5a710552_2a79fd93","line":1,"updated":"2015-12-15 01:08:41.000000000","message":"This line should be removed because you didn\u0027t make any changes in this file.","commit_id":"c1a51e1e5e9f36fe1b11c7e56a43b3cc7e5ac614"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"fecf7599ec5ceffc62d29b6a917a30c6ebb419ef","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 IBM Corp."},{"line_number":2,"context_line":"# Copyright 2010 United States Government as represented by the"},{"line_number":3,"context_line":"# Administrator of the National Aeronautics and Space Administration."},{"line_number":4,"context_line":"# All Rights Reserved."}],"source_content_type":"text/x-python","patch_set":3,"id":"5a710552_a2e2da01","line":1,"in_reply_to":"5a710552_2a79fd93","updated":"2015-12-15 16:13:28.000000000","message":"Thanks.  This file use to have VolumeAttachFailed added, but that exception has since merged in master and I missed removing this on the rebase.","commit_id":"c1a51e1e5e9f36fe1b11c7e56a43b3cc7e5ac614"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"class VolumeHostInitConnnectionFailed(NovaException):"},{"line_number":259,"context_line":"    msg_fmt \u003d _(\"Failed to initialize the connection for volume \""},{"line_number":260,"context_line":"                \"%(volume_id)s.  Reason: %(reason)s\")"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"class VolumeConnectorFailed(NovaException):"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_ba491891","line":260,"range":{"start_line":260,"start_character":31,"end_line":260,"end_character":33},"updated":"2016-10-04 16:55:37.000000000","message":"s/  / / - same below","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"}],"nova/tests/unit/compute/test_compute_mgr.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":4102,"context_line":"                            self.block_device_mapping):"},{"line_number":4103,"context_line":"                        pass"},{"line_number":4104,"context_line":"                except Exception as e:"},{"line_number":4105,"context_line":"                    self.assertEqual(e, ex)"},{"line_number":4106,"context_line":""},{"line_number":4107,"context_line":"                _build_networks_for_instance.assert_has_calls("},{"line_number":4108,"context_line":"                        [mock.call(self.context, self.instance,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_3d3a62ce","line":4105,"range":{"start_line":4105,"start_character":20,"end_line":4105,"end_character":43},"updated":"2016-10-04 16:55:37.000000000","message":"nit: these arguments should be reversed (expected, actual), it matters for the MismatchError message you get if it fails.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"}],"nova/tests/unit/virt/test_block_device.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from oslo_serialization import jsonutils"},{"line_number":17,"context_line":"import six"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"from cinderclient import exceptions as cinder_exception"},{"line_number":20,"context_line":"from nova import block_device"},{"line_number":21,"context_line":"from nova import context"},{"line_number":22,"context_line":"from nova import exception"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_5d656edf","line":19,"updated":"2016-10-04 16:55:37.000000000","message":"nit: this should be grouped with the 3rd party imports above.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":612,"context_line":"                         do_driver_attach\u003dFalse)"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"    def test_volume_attach_get_volume_connector_fails(self):"},{"line_number":615,"context_line":"        test_bdm \u003d self.driver_classes[\u0027volume\u0027]("},{"line_number":616,"context_line":"            self.volume_bdm)"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"        with test.nested("}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_5d480e2e","line":615,"range":{"start_line":615,"start_character":19,"end_line":615,"end_character":48},"updated":"2016-10-04 16:55:37.000000000","message":"This is a bit confusing given we don\u0027t create volumes for this type, only for blank/image/local types. I assume you\u0027re using this because it\u0027s the parent class and what implements the attach method that you\u0027re mocking, but it\u0027s still a bit confusing given the usage.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"}],"nova/virt/block_device.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"699c2eaac05330ad0fd0877873c150f229f881a4","unresolved":false,"context_lines":[{"line_number":263,"context_line":"            connection_info \u003d volume_api.initialize_connection(context,"},{"line_number":264,"context_line":"                                                               volume_id,"},{"line_number":265,"context_line":"                                                               connector)"},{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_a4b62888","line":266,"range":{"start_line":266,"start_character":15,"end_line":266,"end_character":24},"updated":"2016-03-07 17:24:38.000000000","message":"This is more generic than I\u0027d normally like, but I\u0027m not sure we can help it since the virt driver get_volume_connector call is calling off to other libraries, like os-brick.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"a8b03f8100b65132bf64518d6f75f8ae66975413","unresolved":false,"context_lines":[{"line_number":263,"context_line":"            connection_info \u003d volume_api.initialize_connection(context,"},{"line_number":264,"context_line":"                                                               volume_id,"},{"line_number":265,"context_line":"                                                               connector)"},{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_9920aa9d","line":266,"range":{"start_line":266,"start_character":15,"end_line":266,"end_character":24},"in_reply_to":"5aef4532_072d5ea7","updated":"2016-03-07 20:59:11.000000000","message":"I will try and find a good set of exceptions to except here and update.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"c26ca9d557544043bd30625cab241ccbdd4969ef","unresolved":false,"context_lines":[{"line_number":263,"context_line":"            connection_info \u003d volume_api.initialize_connection(context,"},{"line_number":264,"context_line":"                                                               volume_id,"},{"line_number":265,"context_line":"                                                               connector)"},{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_225bf188","line":266,"range":{"start_line":266,"start_character":15,"end_line":266,"end_character":24},"in_reply_to":"5aef4532_9920aa9d","updated":"2016-03-08 16:36:40.000000000","message":"In the latest patch set I\u0027ve split these two calls out into two try-except blocks to scope which exceptions are caught and which are allowed to trigger reschedule","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3b0c50ec7fa4df81c6fa370e9570393cd327c1bc","unresolved":false,"context_lines":[{"line_number":263,"context_line":"            connection_info \u003d volume_api.initialize_connection(context,"},{"line_number":264,"context_line":"                                                               volume_id,"},{"line_number":265,"context_line":"                                                               connector)"},{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_072d5ea7","line":266,"range":{"start_line":266,"start_character":15,"end_line":266,"end_character":24},"in_reply_to":"5aef4532_a4b62888","updated":"2016-03-07 17:44:50.000000000","message":"I would expect there to be an exception, or set of exceptions, that we could associate with a reschedulable failure. There must be some failures that can be raised here which should not lead to a reschedule so I think we should default to not rescheduling. And only reschedule if we are sure that it\u0027s a recoverable failure, even if that means we miss some that need to be added later.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"699c2eaac05330ad0fd0877873c150f229f881a4","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                                                               volume_id,"},{"line_number":265,"context_line":"                                                               connector)"},{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"},{"line_number":270,"context_line":"                                               reason\u003dsix.text_type(e))"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_e4267015","line":267,"updated":"2016-03-07 17:24:38.000000000","message":"If you plan on rescheduling, this shouldn\u0027t print a stack trace probably, since we could consider it as an expected scenario.\n\nI\u0027d be OK with logging an error using LOG.error(_LE(...)) and then include the exception in the error log message.\n\nI\u0027m also not crazy about the \u0027Instance failed block device setup\u0027 message, we\u0027re really failing making a connection to the volume service, so I\u0027d say something to that effect, plus include the volume_id in the message for context.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3b0c50ec7fa4df81c6fa370e9570393cd327c1bc","unresolved":false,"context_lines":[{"line_number":264,"context_line":"                                                               volume_id,"},{"line_number":265,"context_line":"                                                               connector)"},{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"},{"line_number":270,"context_line":"                                               reason\u003dsix.text_type(e))"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_07043e15","line":267,"in_reply_to":"5aef4532_e4267015","updated":"2016-03-07 17:44:50.000000000","message":"Agreed. I would log a warning.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a04dc8db6b3d0d4ea56515757cfb62e8105c5741","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"},{"line_number":270,"context_line":"                                               reason\u003dsix.text_type(e))"},{"line_number":271,"context_line":"        if \u0027serial\u0027 not in connection_info:"},{"line_number":272,"context_line":"            connection_info[\u0027serial\u0027] \u003d self.volume_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_e7caf24e","line":269,"updated":"2016-03-07 17:34:46.000000000","message":"One thing that kind of worries me about rescheduling, is if we\u0027re booting from volume with source_type of image/snapshot/blank, nova has already created a volume and waited for it to be available. Now if we can\u0027t initialize a connection to the host to attach the volume, we\u0027ll not only orphan that volume but reschedule and potentially orphan more volumes that nova creates.\n\nThe orphaned volume case is a bug on it\u0027s own (unless you use delete_on_termination\u003dTrue so that when you delete the instance we also delete the volume).\n\nBut rescheduling exposes it a bit more.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"cc666a926e6b980d1dc26d2ad1f9e4625ba4f6c1","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"},{"line_number":270,"context_line":"                                               reason\u003dsix.text_type(e))"},{"line_number":271,"context_line":"        if \u0027serial\u0027 not in connection_info:"},{"line_number":272,"context_line":"            connection_info[\u0027serial\u0027] \u003d self.volume_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_8a25f3ac","line":269,"in_reply_to":"5aef4532_e7caf24e","updated":"2016-03-07 17:44:45.000000000","message":"On reschedule it will not orphan more volumes.  The compute manager on the rescheduled host will see the BDM as already having a volume and not recreate a new volume from the image/snapshot/blank, which is actually a good behavior. Nova does NOT need to delete the volume before reschedule and recreate the volume on reschedule.\n\nIf the Nova boot fails on all hosts the volumes will be orphaned on VM delete, even if the BDM is delete_on_termination\u003dTrue, but https://review.openstack.org/#/c/256059/ fixes that.\n\nIf the caller specifies delete_on_termination\u003dFalse and complains about orphaned volumes on VM delete that is user error.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"3b0c50ec7fa4df81c6fa370e9570393cd327c1bc","unresolved":false,"context_lines":[{"line_number":266,"context_line":"        except Exception as e:"},{"line_number":267,"context_line":"            LOG.exception(_LE(\u0027Instance failed block device setup\u0027),"},{"line_number":268,"context_line":"                          instance\u003dinstance)"},{"line_number":269,"context_line":"            raise exception.VolumeAttachFailed(volume_id\u003dvolume_id,"},{"line_number":270,"context_line":"                                               reason\u003dsix.text_type(e))"},{"line_number":271,"context_line":"        if \u0027serial\u0027 not in connection_info:"},{"line_number":272,"context_line":"            connection_info[\u0027serial\u0027] \u003d self.volume_id"}],"source_content_type":"text/x-python","patch_set":5,"id":"5aef4532_87d68ec3","line":269,"in_reply_to":"5aef4532_e7caf24e","updated":"2016-03-07 17:44:50.000000000","message":"Whether or not this occurs depends on if block_device_mapping is updated to use the created volume rather than create one when the reschedule happens. An explicit refresh may need to be added.","commit_id":"50e2064c296880b42465c1a22b494df31f9737a1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":256,"context_line":""},{"line_number":257,"context_line":"        try:"},{"line_number":258,"context_line":"            connector \u003d virt_driver.get_volume_connector(instance)"},{"line_number":259,"context_line":"        except Exception as e:"},{"line_number":260,"context_line":"            LOG.warn(_LW(\u0027Initialize connection failed for instance \u0027"},{"line_number":261,"context_line":"                         \u0027%(instance_uuid)s.\u0027),"},{"line_number":262,"context_line":"                     {\u0027instance_uuid\u0027: instance.uuid},"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_1d2be631","line":259,"range":{"start_line":259,"start_character":15,"end_line":259,"end_character":24},"updated":"2016-10-04 16:55:37.000000000","message":"This is pretty broad, I feel like we\u0027ve been down this path before in this change though. We do the same in the case of attach_volume failures below I guess.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":257,"context_line":"        try:"},{"line_number":258,"context_line":"            connector \u003d virt_driver.get_volume_connector(instance)"},{"line_number":259,"context_line":"        except Exception as e:"},{"line_number":260,"context_line":"            LOG.warn(_LW(\u0027Initialize connection failed for instance \u0027"},{"line_number":261,"context_line":"                         \u0027%(instance_uuid)s.\u0027),"},{"line_number":262,"context_line":"                     {\u0027instance_uuid\u0027: instance.uuid},"},{"line_number":263,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_7d6cea9c","line":260,"range":{"start_line":260,"start_character":16,"end_line":260,"end_character":20},"updated":"2016-10-04 16:55:37.000000000","message":"s/warn/warning/ for py3","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":259,"context_line":"        except Exception as e:"},{"line_number":260,"context_line":"            LOG.warn(_LW(\u0027Initialize connection failed for instance \u0027"},{"line_number":261,"context_line":"                         \u0027%(instance_uuid)s.\u0027),"},{"line_number":262,"context_line":"                     {\u0027instance_uuid\u0027: instance.uuid},"},{"line_number":263,"context_line":"                     instance\u003dinstance)"},{"line_number":264,"context_line":"            raise exception.VolumeConnectorFailed("},{"line_number":265,"context_line":"                instance_uuid\u003dinstance.uuid,"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_dd097edf","line":262,"range":{"start_line":262,"start_character":21,"end_line":262,"end_character":54},"updated":"2016-10-04 16:55:37.000000000","message":"nit: you don\u0027t need to provide this in the log message since the instance\u003dinstance kwarg will provide the context.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":264,"context_line":"            raise exception.VolumeConnectorFailed("},{"line_number":265,"context_line":"                instance_uuid\u003dinstance.uuid,"},{"line_number":266,"context_line":"                reason\u003dsix.text_type(e))"},{"line_number":267,"context_line":"        try:"},{"line_number":268,"context_line":"            connection_info \u003d volume_api.initialize_connection(context,"},{"line_number":269,"context_line":"                                                               volume_id,"},{"line_number":270,"context_line":"                                                               connector)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_bdb912ef","line":267,"updated":"2016-10-04 16:55:37.000000000","message":"nit: please add a blank line above this to make it easier to read as a separate operation.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                                                               volume_id,"},{"line_number":270,"context_line":"                                                               connector)"},{"line_number":271,"context_line":"        except cinder_exception.ClientException as e:"},{"line_number":272,"context_line":"            LOG.warn(_LW(\u0027Initialize connection failed for volume \u0027"},{"line_number":273,"context_line":"                         \u0027%(volume_id)s.\u0027),"},{"line_number":274,"context_line":"                     {\u0027volume_id\u0027: volume_id},"},{"line_number":275,"context_line":"                     instance\u003dinstance)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_1db046f4","line":272,"range":{"start_line":272,"start_character":16,"end_line":272,"end_character":20},"updated":"2016-10-04 16:55:37.000000000","message":"warning","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":291,"context_line":"                        context, connection_info, instance,"},{"line_number":292,"context_line":"                        self[\u0027mount_device\u0027], disk_bus\u003dself[\u0027disk_bus\u0027],"},{"line_number":293,"context_line":"                        device_type\u003dself[\u0027device_type\u0027], encryption\u003dencryption)"},{"line_number":294,"context_line":"            except Exception:"},{"line_number":295,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":296,"context_line":"                    LOG.exception(_LE(\"Driver failed to attach volume \""},{"line_number":297,"context_line":"                                      \"%(volume_id)s at %(mountpoint)s\"),"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_5da00e91","line":294,"updated":"2016-10-04 16:55:37.000000000","message":"So what if attaching the volume failed? That\u0027s not something you care to reschedule on?","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":308,"context_line":"        if \u0027data\u0027 in connection_info:"},{"line_number":309,"context_line":"            mode \u003d connection_info[\u0027data\u0027].get(\u0027access_mode\u0027, \u0027rw\u0027)"},{"line_number":310,"context_line":"        if volume[\u0027attach_status\u0027] \u003d\u003d \"detached\":"},{"line_number":311,"context_line":"            # NOTE(mriedem): save our current state so connection_info is in"},{"line_number":312,"context_line":"            # the database before the volume status goes to \u0027in-use\u0027 because"},{"line_number":313,"context_line":"            # after that we can detach and connection_info is required for"},{"line_number":314,"context_line":"            # detach."},{"line_number":315,"context_line":"            self.save()"},{"line_number":316,"context_line":"            try:"},{"line_number":317,"context_line":"                volume_api.attach(context, volume_id, instance.uuid,"},{"line_number":318,"context_line":"                                  self[\u0027mount_device\u0027], mode\u003dmode)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_1da4c655","line":315,"range":{"start_line":311,"start_character":12,"end_line":315,"end_character":23},"updated":"2016-10-04 16:55:37.000000000","message":"So we might have a problem cleaning up volumes that were created (from blank/image/local) if we fail above before we actually save the bdm.volume_id in the database. See how _cleanup_volumes in the compute manager relies on this and if we don\u0027t have it set before we fail and then cleanup before rescheduling, we could be orphaning BDMs.","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce712a8583019adbf556fb09b21834b065d06bae","unresolved":false,"context_lines":[{"line_number":316,"context_line":"            try:"},{"line_number":317,"context_line":"                volume_api.attach(context, volume_id, instance.uuid,"},{"line_number":318,"context_line":"                                  self[\u0027mount_device\u0027], mode\u003dmode)"},{"line_number":319,"context_line":"            except Exception:"},{"line_number":320,"context_line":"                with excutils.save_and_reraise_exception():"},{"line_number":321,"context_line":"                    if do_driver_attach:"},{"line_number":322,"context_line":"                        try:"}],"source_content_type":"text/x-python","patch_set":10,"id":"1a95cdbc_1db5a6cc","line":319,"updated":"2016-10-04 16:55:37.000000000","message":"ditto","commit_id":"6b96cd2983fb310fe28f34e7b0867ed5f1188e7e"}]}
