)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     dengzhaosen \u003cdengzhaosen@inspur.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2020-10-21 10:22:56 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add ensure-volume-attachment-successful.rst spec"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"if the first volume attached too slowly, and at the same time attaching"},{"line_number":10,"context_line":"another volume, the nova-api will send the RPC call message to nova-cpu,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f65232a_94230406","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":48},"updated":"2020-10-21 02:54:39.000000000","message":"You can say \"Add instance_state to ensure volume attachment successful\" directly.","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add ensure-volume-attachment-successful.rst spec"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"if the first volume attached too slowly, and at the same time attaching"},{"line_number":10,"context_line":"another volume, the nova-api will send the RPC call message to nova-cpu,"},{"line_number":11,"context_line":"however the attach_volume function in manager.py is taking an instance.uuid"},{"line_number":12,"context_line":"lock for the first volume, and reserve_block_device_name function in"},{"line_number":13,"context_line":"manager.py will wait the first volume attached completed to take the"},{"line_number":14,"context_line":"instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":15,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Related-Bug: #1897424"},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f65232a_1466d452","line":15,"range":{"start_line":9,"start_character":0,"end_line":15,"end_character":73},"updated":"2020-10-21 02:54:39.000000000","message":"This is can be said in the \"Problem Description\" section, and use the blueprint proposes instead.\n\nThis blueprint proposes to add task states to void attaching volumes continuous fail. And which will prevent the user to attach another volume when the previous volume not attaching completely.","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":14,"context_line":"instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":15,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Related-Bug: #1897424"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I7523f994f5b393e056ae9820927159d548dbbdba"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f65232a_d4729c11","line":17,"range":{"start_line":17,"start_character":0,"end_line":17,"end_character":21},"updated":"2020-10-21 02:54:39.000000000","message":"This bug you can move this tag to the spec, put it in the \"Reference\" section.","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":15,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Related-Bug: #1897424"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: I7523f994f5b393e056ae9820927159d548dbbdba"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f65232a_7482a8ca","line":18,"updated":"2020-10-21 02:54:39.000000000","message":"Add the releated bp link, such as:\nPart of blueprint ensure-volume-attachment-successful","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"}],"specs/wallaby/approved/ensure-volume-attachment-successful.rst":[{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/ensure-volume-attachment-successful"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This blueprint proposes to add task state to void attaching volumes continuous"},{"line_number":14,"context_line":"fail. And which will prevent the user to attach another volume when the"},{"line_number":15,"context_line":"previous volume not attaching completely."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_b4544056","line":13,"range":{"start_line":13,"start_character":36,"end_line":13,"end_character":41},"updated":"2020-10-21 02:54:39.000000000","message":"s/state/states/, from https://review.opendev.org/#/c/754258/7/nova/compute/task_states.py you will add \"ATTACHING\" and \"DETACHING\" to task_states.","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":20,"context_line":"If the user want to attach volumes continuously, there will be a problem when"},{"line_number":21,"context_line":"the first volume attached too slowly."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova-api will send the RPC call message to"},{"line_number":25,"context_line":"nova-cpu, however the attach_volume function in manager.py [1]_ is taking"},{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_d44bbcad","line":23,"updated":"2020-10-21 02:54:39.000000000","message":"Ah, the commit message already exist in this section.","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the first volume attached too slowly."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova-api will send the RPC call message to"},{"line_number":25,"context_line":"nova-cpu, however the attach_volume function in manager.py [1]_ is taking"},{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"},{"line_number":27,"context_line":"function in manager.py[1] will wait the first volume attached completed to take"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_54d5ecb8","line":24,"range":{"start_line":24,"start_character":30,"end_line":24,"end_character":38},"updated":"2020-10-21 02:54:39.000000000","message":"nova API","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova-api will send the RPC call message to"},{"line_number":25,"context_line":"nova-cpu, however the attach_volume function in manager.py [1]_ is taking"},{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"},{"line_number":27,"context_line":"function in manager.py[1] will wait the first volume attached completed to take"},{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_14cb741e","line":25,"range":{"start_line":25,"start_character":0,"end_line":25,"end_character":8},"updated":"2020-10-21 02:54:39.000000000","message":"change this to \"nova compute\"","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova-api will send the RPC call message to"},{"line_number":25,"context_line":"nova-cpu, however the attach_volume function in manager.py [1]_ is taking"},{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"},{"line_number":27,"context_line":"function in manager.py[1] will wait the first volume attached completed to take"},{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_b4d9e0f5","line":25,"range":{"start_line":25,"start_character":22,"end_line":25,"end_character":35},"updated":"2020-10-21 02:54:39.000000000","message":"s/attach_volume/``attach_volume``","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova-api will send the RPC call message to"},{"line_number":25,"context_line":"nova-cpu, however the attach_volume function in manager.py [1]_ is taking"},{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"},{"line_number":27,"context_line":"function in manager.py[1] will wait the first volume attached completed to take"},{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_94d664c3","line":26,"range":{"start_line":26,"start_character":3,"end_line":26,"end_character":16},"updated":"2020-10-21 02:54:39.000000000","message":"s/instance.uuid/``instance.uuid``","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova-api will send the RPC call message to"},{"line_number":25,"context_line":"nova-cpu, however the attach_volume function in manager.py [1]_ is taking"},{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"},{"line_number":27,"context_line":"function in manager.py[1] will wait the first volume attached completed to take"},{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_f4e358a3","line":26,"range":{"start_line":26,"start_character":48,"end_line":26,"end_character":73},"updated":"2020-10-21 02:54:39.000000000","message":"s/reserve_block_device_name/``reserve_block_device_name``/","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":25,"context_line":"nova-cpu, however the attach_volume function in manager.py [1]_ is taking"},{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"},{"line_number":27,"context_line":"function in manager.py[1] will wait the first volume attached completed to take"},{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The nova-cpu does not know the nova-api has excepted caused by timeout, and"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_74e9087f","line":28,"range":{"start_line":28,"start_character":4,"end_line":28,"end_character":17},"updated":"2020-10-21 02:54:39.000000000","message":"ditto","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":26,"context_line":"an instance.uuid lock for the first volume, and reserve_block_device_name"},{"line_number":27,"context_line":"function in manager.py[1] will wait the first volume attached completed to take"},{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The nova-cpu does not know the nova-api has excepted caused by timeout, and"},{"line_number":32,"context_line":"still to create block_device_mapping after the first volume attached"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_54ee8c88","line":29,"range":{"start_line":29,"start_character":48,"end_line":29,"end_character":56},"updated":"2020-10-21 02:54:39.000000000","message":"ditto","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The nova-cpu does not know the nova-api has excepted caused by timeout, and"},{"line_number":32,"context_line":"still to create block_device_mapping after the first volume attached"},{"line_number":33,"context_line":"completely. And the database will has a record for the second volume, though"},{"line_number":34,"context_line":"the volume is not attached to this instance."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_94ff8433","line":31,"range":{"start_line":31,"start_character":31,"end_line":31,"end_character":39},"updated":"2020-10-21 02:54:39.000000000","message":"ditto","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The nova-cpu does not know the nova-api has excepted caused by timeout, and"},{"line_number":32,"context_line":"still to create block_device_mapping after the first volume attached"},{"line_number":33,"context_line":"completely. And the database will has a record for the second volume, though"},{"line_number":34,"context_line":"the volume is not attached to this instance."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_b402803d","line":31,"range":{"start_line":31,"start_character":4,"end_line":31,"end_character":12},"updated":"2020-10-21 02:54:39.000000000","message":"ditto","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":28,"context_line":"the instance.uuid lock to create block_device_mapping. And if storage backend"},{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The nova-cpu does not know the nova-api has excepted caused by timeout, and"},{"line_number":32,"context_line":"still to create block_device_mapping after the first volume attached"},{"line_number":33,"context_line":"completely. And the database will has a record for the second volume, though"},{"line_number":34,"context_line":"the volume is not attached to this instance."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_f4fcf83f","line":31,"range":{"start_line":31,"start_character":40,"end_line":31,"end_character":44},"updated":"2020-10-21 02:54:39.000000000","message":"has an ...","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":29,"context_line":"is dealt with attaching slowly, the RPC call in nova-api will be timeout."},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"The nova-cpu does not know the nova-api has excepted caused by timeout, and"},{"line_number":32,"context_line":"still to create block_device_mapping after the first volume attached"},{"line_number":33,"context_line":"completely. And the database will has a record for the second volume, though"},{"line_number":34,"context_line":"the volume is not attached to this instance."},{"line_number":35,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_d4f9fc4d","line":32,"range":{"start_line":32,"start_character":16,"end_line":32,"end_character":36},"updated":"2020-10-21 02:54:39.000000000","message":"s/block_device_mapping/``block_device_mapping``","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":36,"context_line":"Use Cases"},{"line_number":37,"context_line":"---------"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"As an operator, I wants to attach more than one volumes, it will be useful"},{"line_number":40,"context_line":"to avoid errors during attaching volumes."},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"Proposed change"},{"line_number":43,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_54a32c50","line":40,"range":{"start_line":39,"start_character":57,"end_line":40,"end_character":41},"updated":"2020-10-21 02:54:39.000000000","message":"I would like to say \"..., and hope to increase the success rate of multiple volume mounting to avoid the failure of attaching volumes due to timeout\"","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":42,"context_line":"Proposed change"},{"line_number":43,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Define ATTACHING and DETACHING in fields.py and task_state.py"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Check the task state is none or not, if the task state is not none, there"},{"line_number":48,"context_line":"will be not allowed to attach and detach the volume and return the HTTP"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_9484a4b3","line":45,"range":{"start_line":45,"start_character":21,"end_line":45,"end_character":30},"updated":"2020-10-21 02:54:39.000000000","message":"``ATTACHING``","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":42,"context_line":"Proposed change"},{"line_number":43,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Define ATTACHING and DETACHING in fields.py and task_state.py"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Check the task state is none or not, if the task state is not none, there"},{"line_number":48,"context_line":"will be not allowed to attach and detach the volume and return the HTTP"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_b48720b7","line":45,"range":{"start_line":45,"start_character":7,"end_line":45,"end_character":16},"updated":"2020-10-21 02:54:39.000000000","message":"``ATTACHING``","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":45,"context_line":"Define ATTACHING and DETACHING in fields.py and task_state.py"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Check the task state is none or not, if the task state is not none, there"},{"line_number":48,"context_line":"will be not allowed to attach and detach the volume and return the HTTP"},{"line_number":49,"context_line":"conflict."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Save ATTACHING to the task state before creating block_device_mapping"},{"line_number":52,"context_line":"and save the task state to none when exception occurs in _attach_volume"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_d48e1ccf","line":49,"range":{"start_line":48,"start_character":67,"end_line":49,"end_character":8},"updated":"2020-10-21 02:54:39.000000000","message":"return 409 (HTTP conflict) code.","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":48,"context_line":"will be not allowed to attach and detach the volume and return the HTTP"},{"line_number":49,"context_line":"conflict."},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Save ATTACHING to the task state before creating block_device_mapping"},{"line_number":52,"context_line":"and save the task state to none when exception occurs in _attach_volume"},{"line_number":53,"context_line":"function in nova-api."},{"line_number":54,"context_line":""}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_34bdd068","line":51,"range":{"start_line":51,"start_character":5,"end_line":51,"end_character":14},"updated":"2020-10-21 02:54:39.000000000","message":"``ATTACHING``","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Save ATTACHING to the task state before creating block_device_mapping"},{"line_number":52,"context_line":"and save the task state to none when exception occurs in _attach_volume"},{"line_number":53,"context_line":"function in nova-api."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Save the DETACHING to the task state and save the task state to none"},{"line_number":56,"context_line":"when exception occurs in detach_volume function in nova-api."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_14c254ea","line":53,"range":{"start_line":53,"start_character":12,"end_line":53,"end_character":20},"updated":"2020-10-21 02:54:39.000000000","message":"nova API","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":52,"context_line":"and save the task state to none when exception occurs in _attach_volume"},{"line_number":53,"context_line":"function in nova-api."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Save the DETACHING to the task state and save the task state to none"},{"line_number":56,"context_line":"when exception occurs in detach_volume function in nova-api."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"Save the task state to None when the attaching process is over in nova-cpu."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_f4aa3817","line":55,"range":{"start_line":55,"start_character":9,"end_line":55,"end_character":18},"updated":"2020-10-21 02:54:39.000000000","message":"``DETACHING``","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":66,"context_line":"Alternatives"},{"line_number":67,"context_line":"------------"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"We could always create the bdm in the nova-api and update the device once"},{"line_number":70,"context_line":"attached on the compute. This is a good method to avoid the problem as the"},{"line_number":71,"context_line":"above mentioned, but this method cannot guarantee to get the right device name"},{"line_number":72,"context_line":"very well."}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_1467f427","line":69,"updated":"2020-10-21 02:54:39.000000000","message":"Yes, this way may get the inconsistent device name in server and db","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"bccad91edabc594a2e6ec686018475540510ed15","unresolved":false,"context_lines":[{"line_number":147,"context_line":""},{"line_number":148,"context_line":"References"},{"line_number":149,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":".. [1] https://github.com/openstack/nova/blob/master/nova/compute/manager.py"},{"line_number":152,"context_line":".. [2] https://review.opendev.org/#/c/754258/"},{"line_number":153,"context_line":".. [3] https://review.opendev.org/#/c/758918/"}],"source_content_type":"text/x-rst","patch_set":4,"id":"3f65232a_746c6808","line":150,"updated":"2020-10-21 02:54:39.000000000","message":"your can add the bug link here, and the reviewer can get more details from the bug 1897424.","commit_id":"6aa084aede9e8d7e562a0393d67cf34ebca957e7"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/ensure-volume-attachment-successful"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This blueprint proposes to add task states to void attaching volumes"},{"line_number":14,"context_line":"continuous fail. And which will prevent the user to attach another volume when"},{"line_number":15,"context_line":"the previous volume not attaching completely."},{"line_number":16,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_1e55111e","line":13,"range":{"start_line":13,"start_character":46,"end_line":13,"end_character":50},"updated":"2020-11-02 14:24:03.000000000","message":"avoid","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/ensure-volume-attachment-successful"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This blueprint proposes to add task states to void attaching volumes"},{"line_number":14,"context_line":"continuous fail. And which will prevent the user to attach another volume when"},{"line_number":15,"context_line":"the previous volume not attaching completely."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Problem description"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_fe2495c8","line":14,"range":{"start_line":13,"start_character":51,"end_line":14,"end_character":15},"updated":"2020-11-02 14:24:03.000000000","message":"failures when attaching multiple volumes to an instance simultaneously with a slow volume backend.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/ensure-volume-attachment-successful"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This blueprint proposes to add task states to void attaching volumes"},{"line_number":14,"context_line":"continuous fail. And which will prevent the user to attach another volume when"},{"line_number":15,"context_line":"the previous volume not attaching completely."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Problem description"},{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_7e1a457d","line":15,"range":{"start_line":14,"start_character":17,"end_line":15,"end_character":45},"updated":"2020-11-02 14:24:03.000000000","message":"I\u0027d discard this.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":17,"context_line":"Problem description"},{"line_number":18,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"If the user want to attach volumes continuously, there will be a problem when"},{"line_number":21,"context_line":"the first volume attached too slowly."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova API will send the RPC call message to"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_8128a686","line":21,"range":{"start_line":20,"start_character":49,"end_line":21,"end_character":37},"updated":"2020-11-02 14:24:03.000000000","message":"Well there\u0027s more to it than just this.\n\nYes the initial request taking \u003e1800 seconds will cause subsequent requests to timeout in reserve_block_device_name. There\u0027s an additional case when using the libvirt driver and os-brick where multiple requests against multiple instances can potentially cause the same timeout even with a faster backend given we take two locks per attach, one against the instance.uuid and another against connect_volume.\n\nThat said both cases rely on all of this taking \u003e1800 seconds and I\u0027m just not sure how valid this is. Surely if attachments were taking \u003e10 seconds per host that would be an issue with that storage env and/or cinder backend?","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":20,"context_line":"If the user want to attach volumes continuously, there will be a problem when"},{"line_number":21,"context_line":"the first volume attached too slowly."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova API will send the RPC call message to"},{"line_number":25,"context_line":"nova compute, however the ``attach_volume`` function [1]_ in manager.py is"},{"line_number":26,"context_line":"taking an ``instance.uuid`` lock for the first volume, and"},{"line_number":27,"context_line":"``reserve_block_device_name`` function in manager.py[1] will wait the first"},{"line_number":28,"context_line":"volume attached completed to take the ``instance.uuid`` lock to create"},{"line_number":29,"context_line":"``block_device_mapping``. And if storage backend is dealt with attaching"},{"line_number":30,"context_line":"slowly, the RPC call in nova API will be timeout."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"The nova compute does not know the nova API has an exception caused by"},{"line_number":33,"context_line":"timeout, and still to create ``block_device_mapping`` after the first volume"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_fef93580","line":30,"range":{"start_line":23,"start_character":0,"end_line":30,"end_character":49},"updated":"2020-11-02 14:24:03.000000000","message":"I\u0027d prefer if we could turn this paragraph into a sequence diagram using seqdiag.\n\nhttp://blockdiag.com/en/seqdiag/sphinxcontrib.html\n\nThere are plenty examples in tree:\n\nhttp://codesearch.openstack.org/?q\u003dseqdiag\u0026i\u003dnope\u0026files\u003d\u0026repos\u003dopenstack/nova-specs\n\nI might try to do this in a dev reference doc today.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"83d37e0bea101f55a1941c893d4578c786b05b43","unresolved":false,"context_lines":[{"line_number":27,"context_line":"``reserve_block_device_name`` function in manager.py[1] will wait the first"},{"line_number":28,"context_line":"volume attached completed to take the ``instance.uuid`` lock to create"},{"line_number":29,"context_line":"``block_device_mapping``. And if storage backend is dealt with attaching"},{"line_number":30,"context_line":"slowly, the RPC call in nova API will be timeout."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"The nova compute does not know the nova API has an exception caused by"},{"line_number":33,"context_line":"timeout, and still to create ``block_device_mapping`` after the first volume"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f65232a_f1f8384a","line":30,"range":{"start_line":30,"start_character":7,"end_line":30,"end_character":49},"updated":"2020-10-27 18:29:30.000000000","message":"is this a case weher we want to use the long_rpc timeout instead.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":26458,"name":"Brin Zhang","email":"zhangbailin@inspur.com","username":"zhangbailin"},"change_message_id":"4b42396e1141b193f4b291fce0bac79d8d9d69c5","unresolved":false,"context_lines":[{"line_number":20,"context_line":"If the user want to attach volumes continuously, there will be a problem when"},{"line_number":21,"context_line":"the first volume attached too slowly."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova API will send the RPC call message to"},{"line_number":25,"context_line":"nova compute, however the ``attach_volume`` function [1]_ in manager.py is"},{"line_number":26,"context_line":"taking an ``instance.uuid`` lock for the first volume, and"},{"line_number":27,"context_line":"``reserve_block_device_name`` function in manager.py[1] will wait the first"},{"line_number":28,"context_line":"volume attached completed to take the ``instance.uuid`` lock to create"},{"line_number":29,"context_line":"``block_device_mapping``. And if storage backend is dealt with attaching"},{"line_number":30,"context_line":"slowly, the RPC call in nova API will be timeout."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"The nova compute does not know the nova API has an exception caused by"},{"line_number":33,"context_line":"timeout, and still to create ``block_device_mapping`` after the first volume"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_3a18d073","line":30,"range":{"start_line":23,"start_character":0,"end_line":30,"end_character":49},"in_reply_to":"1f621f24_fef93580","updated":"2020-11-03 01:08:23.000000000","message":"\u003e I\u0027d prefer if we could turn this paragraph into a sequence diagram\n \u003e using seqdiag.\n \u003e \n \u003e http://blockdiag.com/en/seqdiag/sphinxcontrib.html\n \u003e \n\nThis is a case for using sequence diagram.\n\nCode in spec:https://opendev.org/openstack/nova-specs/src/branch/master/specs/stein/approved/reshape-provider-tree.rst\nShow page:https://specs.openstack.org/openstack/nova-specs/specs/stein/approved/reshape-provider-tree.html","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"8b95d0eae090ff81a90656f69d4ff0e1f9b57c15","unresolved":false,"context_lines":[{"line_number":20,"context_line":"If the user want to attach volumes continuously, there will be a problem when"},{"line_number":21,"context_line":"the first volume attached too slowly."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Because if the first volume attached too slowly, and at the same time"},{"line_number":24,"context_line":"attaching another volume, the nova API will send the RPC call message to"},{"line_number":25,"context_line":"nova compute, however the ``attach_volume`` function [1]_ in manager.py is"},{"line_number":26,"context_line":"taking an ``instance.uuid`` lock for the first volume, and"},{"line_number":27,"context_line":"``reserve_block_device_name`` function in manager.py[1] will wait the first"},{"line_number":28,"context_line":"volume attached completed to take the ``instance.uuid`` lock to create"},{"line_number":29,"context_line":"``block_device_mapping``. And if storage backend is dealt with attaching"},{"line_number":30,"context_line":"slowly, the RPC call in nova API will be timeout."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"The nova compute does not know the nova API has an exception caused by"},{"line_number":33,"context_line":"timeout, and still to create ``block_device_mapping`` after the first volume"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_9531fc0e","line":30,"range":{"start_line":23,"start_character":0,"end_line":30,"end_character":49},"in_reply_to":"1f621f24_fef93580","updated":"2020-11-03 21:35:39.000000000","message":"https://review.opendev.org/#/c/760971/1/doc/source/reference/attach_volume.diag - I started doing this for the current implementation here.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":27,"context_line":"``reserve_block_device_name`` function in manager.py[1] will wait the first"},{"line_number":28,"context_line":"volume attached completed to take the ``instance.uuid`` lock to create"},{"line_number":29,"context_line":"``block_device_mapping``. And if storage backend is dealt with attaching"},{"line_number":30,"context_line":"slowly, the RPC call in nova API will be timeout."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"The nova compute does not know the nova API has an exception caused by"},{"line_number":33,"context_line":"timeout, and still to create ``block_device_mapping`` after the first volume"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_3ef1edce","line":30,"range":{"start_line":30,"start_character":7,"end_line":30,"end_character":49},"in_reply_to":"3f65232a_f1f8384a","updated":"2020-11-02 14:24:03.000000000","message":"reserve_block_device_name already uses long_rpc_timeout, attach_volume is a cast thus the potential overlap issue:\n\nhttps://github.com/openstack/nova/blob/7dcc4cfea7da2ef1163e0a65618cb784f5159c6d/nova/compute/rpcapi.py#L1284-L1297","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"83d37e0bea101f55a1941c893d4578c786b05b43","unresolved":false,"context_lines":[{"line_number":45,"context_line":"Proposed change"},{"line_number":46,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"Define ``ATTACHING`` and ``DETACHING`` in fields.py and task_state.py"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"Check the task state is none or not, if the task state is not none, there"},{"line_number":51,"context_line":"will be not allowed to attach and detach the volume and return 409"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f65232a_5195ace3","line":48,"range":{"start_line":48,"start_character":0,"end_line":48,"end_character":69},"updated":"2020-10-27 18:29:30.000000000","message":"if we were to do this we likely would also want to sue it for attaching and detaching interfaces.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"Define ``ATTACHING`` and ``DETACHING`` in fields.py and task_state.py"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"Check the task state is none or not, if the task state is not none, there"},{"line_number":51,"context_line":"will be not allowed to attach and detach the volume and return 409"},{"line_number":52,"context_line":"(HTTP conflict) code."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"Save ``ATTACHING`` to the task state before creating ``block_device_mapping``"},{"line_number":55,"context_line":"and save the task state to **None** when exception occurs in"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_bed17dd0","line":52,"range":{"start_line":50,"start_character":0,"end_line":52,"end_character":21},"updated":"2020-11-02 14:24:03.000000000","message":"I think this would require a microversion as this fundamentally changes the semantics of the os-volume_attachments API as it would no longer allow callers to essentially queue these requests in the API itself.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":31827,"name":"Jorhson Deng","email":"jorhson_deng@163.com","username":"dengzhaosen"},"change_message_id":"af2b08a6676a431dd3348bbc6971bafcbe42f0c3","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"Define ``ATTACHING`` and ``DETACHING`` in fields.py and task_state.py"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"Check the task state is none or not, if the task state is not none, there"},{"line_number":51,"context_line":"will be not allowed to attach and detach the volume and return 409"},{"line_number":52,"context_line":"(HTTP conflict) code."},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"Save ``ATTACHING`` to the task state before creating ``block_device_mapping``"},{"line_number":55,"context_line":"and save the task state to **None** when exception occurs in"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_1afa3474","line":52,"range":{"start_line":50,"start_character":0,"end_line":52,"end_character":21},"in_reply_to":"1f621f24_bed17dd0","updated":"2020-11-03 02:15:32.000000000","message":"Yeah, but I wonder how to add a microversion in this. I want to reuse the current Exception in https://github.com/openstack/nova/blob/7dcc4cfea7da2ef1163e0a65618cb784f5159c6d/nova/compute/api.py#L4734\nI want to add a task state check to return bad request HTTP and do this check in another commit https://review.opendev.org/#/c/758918/","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"83d37e0bea101f55a1941c893d4578c786b05b43","unresolved":false,"context_lines":[{"line_number":69,"context_line":"Alternatives"},{"line_number":70,"context_line":"------------"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"We could always create the ``block_device_mapping`` in the nova API and update"},{"line_number":73,"context_line":"the device once attached on the compute. This is a good method to avoid the"},{"line_number":74,"context_line":"problem as the above mentioned, but this method cannot guarantee to get the"},{"line_number":75,"context_line":"right device name very well."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"Data model impact"},{"line_number":78,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"3f65232a_b1fec035","line":75,"range":{"start_line":72,"start_character":1,"end_line":75,"end_character":28},"updated":"2020-10-27 18:29:30.000000000","message":"we could also jsut put a lock in the driver to serialse the attachement right?","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":31827,"name":"Jorhson Deng","email":"jorhson_deng@163.com","username":"dengzhaosen"},"change_message_id":"70e4ad6745bfb68790924cbd6fc9356f23c5a197","unresolved":false,"context_lines":[{"line_number":69,"context_line":"Alternatives"},{"line_number":70,"context_line":"------------"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"We could always create the ``block_device_mapping`` in the nova API and update"},{"line_number":73,"context_line":"the device once attached on the compute. This is a good method to avoid the"},{"line_number":74,"context_line":"problem as the above mentioned, but this method cannot guarantee to get the"},{"line_number":75,"context_line":"right device name very well."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"Data model impact"},{"line_number":78,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_4fa4deb9","line":75,"range":{"start_line":72,"start_character":1,"end_line":75,"end_character":28},"in_reply_to":"1f621f24_798fe822","updated":"2020-11-04 01:15:13.000000000","message":"Yes, if in this way, it\u0027s also can solve this problem. I also think that we should better add the task states in these options to avoid conflicts with others options.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"8b95d0eae090ff81a90656f69d4ff0e1f9b57c15","unresolved":false,"context_lines":[{"line_number":69,"context_line":"Alternatives"},{"line_number":70,"context_line":"------------"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"We could always create the ``block_device_mapping`` in the nova API and update"},{"line_number":73,"context_line":"the device once attached on the compute. This is a good method to avoid the"},{"line_number":74,"context_line":"problem as the above mentioned, but this method cannot guarantee to get the"},{"line_number":75,"context_line":"right device name very well."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"Data model impact"},{"line_number":78,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_798fe822","line":75,"range":{"start_line":72,"start_character":1,"end_line":75,"end_character":28},"in_reply_to":"1f621f24_7a6368b2","updated":"2020-11-03 21:35:39.000000000","message":"I\u0027d honestly drop device_name from the response to the initial os-volume_attachments call in a new microversion [1] and have it optionally populated later asynchronously during the actual attach by the virt driver.\n\n[1] https://docs.openstack.org/api-ref/compute/?expanded\u003dattach-a-volume-to-an-instance-detail#id190","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":31827,"name":"Jorhson Deng","email":"jorhson_deng@163.com","username":"dengzhaosen"},"change_message_id":"af2b08a6676a431dd3348bbc6971bafcbe42f0c3","unresolved":false,"context_lines":[{"line_number":69,"context_line":"Alternatives"},{"line_number":70,"context_line":"------------"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"We could always create the ``block_device_mapping`` in the nova API and update"},{"line_number":73,"context_line":"the device once attached on the compute. This is a good method to avoid the"},{"line_number":74,"context_line":"problem as the above mentioned, but this method cannot guarantee to get the"},{"line_number":75,"context_line":"right device name very well."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"Data model impact"},{"line_number":78,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_7a6368b2","line":75,"range":{"start_line":72,"start_character":1,"end_line":75,"end_character":28},"in_reply_to":"1f621f24_9e49218d","updated":"2020-11-03 02:15:32.000000000","message":"Yeah，remove the reserve_block_device_name call and create the  BlockDeviceMapping object in the API would be a bettter method to solve the problem. The difficult point is how to get the right device_name in this method. https://github.com/openstack/nova/blob/7dcc4cfea7da2ef1163e0a65618cb784f5159c6d/nova/compute/api.py#L4561-L4584\nIn current code, this is not support to assign the device_name.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"0cb682f5ecd3b640f2f23775f789cf2903d27e7c","unresolved":false,"context_lines":[{"line_number":69,"context_line":"Alternatives"},{"line_number":70,"context_line":"------------"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"We could always create the ``block_device_mapping`` in the nova API and update"},{"line_number":73,"context_line":"the device once attached on the compute. This is a good method to avoid the"},{"line_number":74,"context_line":"problem as the above mentioned, but this method cannot guarantee to get the"},{"line_number":75,"context_line":"right device name very well."},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"Data model impact"},{"line_number":78,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"1f621f24_9e49218d","line":75,"range":{"start_line":72,"start_character":1,"end_line":75,"end_character":28},"in_reply_to":"3f65232a_b1fec035","updated":"2020-11-02 14:24:03.000000000","message":"We already have two levels of locks on the compute, one against the instance.uuid and another when using the libvirt driver against a host wide connect_volume lock.\n\nBy removing the reserve_block_device_name call we\u0027d always create the BlockDeviceMapping object in the API, cast to the compute, return in the API and let these existing compute locks queue the requests.\n\nFWIW I\u0027m more in favour of this approach than the task_state changes as they change the external behaviour of the API too much IMHO.","commit_id":"75e70ab62215c0195b06312ca70609df9c9edf8e"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"4995750caf84435cc57e9888c06733ec1312b4cb","unresolved":false,"context_lines":[{"line_number":52,"context_line":"Proposed change"},{"line_number":53,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Define ``ATTACHING`` and ``DETACHING`` in fields.py and task_state.py"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Check the task state is none or not, if the task state is not none, there"},{"line_number":58,"context_line":"will be not allowed to attach and detach the volume and return 400"},{"line_number":59,"context_line":"(Bad Request) code."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Save ``ATTACHING`` to the task state before creating ``block_device_mapping``"},{"line_number":62,"context_line":"and save the task state to **None** when exception occurs in"},{"line_number":63,"context_line":"``_attach_volume`` function in nova API."},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"Save the ``DETACHING`` to the task state and save the task state to **None**"},{"line_number":66,"context_line":"when exception occurs in ``detach_volume`` function in nova API."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Save the task state to **None** when the attaching process is over in"},{"line_number":69,"context_line":"nova compute, and call the decorator function when the exception is raised."},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"Save the task state to **None** when the detaching process is over in"},{"line_number":72,"context_line":"nova compute, and call the decorator function when the exception is raised."},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Code implementation can be found in `review 754258`_ and `review 758918`_"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"The overall flow is as follows."},{"line_number":77,"context_line":""}],"source_content_type":"text/x-rst","patch_set":11,"id":"1f621f24_29b047dd","line":74,"range":{"start_line":55,"start_character":0,"end_line":74,"end_character":73},"updated":"2020-11-09 14:35:17.000000000","message":"I\u0027m still against this without a microversion FWIW, it\u0027s going to change the current queuing semantics of the API and is something users should opt-in to at least.","commit_id":"e1a4c12bc0ab6477be063cb754f2a70d0b0ca583"},{"author":{"_account_id":10135,"name":"Lee Yarwood","display_name":"Lee Yarwood","email":"lyarwood@redhat.com","username":"lyarwood"},"change_message_id":"4995750caf84435cc57e9888c06733ec1312b4cb","unresolved":false,"context_lines":[{"line_number":77,"context_line":""},{"line_number":78,"context_line":".. seqdiag::"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    seqdiag {"},{"line_number":81,"context_line":"        user; nova-api; nova-conductor; nova-compute; virt-driver; os-brick; cinder-api;"},{"line_number":82,"context_line":"        edge_length \u003d 300;"},{"line_number":83,"context_line":"        span_height \u003d 16;"},{"line_number":84,"context_line":"        activation \u003d none;"},{"line_number":85,"context_line":"        default_note_color \u003d white;"},{"line_number":86,"context_line":"        user -\u003e nova-api [label \u003d \"POST /servers/{server_id}/os-volume_attachments\"];"},{"line_number":87,"context_line":"        nova-api -\u003e nova-compute [label \u003d \"RPC call reservice_block_device_name\"];"},{"line_number":88,"context_line":"        nova-compute -\u003e nova-compute [label \u003d \"instance.uuid lock\"];"},{"line_number":89,"context_line":"        nova-compute -\u003e nova-conductor [label \u003d \"Create BlockDeviceMapping\"];"},{"line_number":90,"context_line":"        nova-compute \u003c- nova-conductor [label \u003d \"Return BlockDeviceMapping\"];"},{"line_number":91,"context_line":"        nova-compute -\u003e virt-driver [label \u003d \"get_device_name_for_instance\"];"},{"line_number":92,"context_line":"        nova-compute \u003c- virt-driver [label \u003d \"Return device name\"];"},{"line_number":93,"context_line":"        nova-compute -\u003e nova-compute [label \u003d \"instance.uuid unlock\"];"},{"line_number":94,"context_line":"        nova-api \u003c- nova-compute [label \u003d \"Return BlockDeviceMapping\"];"},{"line_number":95,"context_line":"        nova-api -\u003e cinder-api [label \u003d \"POST /v3/{project_id}/attachments\"];"},{"line_number":96,"context_line":"        nova-api \u003c- cinder-api [label \u003d \"Return HTTP 200 (without connection_info)\"];"},{"line_number":97,"context_line":"        nova-api -\u003e nova-compute [label \u003d \"RPC cast attach_volume\"];"},{"line_number":98,"context_line":"        user \u003c-  nova-api [label \u003d \"Return HTTP 200\"];"},{"line_number":99,"context_line":"        nova-compute -\u003e nova-compute [label \u003d \"instance.uuid lock\"];"},{"line_number":100,"context_line":"        nova-compute -\u003e nova-compute [label \u003d \"cinder_backend.uuid lock\"];"},{"line_number":101,"context_line":"        nova-compute -\u003e cinder-api [label \u003d \"PUT /v3/{project_id}/attachments/{attachment_id}\"];"},{"line_number":102,"context_line":"        nova-compute \u003c- cinder-api [label \u003d \"Return HTTP 200 (includes connection_info)\"];"},{"line_number":103,"context_line":"        nova-compute -\u003e virt-driver [label \u003d \"attach_volume\"];"},{"line_number":104,"context_line":"        virt-driver -\u003e os-brick [label \u003d \"connect_volume\"];"},{"line_number":105,"context_line":"        os-brick -\u003e os-brick [label \u003d \"connect_volume lock\"];"},{"line_number":106,"context_line":"        os-brick -\u003e os-brick [label \u003d \"Volume connected\"];"},{"line_number":107,"context_line":"        os-brick -\u003e os-brick [label \u003d \"connect_volume unlock\"];"},{"line_number":108,"context_line":"        virt-driver \u003c- os-brick [label \u003d \"return connect_volume\"];"},{"line_number":109,"context_line":"        nova-compute \u003c- virt-driver;"},{"line_number":110,"context_line":"        nova-compute -\u003e nova-conductor [label \u003d \"Update BlockDeviceMapping\"];"},{"line_number":111,"context_line":"        nova-compute \u003c- nova-conductor;"},{"line_number":112,"context_line":"        nova-compute -\u003e cinder-api [label \u003d \"POST /v3/{project_id}/attachments/{attachment_id}/action (os-complete)\"];"},{"line_number":113,"context_line":"        nova-compute \u003c- cinder-api [label \u003d \"Return HTTP 200\"];"},{"line_number":114,"context_line":"        nova-compute -\u003e nova-compute [label \u003d \"cinder_backend.uuid unlock\"];"},{"line_number":115,"context_line":"        nova-compute -\u003e nova-compute [label \u003d \"instance.uuid unlock\"];"},{"line_number":116,"context_line":"    }"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"Alternatives"}],"source_content_type":"text/x-rst","patch_set":11,"id":"1f621f24_49a14394","line":116,"range":{"start_line":80,"start_character":0,"end_line":116,"end_character":5},"updated":"2020-11-09 14:35:17.000000000","message":"This should be updated to include the instance task_state changes.","commit_id":"e1a4c12bc0ab6477be063cb754f2a70d0b0ca583"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"87686b36eb70de34dbaebf04126fe8618f8100c6","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":15,"id":"2ea6acd4_5aff9008","updated":"2021-04-14 12:30:36.000000000","message":"please propose this against the specs/xena/approved directory","commit_id":"379a881883ad7d91dfd9d43f7fdc0c6a1bb9a581"}]}
