)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"14da6e6068bcfb5ebc2d3eab076cc75d95f85fad","unresolved":false,"context_lines":[{"line_number":14,"context_line":"will use its own default, which may break volume attachment if cross"},{"line_number":15,"context_line":"zone attachment is disabled."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Closes-Bug: #1620989"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ic8693c143dd61c5d61e9676e3915a3278a8af10b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9a629dbe_ef867715","line":17,"range":{"start_line":17,"start_character":13,"end_line":17,"end_character":20},"updated":"2016-11-14 09:42:56.000000000","message":"this bug is marked as a duplicate, please use original one instead","commit_id":"06323ba2c7e09777cdbe08129816342a27a86df9"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"815cee28a096c8f8f857fe61ff4b0565e430a64f","unresolved":false,"context_lines":[{"line_number":14,"context_line":"will use its own default, which may break volume attachment if cross"},{"line_number":15,"context_line":"zone attachment is disabled."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Closes-Bug: #1620989"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ic8693c143dd61c5d61e9676e3915a3278a8af10b"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3a71b18c_d9ef281b","line":17,"range":{"start_line":17,"start_character":13,"end_line":17,"end_character":20},"in_reply_to":"9a629dbe_ef867715","updated":"2016-12-12 10:36:30.000000000","message":"Done","commit_id":"06323ba2c7e09777cdbe08129816342a27a86df9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e7628d8bcd06159117893249292c517f903eecc5","unresolved":false,"context_lines":[{"line_number":14,"context_line":"is used now, is actually a different thing - it\u0027s the AZ requested by"},{"line_number":15,"context_line":"a user on creation of the instance and it will be None, if any"},{"line_number":16,"context_line":"particular AZ was chosen. In this case, Cinder will use its own"},{"line_number":17,"context_line":"default (not aligned with Nova one), which may break volume"},{"line_number":18,"context_line":"attachment, if cross zone attachment is disabled."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Closes-Bug: #1497253"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"ff0f0b1f_c036b951","line":18,"range":{"start_line":17,"start_character":37,"end_line":18,"end_character":49},"updated":"2017-05-24 16:20:23.000000000","message":"Where does this actually fail in nova during the server create flow? If the instance AZ is None, nova should be passing availability_zone\u003dNone to cinder when creating the volume, and cinder will create the volume in a default AZ, as noted in the commit message. But the volume should get created successfully, even though it might be in a different AZ from the instance.\n\nBut where does the server create flow blow up? Is it when we attach the instance to the volume, here?\n\nhttps://github.com/openstack/nova/blob/master/nova/virt/block_device.py#L368\n\nSo we create the volume successfully, but it\u0027s in the \u0027nova\u0027 AZ and when we go to attach it to the instance, that check_availability_zone check fails?","commit_id":"5525b3464c6b8296ba19f0e014f6ee9a3bd64188"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa1d2278fd5d0702bdeba04171a23b9dddc87e0b","unresolved":false,"context_lines":[{"line_number":14,"context_line":"is used now, is actually a different thing - it\u0027s the AZ requested by"},{"line_number":15,"context_line":"a user on creation of the instance and it will be None, if any"},{"line_number":16,"context_line":"particular AZ was chosen. In this case, Cinder will use its own"},{"line_number":17,"context_line":"default (not aligned with Nova one), which may break volume"},{"line_number":18,"context_line":"attachment, if cross zone attachment is disabled."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Closes-Bug: #1497253"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df140735_c6c76c45","line":18,"range":{"start_line":17,"start_character":37,"end_line":18,"end_character":49},"in_reply_to":"df140735_a6f118d0","updated":"2017-05-31 22:33:40.000000000","message":"New bug for the other issue in the API:\n\nhttps://bugs.launchpad.net/nova/+bug/1694844","commit_id":"5525b3464c6b8296ba19f0e014f6ee9a3bd64188"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"06d3c77d14d697ea9f8e84bb50677d70f7d02366","unresolved":false,"context_lines":[{"line_number":14,"context_line":"is used now, is actually a different thing - it\u0027s the AZ requested by"},{"line_number":15,"context_line":"a user on creation of the instance and it will be None, if any"},{"line_number":16,"context_line":"particular AZ was chosen. In this case, Cinder will use its own"},{"line_number":17,"context_line":"default (not aligned with Nova one), which may break volume"},{"line_number":18,"context_line":"attachment, if cross zone attachment is disabled."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Closes-Bug: #1497253"},{"line_number":21,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"df140735_a6f118d0","line":18,"range":{"start_line":17,"start_character":37,"end_line":18,"end_character":49},"in_reply_to":"ff0f0b1f_c036b951","updated":"2017-05-31 22:26:35.000000000","message":"This is not going to fix an issue in the API recreated here:\n\nhttps://review.openstack.org/#/c/467674/\n\nhttp://logs.openstack.org/74/467674/4/check/gate-tempest-dsvm-neutron-full-ubuntu-xenial/3dbd6e9/logs/screen-n-api.txt.gz#_May_26_02_41_54_584798\n\nIn that case the volume is created in cinder and passed to nova for boot from volume. The volume\u0027s availability zone defaults to \u0027nova\u0027 but since we didn\u0027t request an AZ when creating the instance and it\u0027s not on a host yet (so no host aggregate), instance.availability_zone is None, so we blow up here:\n\nhttps://github.com/openstack/nova/blob/f112dc686dadd643410575cc3487cf1632e4f689/nova/volume/cinder.py#L286","commit_id":"5525b3464c6b8296ba19f0e014f6ee9a3bd64188"}],"nova/virt/block_device.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4293b27333064d2ab34aeead12d0f67f0b2ac0b4","unresolved":false,"context_lines":[{"line_number":74,"context_line":"    # could fail the boot from volume request early with a 400 rather than"},{"line_number":75,"context_line":"    # fail to build the instance on the compute node which results in a"},{"line_number":76,"context_line":"    # NoValidHost error."},{"line_number":77,"context_line":"    return instance.availability_zone"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"class DriverBlockDevice(dict):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_59b04741","side":"PARENT","line":77,"range":{"start_line":77,"start_character":11,"end_line":77,"end_character":37},"updated":"2018-07-11 23:12:55.000000000","message":"Yeah I think this is likely fixed now due to https://review.openstack.org/#/c/446053/ in Pike because that change gets the host AZ once we\u0027ve selected a host during scheduling and sets it on the instance.availability_zone so once we get here during boot from volume, we should have the correct thing for the current host we\u0027re on.","commit_id":"c5e0f61724e8a3a084a3492a01a5a4214b397b32"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6eac5e9e4c23e375e1e5b00fa5433900dc486b09","unresolved":false,"context_lines":[{"line_number":505,"context_line":"    def attach(self, context, instance, volume_api, virt_driver,"},{"line_number":506,"context_line":"               do_driver_attach\u003dFalse, **kwargs):"},{"line_number":507,"context_line":"        volume \u003d volume_api.get(context, self.volume_id)"},{"line_number":508,"context_line":"        volume_api.check_availability_zone(context, volume,"},{"line_number":509,"context_line":"                                           instance\u003dinstance)"},{"line_number":510,"context_line":"        context \u003d context.elevated()"},{"line_number":511,"context_line":"        connector \u003d virt_driver.get_volume_connector(instance)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_50b328ed","line":508,"range":{"start_line":508,"start_character":19,"end_line":508,"end_character":42},"updated":"2018-07-12 15:08:20.000000000","message":"As a test, I removed the api db connection from the cell conductor so this method can\u0027t do the up-call to get the host aggregates, and logged the instance.host and az before calling get_instance_availability_zone:\n\nhttp://paste.openstack.org/show/725723/\n\nAnd both fields are set:\n\n972-4b14-93ad-e7b86edc3a26 service nova] [instance: 910509b9-e23a-4b40-bb42-0df7b65bb36e] Getting AZ for instance; instance.host: rocky; instance.availabilty_zone: nova\n\nAnd because of this logic:\n\ndef get_instance_availability_zone(context, instance):\n    \"\"\"Return availability zone of specified instance.\"\"\"\n    host \u003d instance.host if \u0027host\u0027 in instance else None\n    if not host:\n        # Likely hasn\u0027t reached a viable compute node yet so give back the\n        # desired availability_zone in the instance record if the boot request\n        # specified one.\n        az \u003d instance.get(\u0027availability_zone\u0027)\n        return az\n\nWe won\u0027t look at the instance.availability_zone because instance.host is not None.\n\nThen because we don\u0027t have the host AZ in the local process cache, we\u0027ll look it up which does the up-call and explodes:\n\ncache_key \u003d _make_cache_key(host)\n    cache \u003d _get_cache()\n    az \u003d cache.get(cache_key)\n    az_inst \u003d instance.get(\u0027availability_zone\u0027)\n    if az_inst is not None and az !\u003d az_inst:\n        # NOTE(sbauza): Cache is wrong, we need to invalidate it by fetching\n        # again the right AZ related to the aggregate the host belongs to.\n        # As the API is also calling this method for setting the instance\n        # AZ field, we don\u0027t need to update the instance.az field.\n        # This case can happen because the cache is populated before the\n        # instance has been assigned to the host so that it would keep the\n        # former reference which was incorrect. Instead of just taking the\n        # instance AZ information for refilling the cache, we prefer to\n        # invalidate the cache and fetch it again because there could be some\n        # corner cases where this method could be called before the instance\n        # has been assigned to the host also.\n        az \u003d None\n    if not az:\n        elevated \u003d context.elevated()\n        az \u003d get_host_availability_zone(elevated, host)","commit_id":"854488d1704931aede0b111934ac387992787a0c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4632d14fd189a8999a332e8faa01c9fe5d7db68d","unresolved":false,"context_lines":[{"line_number":505,"context_line":"    def attach(self, context, instance, volume_api, virt_driver,"},{"line_number":506,"context_line":"               do_driver_attach\u003dFalse, **kwargs):"},{"line_number":507,"context_line":"        volume \u003d volume_api.get(context, self.volume_id)"},{"line_number":508,"context_line":"        volume_api.check_availability_zone(context, volume,"},{"line_number":509,"context_line":"                                           instance\u003dinstance)"},{"line_number":510,"context_line":"        context \u003d context.elevated()"},{"line_number":511,"context_line":"        connector \u003d virt_driver.get_volume_connector(instance)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f7c97a3_d0ac1838","line":508,"range":{"start_line":508,"start_character":19,"end_line":508,"end_character":42},"in_reply_to":"5f7c97a3_50b328ed","updated":"2018-07-12 15:20:46.000000000","message":"Reported bug 1781421 for that up-call issue.","commit_id":"854488d1704931aede0b111934ac387992787a0c"}]}
