)]}'
{"nova/api/openstack/api_version_request.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":171,"context_line":"             ``GET /os-services`` when there is a transient unavailability"},{"line_number":172,"context_line":"             condition in the deployment like an infrastructure failure."},{"line_number":173,"context_line":"    * 2.70 - Allowed detaching a root volume, allowed to attach a root volume"},{"line_number":174,"context_line":"             by specify ``is_root\u003dTrue`` when attaching. These actions will"},{"line_number":175,"context_line":"             be only allowed to perform on instances in ``STOPPED``,"},{"line_number":176,"context_line":"             ``SHELVED`` and ``SHELVED_OFFLOADED`` status."},{"line_number":177,"context_line":"             Add support for including the ``boot_index`` field in"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_1e7b2c8c","line":174,"range":{"start_line":174,"start_character":16,"end_line":174,"end_character":23},"updated":"2019-02-25 17:32:51.000000000","message":"specifying","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    * 2.70 - Allowed detaching a root volume, allowed to attach a root volume"},{"line_number":174,"context_line":"             by specify ``is_root\u003dTrue`` when attaching. These actions will"},{"line_number":175,"context_line":"             be only allowed to perform on instances in ``STOPPED``,"},{"line_number":176,"context_line":"             ``SHELVED`` and ``SHELVED_OFFLOADED`` status."},{"line_number":177,"context_line":"             Add support for including the ``boot_index`` field in"},{"line_number":178,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments`` and"},{"line_number":179,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments/{volume_id}``."}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_5e6694bd","line":176,"range":{"start_line":176,"start_character":15,"end_line":176,"end_character":22},"updated":"2019-02-25 17:32:51.000000000","message":"Is this safe? If the instance is shelved but not yet offloaded, it\u0027s still on a host, but the shelved_offload_time interval could run and automatically offload the server. In that case, we could be racing with a root volume attachment request while the server is being offloaded.\n\nMaybe this is a small enough window that we don\u0027t need to worry too much about it - also the _poll_shelved_instances periodic in the compute service would change the task_state on the instance and the API shouldn\u0027t allow attaching a volume to an instance whose task_state is not None.\n\nHaving said that, the attach volume treats SHELVED_OFFLOADED special so I think we should probably just keep it simple and say you can only attach a root volume if the instance is stopped or shelved_offloaded - if the user really needs to attach the root volume and the instance is shelved, they can manually offload it with the shelveOffload server action:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003d#shelf-offload-remove-server-shelveoffload-action","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":173,"context_line":"    * 2.70 - Allowed detaching a root volume, allowed to attach a root volume"},{"line_number":174,"context_line":"             by specify ``is_root\u003dTrue`` when attaching. These actions will"},{"line_number":175,"context_line":"             be only allowed to perform on instances in ``STOPPED``,"},{"line_number":176,"context_line":"             ``SHELVED`` and ``SHELVED_OFFLOADED`` status."},{"line_number":177,"context_line":"             Add support for including the ``boot_index`` field in"},{"line_number":178,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments`` and"},{"line_number":179,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments/{volume_id}``."}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_4b0b2b8d","line":176,"range":{"start_line":176,"start_character":15,"end_line":176,"end_character":22},"in_reply_to":"9fdfeff1_5e6694bd","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":174,"context_line":"             by specify ``is_root\u003dTrue`` when attaching. These actions will"},{"line_number":175,"context_line":"             be only allowed to perform on instances in ``STOPPED``,"},{"line_number":176,"context_line":"             ``SHELVED`` and ``SHELVED_OFFLOADED`` status."},{"line_number":177,"context_line":"             Add support for including the ``boot_index`` field in"},{"line_number":178,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments`` and"},{"line_number":179,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments/{volume_id}``."},{"line_number":180,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_c155c9c3","line":177,"updated":"2019-02-25 17:32:51.000000000","message":"Wouldn\u0027t the boot_index also be in the response of POST /servers/{server_id}/os-volume_attachments?","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":174,"context_line":"             by specify ``is_root\u003dTrue`` when attaching. These actions will"},{"line_number":175,"context_line":"             be only allowed to perform on instances in ``STOPPED``,"},{"line_number":176,"context_line":"             ``SHELVED`` and ``SHELVED_OFFLOADED`` status."},{"line_number":177,"context_line":"             Add support for including the ``boot_index`` field in"},{"line_number":178,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments`` and"},{"line_number":179,"context_line":"             ``GET /servers/{server_id}/os-volume_attachments/{volume_id}``."},{"line_number":180,"context_line":"\"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_ebfbff77","line":177,"in_reply_to":"9fdfeff1_c155c9c3","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}],"nova/api/openstack/compute/deferred_delete.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fbed439b7afe241a43c6fcc426a3cf64f780c2eb","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        except exception.InstanceUnknownCell as error:"},{"line_number":43,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003derror.format_message())"},{"line_number":44,"context_line":"        except (exception.QuotaError,"},{"line_number":45,"context_line":"                exception.RootVolumeIsNotAttached) as error:"},{"line_number":46,"context_line":"            raise webob.exc.HTTPForbidden(explanation\u003derror.format_message())"},{"line_number":47,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":48,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_de5a955b","line":45,"range":{"start_line":45,"start_character":26,"end_line":45,"end_character":49},"updated":"2018-12-18 16:58:30.000000000","message":"Handling this exception belongs in the change that introduces it getting raised by nova/compute/api, which is why the API changes should go together and be separated from the nova-compute changes.","commit_id":"7b8bc57eeb071c5b238f901140fba04b43dc2409"}],"nova/api/openstack/compute/rest_api_version_history.rst":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":883,"context_line":"2.70"},{"line_number":884,"context_line":"----"},{"line_number":885,"context_line":""},{"line_number":886,"context_line":"Allowed detaching a root volume, allowed to attach a root volume by specify"},{"line_number":887,"context_line":"``is_root\u003dTrue`` when attaching. These actions will be only allowed to"},{"line_number":888,"context_line":"perform on instances in ``STOPPED``, ``SHELVED`` and ``SHELVED_OFFLOADED``"},{"line_number":889,"context_line":"status. If try to request ``START`` or ``UNSHELVE`` action on instances"}],"source_content_type":"text/x-rst","patch_set":11,"id":"9fdfeff1_de284434","line":886,"updated":"2019-02-25 17:32:51.000000000","message":"Same notes from the previous file.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":883,"context_line":"2.70"},{"line_number":884,"context_line":"----"},{"line_number":885,"context_line":""},{"line_number":886,"context_line":"Allowed detaching a root volume, allowed to attach a root volume by specify"},{"line_number":887,"context_line":"``is_root\u003dTrue`` when attaching. These actions will be only allowed to"},{"line_number":888,"context_line":"perform on instances in ``STOPPED``, ``SHELVED`` and ``SHELVED_OFFLOADED``"},{"line_number":889,"context_line":"status. If try to request ``START`` or ``UNSHELVE`` action on instances"}],"source_content_type":"text/x-rst","patch_set":11,"id":"9fdfeff1_0b368352","line":886,"in_reply_to":"9fdfeff1_de284434","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}],"nova/api/openstack/compute/schemas/volumes.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":87,"context_line":"create_volume_attachment_v249[\u0027properties\u0027][\u0027volumeAttachment\u0027]["},{"line_number":88,"context_line":"                              \u0027properties\u0027][\u0027tag\u0027] \u003d parameter_types.tag"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"# 2.70 builds on 2.49 and allowed specify whether the attachment is a"},{"line_number":91,"context_line":"# root volume or not."},{"line_number":92,"context_line":"create_volume_attachment_v270 \u003d copy.deepcopy(create_volume_attachment_v249)"},{"line_number":93,"context_line":"create_volume_attachment_v270[\u0027properties\u0027][\u0027volumeAttachment\u0027][\u0027properties\u0027]["}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_9e1e3c0a","line":90,"range":{"start_line":90,"start_character":26,"end_line":90,"end_character":41},"updated":"2019-02-25 17:32:51.000000000","message":"allows specifying","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":91,"context_line":"# root volume or not."},{"line_number":92,"context_line":"create_volume_attachment_v270 \u003d copy.deepcopy(create_volume_attachment_v249)"},{"line_number":93,"context_line":"create_volume_attachment_v270[\u0027properties\u0027][\u0027volumeAttachment\u0027][\u0027properties\u0027]["},{"line_number":94,"context_line":"    \u0027is_root\u0027] \u003d parameter_types.boolean"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"update_volume_attachment \u003d copy.deepcopy(create_volume_attachment)"},{"line_number":97,"context_line":"del update_volume_attachment[\u0027properties\u0027][\u0027volumeAttachment\u0027]["}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_eb6d4c03","line":94,"range":{"start_line":94,"start_character":5,"end_line":94,"end_character":12},"updated":"2019-02-25 17:32:51.000000000","message":"This should be in the API reference docs:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003d#attach-a-volume-to-an-instance","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":91,"context_line":"# root volume or not."},{"line_number":92,"context_line":"create_volume_attachment_v270 \u003d copy.deepcopy(create_volume_attachment_v249)"},{"line_number":93,"context_line":"create_volume_attachment_v270[\u0027properties\u0027][\u0027volumeAttachment\u0027][\u0027properties\u0027]["},{"line_number":94,"context_line":"    \u0027is_root\u0027] \u003d parameter_types.boolean"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"update_volume_attachment \u003d copy.deepcopy(create_volume_attachment)"},{"line_number":97,"context_line":"del update_volume_attachment[\u0027properties\u0027][\u0027volumeAttachment\u0027]["}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_4b19ebd4","line":94,"range":{"start_line":94,"start_character":5,"end_line":94,"end_character":12},"in_reply_to":"9fdfeff1_eb6d4c03","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}],"nova/api/openstack/compute/servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":1207,"context_line":"                \u0027start\u0027, id)"},{"line_number":1208,"context_line":"        except exception.RootVolumeIsNotAttached as e:"},{"line_number":1209,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":1210,"context_line":""},{"line_number":1211,"context_line":"    @wsgi.response(202)"},{"line_number":1212,"context_line":"    @wsgi.expected_errors((404, 409))"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_1ec1ec54","line":1209,"range":{"start_line":1209,"start_character":22,"end_line":1209,"end_character":35},"updated":"2019-02-25 17:32:51.000000000","message":"This is probably a 409 rather than a 403. The user can perform the operation but not on the current state of the server.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":1206,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":1207,"context_line":"                \u0027start\u0027, id)"},{"line_number":1208,"context_line":"        except exception.RootVolumeIsNotAttached as e:"},{"line_number":1209,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"},{"line_number":1210,"context_line":""},{"line_number":1211,"context_line":"    @wsgi.response(202)"},{"line_number":1212,"context_line":"    @wsgi.expected_errors((404, 409))"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_ab273712","line":1209,"range":{"start_line":1209,"start_character":22,"end_line":1209,"end_character":35},"in_reply_to":"9fdfeff1_1ec1ec54","updated":"2019-02-26 08:52:26.000000000","message":"Hmm, I remembered I put this conflict ...","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}],"nova/api/openstack/compute/shelve.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                                                  \u0027unshelve\u0027,"},{"line_number":108,"context_line":"                                                                  id)"},{"line_number":109,"context_line":"        except exception.RootVolumeIsNotAttached as e:"},{"line_number":110,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_bea6a0bf","line":110,"range":{"start_line":110,"start_character":22,"end_line":110,"end_character":35},"updated":"2019-02-25 17:32:51.000000000","message":"Make this a 409 instead.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":107,"context_line":"                                                                  \u0027unshelve\u0027,"},{"line_number":108,"context_line":"                                                                  id)"},{"line_number":109,"context_line":"        except exception.RootVolumeIsNotAttached as e:"},{"line_number":110,"context_line":"            raise exc.HTTPForbidden(explanation\u003de.format_message())"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_5d4d2c70","line":110,"range":{"start_line":110,"start_character":22,"end_line":110,"end_character":35},"in_reply_to":"9fdfeff1_bea6a0bf","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"ae61cd957a3a7390075403b7135f796c93e75c18","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        except exception.InstanceUnknownCell as e:"},{"line_number":102,"context_line":"            raise exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":103,"context_line":"        except (exception.InstanceIsLocked,"},{"line_number":104,"context_line":"                exception.RootVolumeIsNotAttached)as e:"},{"line_number":105,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":106,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":107,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"}],"source_content_type":"text/x-python","patch_set":13,"id":"9fdfeff1_f0cc478a","line":104,"range":{"start_line":104,"start_character":48,"end_line":104,"end_character":50},"updated":"2019-02-26 09:08:20.000000000","message":"Oops","commit_id":"20784870c42451e17a0648729520880998e9d889"}],"nova/api/openstack/compute/volumes.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        return wsgi.ResponseObject(result, headers\u003ddict(location\u003dlocation))"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"def _translate_attachment_detail_view(volume_id, instance_uuid, mountpoint,"},{"line_number":213,"context_line":"                                      boot_index\u003dNone):"},{"line_number":214,"context_line":"    \"\"\"Maps keys for attachment details view.\"\"\""},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_4b033811","line":212,"range":{"start_line":212,"start_character":4,"end_line":212,"end_character":37},"updated":"2019-02-25 17:32:51.000000000","message":"You\u0027ll have to rebase on https://review.openstack.org/#/c/631948/9/nova/api/openstack/compute/volumes.py but this should be easier now, you\u0027ll get the bdm object and just need to pass a boolean kwarg to tell this method if it should return the boot_index or not in the response.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":220,"context_line":"    return d"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"def _translate_attachment_summary_view(volume_id, instance_uuid, mountpoint,"},{"line_number":224,"context_line":"                                       boot_index\u003dNone):"},{"line_number":225,"context_line":"    \"\"\"Maps keys for attachment summary view.\"\"\""},{"line_number":226,"context_line":"    d \u003d {}"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_4b2a5891","line":223,"range":{"start_line":223,"start_character":4,"end_line":223,"end_character":38},"updated":"2019-02-25 17:32:51.000000000","message":"As of https://review.openstack.org/#/c/631948/9/nova/api/openstack/compute/volumes.py I don\u0027t think you\u0027ll need to change this.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    # NOTE(justinsb): We use the volume id as the id of the attachment object"},{"line_number":229,"context_line":"    d[\u0027id\u0027] \u003d volume_id"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    d[\u0027volumeId\u0027] \u003d volume_id"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    d[\u0027serverId\u0027] \u003d instance_uuid"},{"line_number":234,"context_line":"    if mountpoint:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_1e524c14","line":231,"range":{"start_line":231,"start_character":4,"end_line":231,"end_character":29},"updated":"2019-02-25 17:32:51.000000000","message":"If the root volume is detached, this will be None now. We should update the description for this parameter in the API reference to indicate that if the volume_id is None and boot_index is 0 it means the root volume is detached.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":228,"context_line":"    # NOTE(justinsb): We use the volume id as the id of the attachment object"},{"line_number":229,"context_line":"    d[\u0027id\u0027] \u003d volume_id"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    d[\u0027volumeId\u0027] \u003d volume_id"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"    d[\u0027serverId\u0027] \u003d instance_uuid"},{"line_number":234,"context_line":"    if mountpoint:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_bddf7864","line":231,"range":{"start_line":231,"start_character":4,"end_line":231,"end_character":29},"in_reply_to":"9fdfeff1_1e524c14","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    d[\u0027serverId\u0027] \u003d instance_uuid"},{"line_number":234,"context_line":"    if mountpoint:"},{"line_number":235,"context_line":"        d[\u0027device\u0027] \u003d mountpoint"},{"line_number":236,"context_line":"    if boot_index is not None:"},{"line_number":237,"context_line":"        d[\u0027boot_index\u0027] \u003d boot_index"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    return d"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_1e2d6c94","line":237,"range":{"start_line":236,"start_character":4,"end_line":237,"end_character":36},"updated":"2019-02-25 17:32:51.000000000","message":"This needs to be in the API reference docs for the affected APIs.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":233,"context_line":"    d[\u0027serverId\u0027] \u003d instance_uuid"},{"line_number":234,"context_line":"    if mountpoint:"},{"line_number":235,"context_line":"        d[\u0027device\u0027] \u003d mountpoint"},{"line_number":236,"context_line":"    if boot_index is not None:"},{"line_number":237,"context_line":"        d[\u0027boot_index\u0027] \u003d boot_index"},{"line_number":238,"context_line":""},{"line_number":239,"context_line":"    return d"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_7dd7d04c","line":237,"range":{"start_line":236,"start_character":4,"end_line":237,"end_character":36},"in_reply_to":"9fdfeff1_1e2d6c94","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":347,"context_line":"                                 vm_states.SHELVED_OFFLOADED):"},{"line_number":348,"context_line":"            _check_request_version(req, \u00272.20\u0027, \u0027attach_volume\u0027,"},{"line_number":349,"context_line":"                                   server_id, instance.vm_state)"},{"line_number":350,"context_line":"        # NOTE: ``is_root`` will only be passed for microversion newer"},{"line_number":351,"context_line":"        # than 2.70 and it is guaranteed by schema check, so do we have to"},{"line_number":352,"context_line":"        # check req version here again?"},{"line_number":353,"context_line":"        if instance.vm_state not in vm_states.ALLOW_DETACH_ATTACH_ROOT and \\"},{"line_number":354,"context_line":"                is_root:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_7e94b844","line":351,"range":{"start_line":350,"start_character":65,"end_line":351,"end_character":14},"updated":"2019-02-25 17:32:51.000000000","message":"newer than 2.70 means \u003e2.70 to me, which is not accurate, so just say \"starting with microversion 2.70\"","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":366,"context_line":"            raise exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":367,"context_line":"        except (exception.InstanceIsLocked,"},{"line_number":368,"context_line":"                exception.DevicePathInUse,"},{"line_number":369,"context_line":"                exception.MultiattachNotSupportedByVirtDriver,"},{"line_number":370,"context_line":"                exception.MultiattachSupportNotYetAvailable) as e:"},{"line_number":371,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":372,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":373,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_612e5d8d","line":370,"range":{"start_line":369,"start_character":16,"end_line":370,"end_character":66},"updated":"2019-02-25 17:32:51.000000000","message":"Looks like you should also be handling DetachAttachRootVolumeNotYetSupported in here.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":366,"context_line":"            raise exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":367,"context_line":"        except (exception.InstanceIsLocked,"},{"line_number":368,"context_line":"                exception.DevicePathInUse,"},{"line_number":369,"context_line":"                exception.MultiattachNotSupportedByVirtDriver,"},{"line_number":370,"context_line":"                exception.MultiattachSupportNotYetAvailable) as e:"},{"line_number":371,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":372,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":373,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_9d039410","line":370,"range":{"start_line":369,"start_character":16,"end_line":370,"end_character":66},"in_reply_to":"9fdfeff1_612e5d8d","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":465,"context_line":"            if not api_version_request.is_supported(req, min_version\u003d\u00272.70\u0027):"},{"line_number":466,"context_line":"                msg \u003d _(\"Cannot detach a root device volume\")"},{"line_number":467,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":468,"context_line":"            else:"},{"line_number":469,"context_line":"                if instance.vm_state not in \\"},{"line_number":470,"context_line":"                        vm_states.ALLOW_DETACH_ATTACH_ROOT:"},{"line_number":471,"context_line":"                    msg \u003d (_(\"Cannot detach a root device volume for\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_bead4085","line":468,"range":{"start_line":468,"start_character":12,"end_line":468,"end_character":17},"updated":"2019-02-25 17:32:51.000000000","message":"You can drop this else and the indent because if the above condition is True you\u0027ve already raised.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":465,"context_line":"            if not api_version_request.is_supported(req, min_version\u003d\u00272.70\u0027):"},{"line_number":466,"context_line":"                msg \u003d _(\"Cannot detach a root device volume\")"},{"line_number":467,"context_line":"                raise exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":468,"context_line":"            else:"},{"line_number":469,"context_line":"                if instance.vm_state not in \\"},{"line_number":470,"context_line":"                        vm_states.ALLOW_DETACH_ATTACH_ROOT:"},{"line_number":471,"context_line":"                    msg \u003d (_(\"Cannot detach a root device volume for\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_f00f672b","line":468,"range":{"start_line":468,"start_character":12,"end_line":468,"end_character":17},"in_reply_to":"9fdfeff1_bead4085","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                is_root \u003d True"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"        try:"},{"line_number":477,"context_line":"            self.compute_api.detach_volume(context, instance, volume, is_root)"},{"line_number":478,"context_line":"        except exception.InvalidVolume as e:"},{"line_number":479,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":480,"context_line":"        except exception.InstanceUnknownCell as e:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_81aee1e4","line":477,"range":{"start_line":477,"start_character":29,"end_line":477,"end_character":42},"updated":"2019-02-25 17:32:51.000000000","message":"You\u0027re not handling DetachAttachRootVolumeNotYetSupported so it would be a 500.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                is_root \u003d True"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"        try:"},{"line_number":477,"context_line":"            self.compute_api.detach_volume(context, instance, volume, is_root)"},{"line_number":478,"context_line":"        except exception.InvalidVolume as e:"},{"line_number":479,"context_line":"            raise exc.HTTPBadRequest(explanation\u003de.format_message())"},{"line_number":480,"context_line":"        except exception.InstanceUnknownCell as e:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_90185b76","line":477,"range":{"start_line":477,"start_character":29,"end_line":477,"end_character":42},"in_reply_to":"9fdfeff1_81aee1e4","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0eeae3a35bdb504b483fcddd8311ba6782225ff9","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                                 vm_states.SHELVED_OFFLOADED):"},{"line_number":342,"context_line":"            _check_request_version(req, \u00272.20\u0027, \u0027attach_volume\u0027,"},{"line_number":343,"context_line":"                                   server_id, instance.vm_state)"},{"line_number":344,"context_line":"        if instance.vm_state !\u003d vm_states.SHELVED_OFFLOADED and is_root:"},{"line_number":345,"context_line":"            msg \u003d (_(\"Cannot attach a root device volume for\""},{"line_number":346,"context_line":"                     \"instance in state: %s\") % instance.vm_state)"},{"line_number":347,"context_line":"            raise exc.HTTPConflict(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_57e1649a","line":344,"updated":"2019-02-27 16:20:47.000000000","message":"What if the user tries attaching a root volume when there is already an attached root volume? Do we handle that somewhere?\n\nI guess that\u0027s this:\n\nhttps://review.openstack.org/#/c/623981/18/nova/compute/api.py@3998\n\nWe should probably have a (non-api-sample) functional test for some of these negative scenarios since it\u0027s kind of complicated and I\u0027m not sure I trust unit tests.","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eda2f5acbd2574f49602914c1fae1a3b223ab329","unresolved":false,"context_lines":[{"line_number":341,"context_line":"                                 vm_states.SHELVED_OFFLOADED):"},{"line_number":342,"context_line":"            _check_request_version(req, \u00272.20\u0027, \u0027attach_volume\u0027,"},{"line_number":343,"context_line":"                                   server_id, instance.vm_state)"},{"line_number":344,"context_line":"        if instance.vm_state !\u003d vm_states.SHELVED_OFFLOADED and is_root:"},{"line_number":345,"context_line":"            msg \u003d (_(\"Cannot attach a root device volume for\""},{"line_number":346,"context_line":"                     \"instance in state: %s\") % instance.vm_state)"},{"line_number":347,"context_line":"            raise exc.HTTPConflict(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_0fa2d8fc","line":344,"in_reply_to":"9fdfeff1_57e1649a","updated":"2019-02-28 01:49:48.000000000","message":"I will add one","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"}],"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":2096,"context_line":"                instance, migration, src_host, cast\u003dFalse)"},{"line_number":2097,"context_line":""},{"line_number":2098,"context_line":"    def _local_cleanup_bdm_volumes(self, bdms, instance, context,"},{"line_number":2099,"context_line":"                                   clean_for_datach\u003dFalse):"},{"line_number":2100,"context_line":"        \"\"\"The method deletes the bdm records and, if a bdm is a volume, call"},{"line_number":2101,"context_line":"        the terminate connection and the detach volume via the Volume API."},{"line_number":2102,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_de0e048b","line":2099,"range":{"start_line":2099,"start_character":35,"end_line":2099,"end_character":51},"updated":"2019-02-25 17:32:51.000000000","message":"It would probably be good to document this in the docstring because I always think of this method as only being used to cleanup volumes when deleting a server.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":2096,"context_line":"                instance, migration, src_host, cast\u003dFalse)"},{"line_number":2097,"context_line":""},{"line_number":2098,"context_line":"    def _local_cleanup_bdm_volumes(self, bdms, instance, context,"},{"line_number":2099,"context_line":"                                   clean_for_datach\u003dFalse):"},{"line_number":2100,"context_line":"        \"\"\"The method deletes the bdm records and, if a bdm is a volume, call"},{"line_number":2101,"context_line":"        the terminate connection and the detach volume via the Volume API."},{"line_number":2102,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_1dc804a6","line":2099,"range":{"start_line":2099,"start_character":35,"end_line":2099,"end_character":51},"in_reply_to":"9fdfeff1_de0e048b","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3981,"context_line":"        \"\"\"Inject network info for the instance.\"\"\""},{"line_number":3982,"context_line":"        self.compute_rpcapi.inject_network_info(context, instance\u003dinstance)"},{"line_number":3983,"context_line":""},{"line_number":3984,"context_line":"    def _find_root_volume_bdm_for_attach(self, context, uuid):"},{"line_number":3985,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3986,"context_line":"            context, uuid).root_bdm()"},{"line_number":3987,"context_line":"        if not root_bdm:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_3e72b013","line":3984,"range":{"start_line":3984,"start_character":56,"end_line":3984,"end_character":60},"updated":"2019-02-25 17:32:51.000000000","message":"instance_uuid","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3981,"context_line":"        \"\"\"Inject network info for the instance.\"\"\""},{"line_number":3982,"context_line":"        self.compute_rpcapi.inject_network_info(context, instance\u003dinstance)"},{"line_number":3983,"context_line":""},{"line_number":3984,"context_line":"    def _find_root_volume_bdm_for_attach(self, context, uuid):"},{"line_number":3985,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3986,"context_line":"            context, uuid).root_bdm()"},{"line_number":3987,"context_line":"        if not root_bdm:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_9e007c36","line":3984,"range":{"start_line":3984,"start_character":8,"end_line":3984,"end_character":40},"updated":"2019-02-25 17:32:51.000000000","message":"this can be a staticmethod","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":3981,"context_line":"        \"\"\"Inject network info for the instance.\"\"\""},{"line_number":3982,"context_line":"        self.compute_rpcapi.inject_network_info(context, instance\u003dinstance)"},{"line_number":3983,"context_line":""},{"line_number":3984,"context_line":"    def _find_root_volume_bdm_for_attach(self, context, uuid):"},{"line_number":3985,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3986,"context_line":"            context, uuid).root_bdm()"},{"line_number":3987,"context_line":"        if not root_bdm:"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_fdf500cc","line":3984,"range":{"start_line":3984,"start_character":8,"end_line":3984,"end_character":40},"in_reply_to":"9fdfeff1_9e007c36","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3982,"context_line":"        self.compute_rpcapi.inject_network_info(context, instance\u003dinstance)"},{"line_number":3983,"context_line":""},{"line_number":3984,"context_line":"    def _find_root_volume_bdm_for_attach(self, context, uuid):"},{"line_number":3985,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3986,"context_line":"            context, uuid).root_bdm()"},{"line_number":3987,"context_line":"        if not root_bdm:"},{"line_number":3988,"context_line":"            raise exception.RootVolumeBDMNotFound(instance_uuid\u003duuid)"},{"line_number":3989,"context_line":"        if not root_bdm.is_volume or root_bdm.volume_id or \\"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_7e6cb835","line":3986,"range":{"start_line":3985,"start_character":8,"end_line":3986,"end_character":37},"updated":"2019-02-25 17:32:51.000000000","message":"You can re-use nova.compute.utils.get_root_bdm() here.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":3982,"context_line":"        self.compute_rpcapi.inject_network_info(context, instance\u003dinstance)"},{"line_number":3983,"context_line":""},{"line_number":3984,"context_line":"    def _find_root_volume_bdm_for_attach(self, context, uuid):"},{"line_number":3985,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3986,"context_line":"            context, uuid).root_bdm()"},{"line_number":3987,"context_line":"        if not root_bdm:"},{"line_number":3988,"context_line":"            raise exception.RootVolumeBDMNotFound(instance_uuid\u003duuid)"},{"line_number":3989,"context_line":"        if not root_bdm.is_volume or root_bdm.volume_id or \\"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_3d106800","line":3986,"range":{"start_line":3985,"start_character":8,"end_line":3986,"end_character":37},"in_reply_to":"9fdfeff1_7e6cb835","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3986,"context_line":"            context, uuid).root_bdm()"},{"line_number":3987,"context_line":"        if not root_bdm:"},{"line_number":3988,"context_line":"            raise exception.RootVolumeBDMNotFound(instance_uuid\u003duuid)"},{"line_number":3989,"context_line":"        if not root_bdm.is_volume or root_bdm.volume_id or \\"},{"line_number":3990,"context_line":"                root_bdm.attachment_id:"},{"line_number":3991,"context_line":"            raise exception.RootVolumeBDMConflict(instance_uuid\u003duuid)"},{"line_number":3992,"context_line":"        return root_bdm"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_be57805a","line":3989,"updated":"2019-02-25 17:32:51.000000000","message":"Either document the method with a docstring or add a comment here about these checks and why they are necessary.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":3986,"context_line":"            context, uuid).root_bdm()"},{"line_number":3987,"context_line":"        if not root_bdm:"},{"line_number":3988,"context_line":"            raise exception.RootVolumeBDMNotFound(instance_uuid\u003duuid)"},{"line_number":3989,"context_line":"        if not root_bdm.is_volume or root_bdm.volume_id or \\"},{"line_number":3990,"context_line":"                root_bdm.attachment_id:"},{"line_number":3991,"context_line":"            raise exception.RootVolumeBDMConflict(instance_uuid\u003duuid)"},{"line_number":3992,"context_line":"        return root_bdm"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_7d3350ac","line":3989,"in_reply_to":"9fdfeff1_be57805a","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3991,"context_line":"            raise exception.RootVolumeBDMConflict(instance_uuid\u003duuid)"},{"line_number":3992,"context_line":"        return root_bdm"},{"line_number":3993,"context_line":""},{"line_number":3994,"context_line":"    def _check_root_bdm_is_valid(self, context, uuid, action):"},{"line_number":3995,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3996,"context_line":"            context, uuid).root_bdm()"},{"line_number":3997,"context_line":"        if not root_bdm or (root_bdm.is_volume and not root_bdm.volume_id):"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_bee540a6","line":3994,"range":{"start_line":3994,"start_character":8,"end_line":3994,"end_character":32},"updated":"2019-02-25 17:32:51.000000000","message":"looks like this can be a staticmethod","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3992,"context_line":"        return root_bdm"},{"line_number":3993,"context_line":""},{"line_number":3994,"context_line":"    def _check_root_bdm_is_valid(self, context, uuid, action):"},{"line_number":3995,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3996,"context_line":"            context, uuid).root_bdm()"},{"line_number":3997,"context_line":"        if not root_bdm or (root_bdm.is_volume and not root_bdm.volume_id):"},{"line_number":3998,"context_line":"            raise exception.RootVolumeIsNotAttached("},{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_3e4b90b1","line":3996,"range":{"start_line":3995,"start_character":8,"end_line":3996,"end_character":37},"updated":"2019-02-25 17:32:51.000000000","message":"Re-use compute_utils.get_root_bdm().","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":3992,"context_line":"        return root_bdm"},{"line_number":3993,"context_line":""},{"line_number":3994,"context_line":"    def _check_root_bdm_is_valid(self, context, uuid, action):"},{"line_number":3995,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3996,"context_line":"            context, uuid).root_bdm()"},{"line_number":3997,"context_line":"        if not root_bdm or (root_bdm.is_volume and not root_bdm.volume_id):"},{"line_number":3998,"context_line":"            raise exception.RootVolumeIsNotAttached("},{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_bdfbf8bb","line":3996,"range":{"start_line":3995,"start_character":8,"end_line":3996,"end_character":37},"in_reply_to":"9fdfeff1_3e4b90b1","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3994,"context_line":"    def _check_root_bdm_is_valid(self, context, uuid, action):"},{"line_number":3995,"context_line":"        root_bdm \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":3996,"context_line":"            context, uuid).root_bdm()"},{"line_number":3997,"context_line":"        if not root_bdm or (root_bdm.is_volume and not root_bdm.volume_id):"},{"line_number":3998,"context_line":"            raise exception.RootVolumeIsNotAttached("},{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"},{"line_number":4000,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_feef4884","line":3997,"updated":"2019-02-25 17:32:51.000000000","message":"A comment here would be good.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3998,"context_line":"            raise exception.RootVolumeIsNotAttached("},{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"},{"line_number":4000,"context_line":""},{"line_number":4001,"context_line":"    def _update_root_bdm(self, volume_bdm, volume,"},{"line_number":4002,"context_line":"                         disk_bus\u003dNone, device_type\u003dNone, tag\u003dNone):"},{"line_number":4003,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4004,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_de9fe4ff","line":4001,"range":{"start_line":4001,"start_character":8,"end_line":4001,"end_character":24},"updated":"2019-02-25 17:32:51.000000000","message":"staticmethod","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":3998,"context_line":"            raise exception.RootVolumeIsNotAttached("},{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"},{"line_number":4000,"context_line":""},{"line_number":4001,"context_line":"    def _update_root_bdm(self, volume_bdm, volume,"},{"line_number":4002,"context_line":"                         disk_bus\u003dNone, device_type\u003dNone, tag\u003dNone):"},{"line_number":4003,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4004,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_1d24845f","line":4001,"range":{"start_line":4001,"start_character":8,"end_line":4001,"end_character":24},"in_reply_to":"9fdfeff1_de9fe4ff","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"},{"line_number":4000,"context_line":""},{"line_number":4001,"context_line":"    def _update_root_bdm(self, volume_bdm, volume,"},{"line_number":4002,"context_line":"                         disk_bus\u003dNone, device_type\u003dNone, tag\u003dNone):"},{"line_number":4003,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4004,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"},{"line_number":4005,"context_line":"        volume_bdm.device_type \u003d device_type"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_3ea71053","line":4002,"range":{"start_line":4002,"start_character":25,"end_line":4002,"end_character":57},"updated":"2019-02-25 17:32:51.000000000","message":"Would disk_bus or device_type ever be specified when attaching a root volume? They aren\u0027t in the API:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003dattach-a-volume-to-an-instance-detail#attach-a-volume-to-an-instance","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"},{"line_number":4000,"context_line":""},{"line_number":4001,"context_line":"    def _update_root_bdm(self, volume_bdm, volume,"},{"line_number":4002,"context_line":"                         disk_bus\u003dNone, device_type\u003dNone, tag\u003dNone):"},{"line_number":4003,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4004,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"},{"line_number":4005,"context_line":"        volume_bdm.device_type \u003d device_type"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_bd1458ea","line":4002,"range":{"start_line":4002,"start_character":25,"end_line":4002,"end_character":57},"in_reply_to":"9fdfeff1_3ea71053","updated":"2019-02-26 08:52:26.000000000","message":"disk bus might change in shelve/unshelve case? I was also trying to be consistant with non-root volume case like in line 4141, it accepts these parameters.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6cb6fd47a20b53f91bafd2a34e11093231fa3819","unresolved":false,"context_lines":[{"line_number":3999,"context_line":"                action\u003daction, instance_uuid\u003duuid)"},{"line_number":4000,"context_line":""},{"line_number":4001,"context_line":"    def _update_root_bdm(self, volume_bdm, volume,"},{"line_number":4002,"context_line":"                         disk_bus\u003dNone, device_type\u003dNone, tag\u003dNone):"},{"line_number":4003,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4004,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"},{"line_number":4005,"context_line":"        volume_bdm.device_type \u003d device_type"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_20733d82","line":4002,"range":{"start_line":4002,"start_character":25,"end_line":4002,"end_character":57},"in_reply_to":"9fdfeff1_bd1458ea","updated":"2019-02-27 15:29:06.000000000","message":"\u003e disk bus might change in shelve/unshelve case?\n\nHow? Do you mean if the new root volume has an image with a different hw_disk_bus property value?\n\n\u003e I was also trying to be consistant with non-root volume case like in line 4141, it accepts these parameters.\n\nThat\u0027s all garbage though - the compute.api.API.attach_volume method has those parameters but the REST API does not allow them anywhere, as far as I know, so they are just unused parameters. I think the compute.api.API.attach_volume flow should remove them, but that\u0027s a latent issue to address separately.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":4133,"context_line":"            volume_bdm \u003d self._update_root_bdm("},{"line_number":4134,"context_line":"                volume_bdm, volume, disk_bus\u003ddisk_bus,"},{"line_number":4135,"context_line":"                device_type\u003ddevice_type, tag\u003dtag)"},{"line_number":4136,"context_line":"            volume_bdm \u003d self.compute_rpcapi.reserve_block_device_name("},{"line_number":4137,"context_line":"                context, instance, device, volume_bdm.volume_id,"},{"line_number":4138,"context_line":"                disk_bus\u003ddisk_bus, device_type\u003ddevice_type, tag\u003dtag,"},{"line_number":4139,"context_line":"                multiattach\u003dvolume[\u0027multiattach\u0027], existing_bdm\u003dvolume_bdm)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_fe4bc883","line":4136,"range":{"start_line":4136,"start_character":45,"end_line":4136,"end_character":70},"updated":"2019-02-25 17:32:51.000000000","message":"Should have a comment here about why we need to call this.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":4226,"context_line":"                                    vm_states.SOFT_DELETED, vm_states.SHELVED,"},{"line_number":4227,"context_line":"                                    vm_states.SHELVED_OFFLOADED])"},{"line_number":4228,"context_line":"    def attach_volume(self, context, instance, volume_id, device\u003dNone,"},{"line_number":4229,"context_line":"                      disk_bus\u003dNone, device_type\u003dNone, tag\u003dNone,"},{"line_number":4230,"context_line":"                      supports_multiattach\u003dFalse, is_root\u003dFalse):"},{"line_number":4231,"context_line":"        \"\"\"Attach an existing volume to an existing instance.\"\"\""},{"line_number":4232,"context_line":"        # NOTE(vish): Fail fast if the device is not going to pass. This"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_7e0d983c","line":4229,"range":{"start_line":4229,"start_character":22,"end_line":4229,"end_character":53},"updated":"2019-02-25 17:32:51.000000000","message":"So I guess these are already here but they are not ever used because the API doesn\u0027t have parameters for them. I\u0027d like to burn this out of this code to simplify things rather than pass None values around, but for now just make sure you\u0027re not trying to care about disk_bus and device_type when attaching a root volume since they\u0027ll never be provided. We can remove these in a separate cleanup patch.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":4243,"context_line":"        # Check whether it support attach root volume if is_root\u003dTrue"},{"line_number":4244,"context_line":"        if is_root and ("},{"line_number":4245,"context_line":"                min_compute_version \u003c MIN_COMPUTE_ATTACH_DETACH_ROOT_VOLUME):"},{"line_number":4246,"context_line":"            raise exception.DetachAttachRootVolumeNotYetSupported"},{"line_number":4247,"context_line":"        if min_compute_version \u003e\u003d CINDER_V3_ATTACH_MIN_COMPUTE_VERSION:"},{"line_number":4248,"context_line":"            try:"},{"line_number":4249,"context_line":"                # Check to see if Cinder is new enough to create new-style"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_6115fd3c","line":4246,"range":{"start_line":4246,"start_character":28,"end_line":4246,"end_character":65},"updated":"2019-02-25 17:32:51.000000000","message":"Is this handled in the API code or is it going to result in a 500 response?","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":4243,"context_line":"        # Check whether it support attach root volume if is_root\u003dTrue"},{"line_number":4244,"context_line":"        if is_root and ("},{"line_number":4245,"context_line":"                min_compute_version \u003c MIN_COMPUTE_ATTACH_DETACH_ROOT_VOLUME):"},{"line_number":4246,"context_line":"            raise exception.DetachAttachRootVolumeNotYetSupported"},{"line_number":4247,"context_line":"        if min_compute_version \u003e\u003d CINDER_V3_ATTACH_MIN_COMPUTE_VERSION:"},{"line_number":4248,"context_line":"            try:"},{"line_number":4249,"context_line":"                # Check to see if Cinder is new enough to create new-style"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_5d620c40","line":4246,"range":{"start_line":4246,"start_character":28,"end_line":4246,"end_character":65},"in_reply_to":"9fdfeff1_6115fd3c","updated":"2019-02-26 08:52:26.000000000","message":"I will check","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"91143295f04f7f691c7f44f6ec48174d1ed57b3d","unresolved":false,"context_lines":[{"line_number":4186,"context_line":"                                       instance.uuid,"},{"line_number":4187,"context_line":"                                       dev)"},{"line_number":4188,"context_line":""},{"line_number":4189,"context_line":"        if is_root:"},{"line_number":4190,"context_line":"            volume_bdm \u003d self._find_root_volume_bdm_for_attach("},{"line_number":4191,"context_line":"                context, instance)"},{"line_number":4192,"context_line":"            self._update_root_bdm("}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_9bedd726","line":4189,"updated":"2019-02-26 13:35:31.000000000","message":"As I said in the mailing list, we\u0027ll need to update the RequestSpec.image (ImageMeta) when we attach a new root volume otherwise when we unshelve we\u0027ll be using the old image metadata from the old root volume used to create the server.\n\nSo you likely need to re-use this code:\n\nhttps://github.com/openstack/nova/blob/33f367ec2f32ce36b00257c11c5084400416774c/nova/compute/api.py#L1091-L1101\n\nWhich will also raise an exception if the user tries to attach a root volume that is not bootable, which we should handle as a 400 response.","commit_id":"dbbaaa2d7cf47b0295a9dff1a64e2cb493ac7083"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2b1688770e32fdfad75bb9e3e813606ba3f9b3ad","unresolved":false,"context_lines":[{"line_number":4186,"context_line":"                                       instance.uuid,"},{"line_number":4187,"context_line":"                                       dev)"},{"line_number":4188,"context_line":""},{"line_number":4189,"context_line":"        if is_root:"},{"line_number":4190,"context_line":"            volume_bdm \u003d self._find_root_volume_bdm_for_attach("},{"line_number":4191,"context_line":"                context, instance)"},{"line_number":4192,"context_line":"            self._update_root_bdm("}],"source_content_type":"text/x-python","patch_set":15,"id":"9fdfeff1_cfe1592d","line":4189,"in_reply_to":"9fdfeff1_9bedd726","updated":"2019-02-26 16:01:57.000000000","message":"Something else to be aware of but if the extra spec validation stuff lands https://review.openstack.org/#/c/620706/25/nova/compute/api.py we\u0027ll also have to call _validate_flavor_image to validate that the image in the new root volume is compatible with the flavor for thins like NUMA.","commit_id":"dbbaaa2d7cf47b0295a9dff1a64e2cb493ac7083"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3244ecd3289f88486536b5e5cf13c06b101baa71","unresolved":false,"context_lines":[{"line_number":3655,"context_line":"        \"\"\"Restore a shelved instance.\"\"\""},{"line_number":3656,"context_line":"        # Check whether we are trying to unshelve an instance with a"},{"line_number":3657,"context_line":"        # detached root volume."},{"line_number":3658,"context_line":"        self._check_root_bdm_is_valid(context, instance, \u0027unshelve\u0027)"},{"line_number":3659,"context_line":""},{"line_number":3660,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3661,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_177afcef","line":3658,"range":{"start_line":3658,"start_character":57,"end_line":3658,"end_character":67},"updated":"2019-02-27 16:15:26.000000000","message":"nit: use instance_actions.UNSHELVE here","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eda2f5acbd2574f49602914c1fae1a3b223ab329","unresolved":false,"context_lines":[{"line_number":3655,"context_line":"        \"\"\"Restore a shelved instance.\"\"\""},{"line_number":3656,"context_line":"        # Check whether we are trying to unshelve an instance with a"},{"line_number":3657,"context_line":"        # detached root volume."},{"line_number":3658,"context_line":"        self._check_root_bdm_is_valid(context, instance, \u0027unshelve\u0027)"},{"line_number":3659,"context_line":""},{"line_number":3660,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3661,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_34ea9173","line":3658,"range":{"start_line":3658,"start_character":57,"end_line":3658,"end_character":67},"in_reply_to":"9fdfeff1_177afcef","updated":"2019-02-28 01:49:48.000000000","message":"Done","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0eeae3a35bdb504b483fcddd8311ba6782225ff9","unresolved":false,"context_lines":[{"line_number":3995,"context_line":"        # volume_id field will be reset to None), raise exception."},{"line_number":3996,"context_line":"        if not root_bdm:"},{"line_number":3997,"context_line":"            raise exception.RootVolumeBDMNotFound(instance_uuid\u003dinstance.uuid)"},{"line_number":3998,"context_line":"        if not root_bdm.is_volume or root_bdm.volume_id or \\"},{"line_number":3999,"context_line":"                root_bdm.attachment_id:"},{"line_number":4000,"context_line":"            raise exception.RootVolumeBDMConflict(instance_uuid\u003dinstance.uuid)"},{"line_number":4001,"context_line":"        return root_bdm"},{"line_number":4002,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_b77210e2","line":3999,"range":{"start_line":3998,"start_character":55,"end_line":3999,"end_character":39},"updated":"2019-02-27 16:20:47.000000000","message":"I\u0027m not sure you need to check this do you?\n\nIf so, I\u0027d suggest adding a \"is_root_detached\" method to the BDM so you can abstract this logic to that code outside of the API.","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eda2f5acbd2574f49602914c1fae1a3b223ab329","unresolved":false,"context_lines":[{"line_number":3995,"context_line":"        # volume_id field will be reset to None), raise exception."},{"line_number":3996,"context_line":"        if not root_bdm:"},{"line_number":3997,"context_line":"            raise exception.RootVolumeBDMNotFound(instance_uuid\u003dinstance.uuid)"},{"line_number":3998,"context_line":"        if not root_bdm.is_volume or root_bdm.volume_id or \\"},{"line_number":3999,"context_line":"                root_bdm.attachment_id:"},{"line_number":4000,"context_line":"            raise exception.RootVolumeBDMConflict(instance_uuid\u003dinstance.uuid)"},{"line_number":4001,"context_line":"        return root_bdm"},{"line_number":4002,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_7499f91c","line":3999,"range":{"start_line":3998,"start_character":55,"end_line":3999,"end_character":39},"in_reply_to":"9fdfeff1_b77210e2","updated":"2019-02-28 01:49:48.000000000","message":"Hmm, you are right, we don\u0027t need this \"or\" volume_id will be enough","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6cb6fd47a20b53f91bafd2a34e11093231fa3819","unresolved":false,"context_lines":[{"line_number":4011,"context_line":"                action\u003daction, instance_uuid\u003dinstance.uuid)"},{"line_number":4012,"context_line":""},{"line_number":4013,"context_line":"    @staticmethod"},{"line_number":4014,"context_line":"    def _update_root_bdm(volume_bdm, volume, disk_bus\u003dNone, device_type\u003dNone,"},{"line_number":4015,"context_line":"                         tag\u003dNone):"},{"line_number":4016,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4017,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_40c20187","line":4014,"range":{"start_line":4014,"start_character":8,"end_line":4014,"end_character":24},"updated":"2019-02-27 15:29:06.000000000","message":"I thought of this later, but if we have reset_fields_for_detached_root_bdm in the BDM object itself, we could also put this in the BDM object as a helper method to correspond with reset_fields_for_detached_root_bdm. Then you\u0027d just pass in the volume_id and tag and it can save the changes. You could also guard that method by raising if not self.is_root like you added to reset_fields_for_detached_root_bdm.\n\nI\u0027m still not sure why you\u0027re passing disk_bus and device_type here since they\u0027ll never be anything other than None. I guess it\u0027s OK but I\u0027ll probably just remove it all later.","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eda2f5acbd2574f49602914c1fae1a3b223ab329","unresolved":false,"context_lines":[{"line_number":4011,"context_line":"                action\u003daction, instance_uuid\u003dinstance.uuid)"},{"line_number":4012,"context_line":""},{"line_number":4013,"context_line":"    @staticmethod"},{"line_number":4014,"context_line":"    def _update_root_bdm(volume_bdm, volume, disk_bus\u003dNone, device_type\u003dNone,"},{"line_number":4015,"context_line":"                         tag\u003dNone):"},{"line_number":4016,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4017,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_8fbc8806","line":4014,"range":{"start_line":4014,"start_character":8,"end_line":4014,"end_character":24},"in_reply_to":"9fdfeff1_40c20187","updated":"2019-02-28 01:49:48.000000000","message":"Hmm, if I do what you suggested and put this in bdm obj, then I guess I should get rid of disk_bus and device_type now, since it might need a version bump and if I left if there and deal with it in another patch, the hash value might change again? And if we remove the disk_bus and device_type, and tag will always be None, so maybe I don\u0027t need to move it since there will be only volume_id left and I can assigne and save directly.","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4eba4bd935b6f6267638c2f622716e4a99d044e6","unresolved":false,"context_lines":[{"line_number":4011,"context_line":"                action\u003daction, instance_uuid\u003dinstance.uuid)"},{"line_number":4012,"context_line":""},{"line_number":4013,"context_line":"    @staticmethod"},{"line_number":4014,"context_line":"    def _update_root_bdm(volume_bdm, volume, disk_bus\u003dNone, device_type\u003dNone,"},{"line_number":4015,"context_line":"                         tag\u003dNone):"},{"line_number":4016,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4017,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_c46d692f","line":4014,"range":{"start_line":4014,"start_character":8,"end_line":4014,"end_character":24},"in_reply_to":"9fdfeff1_8fbc8806","updated":"2019-03-01 15:57:00.000000000","message":"\u003e Hmm, if I do what you suggested and put this in bdm obj, then I\n \u003e guess I should get rid of disk_bus and device_type now, since it\n \u003e might need a version bump and if I left if there and deal with it\n \u003e in another patch, the hash value might change again? And if we\n \u003e remove the disk_bus and device_type, and tag will always be None,\n \u003e so maybe I don\u0027t need to move it since there will be only volume_id\n \u003e left and I can assigne and save directly.\n\nThe BDM object version would only change if it\u0027s a remotable method, which this wouldn\u0027t be, just like reset_fields_for_detached_root_bdm.","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6cb6fd47a20b53f91bafd2a34e11093231fa3819","unresolved":false,"context_lines":[{"line_number":4016,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4017,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"},{"line_number":4018,"context_line":"        volume_bdm.device_type \u003d device_type"},{"line_number":4019,"context_line":"        if tag:"},{"line_number":4020,"context_line":"            volume_bdm.tag \u003d tag"},{"line_number":4021,"context_line":"        volume_bdm.save()"},{"line_number":4022,"context_line":"        return volume_bdm"},{"line_number":4023,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_60306556","line":4020,"range":{"start_line":4019,"start_character":8,"end_line":4020,"end_character":32},"updated":"2019-02-27 15:29:06.000000000","message":"It now occurs to me that tag will never be not None...","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eda2f5acbd2574f49602914c1fae1a3b223ab329","unresolved":false,"context_lines":[{"line_number":4016,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4017,"context_line":"        volume_bdm.disk_bus \u003d disk_bus"},{"line_number":4018,"context_line":"        volume_bdm.device_type \u003d device_type"},{"line_number":4019,"context_line":"        if tag:"},{"line_number":4020,"context_line":"            volume_bdm.tag \u003d tag"},{"line_number":4021,"context_line":"        volume_bdm.save()"},{"line_number":4022,"context_line":"        return volume_bdm"},{"line_number":4023,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_14b50d7e","line":4020,"range":{"start_line":4019,"start_character":8,"end_line":4020,"end_character":32},"in_reply_to":"9fdfeff1_60306556","updated":"2019-02-28 01:49:48.000000000","message":"yes, it seems, so should we keep the orignial ones?","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6cb6fd47a20b53f91bafd2a34e11093231fa3819","unresolved":false,"context_lines":[{"line_number":4186,"context_line":"                                       instance.uuid,"},{"line_number":4187,"context_line":"                                       dev)"},{"line_number":4188,"context_line":""},{"line_number":4189,"context_line":"        if is_root:"},{"line_number":4190,"context_line":"            volume_bdm \u003d self._find_root_volume_bdm_for_attach("},{"line_number":4191,"context_line":"                context, instance)"},{"line_number":4192,"context_line":"            self._update_root_bdm("}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_c0503135","line":4189,"updated":"2019-02-27 15:29:06.000000000","message":"OK so you already said you\u0027re not handling the RequestSpec.image metadata yet for a new root volume, that\u0027s a TODO here.\n\nAnother thing I thought about is cross_az_attach\u003dFalse - are we checking that anywhere in this flow? For example, if I create the server in AZ1 but I\u0027m attaching a new root volume which is in AZ2, if cross_az_attach\u003dFalse that should fail. That should be handled by _check_attach_and_reserve_volume below though.","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"eda2f5acbd2574f49602914c1fae1a3b223ab329","unresolved":false,"context_lines":[{"line_number":4186,"context_line":"                                       instance.uuid,"},{"line_number":4187,"context_line":"                                       dev)"},{"line_number":4188,"context_line":""},{"line_number":4189,"context_line":"        if is_root:"},{"line_number":4190,"context_line":"            volume_bdm \u003d self._find_root_volume_bdm_for_attach("},{"line_number":4191,"context_line":"                context, instance)"},{"line_number":4192,"context_line":"            self._update_root_bdm("}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_146aedeb","line":4189,"in_reply_to":"9fdfeff1_c0503135","updated":"2019-02-28 01:49:48.000000000","message":"yes, that is done in _check_attach_and_reserve_volume()","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6cb6fd47a20b53f91bafd2a34e11093231fa3819","unresolved":false,"context_lines":[{"line_number":4261,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4262,"context_line":"        is_shelved_offloaded \u003d instance.vm_state \u003d\u003d vm_states.SHELVED_OFFLOADED"},{"line_number":4263,"context_line":"        if is_shelved_offloaded:"},{"line_number":4264,"context_line":"            if tag:"},{"line_number":4265,"context_line":"                # NOTE(artom) Local attach (to a shelved-offload instance)"},{"line_number":4266,"context_line":"                # cannot support device tagging because we have no way to call"},{"line_number":4267,"context_line":"                # the compute manager to check that it supports device tagging."},{"line_number":4268,"context_line":"                # In fact, we don\u0027t even know which computer manager the"},{"line_number":4269,"context_line":"                # instance will eventually end up on when it\u0027s unshelved."},{"line_number":4270,"context_line":"                raise exception.VolumeTaggedAttachToShelvedNotSupported()"},{"line_number":4271,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":4272,"context_line":"                # NOTE(mriedem): Similar to tagged attach, we don\u0027t support"},{"line_number":4273,"context_line":"                # attaching a multiattach volume to shelved offloaded instances"}],"source_content_type":"text/x-python","patch_set":18,"id":"9fdfeff1_00f6395e","line":4270,"range":{"start_line":4264,"start_character":12,"end_line":4270,"end_character":73},"updated":"2019-02-27 15:29:06.000000000","message":"Ugh, so I forgot about this. This means when we detach the root volume we reset the tag to None on the root BDM, but when the user goes to attach a new root volume, they can\u0027t specify a tag with it, and we only allow attaching a root volume to a shelved instance now, so we probably need to rethink this restriction, or rethink if we should reset the original tag.\n\nI think I was originally pessimistic when artom added this restriction for attaching volumes with a tag because while it\u0027s true we don\u0027t know if the compute that the instance is unshelved on will support device tags, we also don\u0027t know that during initial server create but we still allow bdm tags in that case. In fact, in the server create case, if you try to create a server with bdm tags on a compute host that does not support them, it will fail the build (not even try to reschedule):\n\nhttps://github.com/openstack/nova/blob/6efa3861a5a829ba5883ff191e2552b063028bb0/nova/compute/manager.py#L1898\n\nI believe the assumed workaround when that was added was the operator would just use host aggregates but since tags are not restricted by flavor or image, I\u0027m not sure how host aggregates would work there.\n\nAnyway, I\u0027ll mention this in the ML thread since I think we kind of have to lift this restriction if we\u0027re going to allow attaching new root volumes to shelved instances but that probably also means more changes to the compute unshelve_instance flow to check for device tag support like the initial server create flow.","commit_id":"4ed8de9e60a1b7d4b2fba3a47d98b3c71aa8f2b7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        # reason, we rely on the DB to cast True to a String."},{"line_number":524,"context_line":"        return True if bool_val else \u0027\u0027"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"    def _check_requested_image(self, context, image_id, image,"},{"line_number":527,"context_line":"                               instance_type, root_bdm):"},{"line_number":528,"context_line":"        if not image:"},{"line_number":529,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_c7132b58","line":526,"range":{"start_line":526,"start_character":8,"end_line":526,"end_character":30},"updated":"2019-03-01 16:17:54.000000000","message":"And what about stuff like this? This is also called during rebuild because the image can change.","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":1096,"context_line":"                except Exception:"},{"line_number":1097,"context_line":"                    raise exception.InvalidBDMVolume(id\u003dvolume_id)"},{"line_number":1098,"context_line":""},{"line_number":1099,"context_line":"                if not volume.get(\u0027bootable\u0027, True):"},{"line_number":1100,"context_line":"                    raise exception.InvalidBDMVolumeNotBootable(id\u003dvolume_id)"},{"line_number":1101,"context_line":""},{"line_number":1102,"context_line":"                return utils.get_image_metadata_from_volume(volume)"},{"line_number":1103,"context_line":"        return {}"},{"line_number":1104,"context_line":""},{"line_number":1105,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_87ec4329","line":1102,"range":{"start_line":1099,"start_character":16,"end_line":1102,"end_character":67},"updated":"2019-03-01 16:17:54.000000000","message":"I was going to say you could just get these for free if you call this _get_bdm_image_metadata method, but then we\u0027d have to get the volume again which is kind of inefficient. If we split this out into another method though we could re-use it from here and from _update_request_spec_for_new_root_volume.","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":3224,"context_line":"                context, trusted_certs, rebuild\u003dTrue)"},{"line_number":3225,"context_line":""},{"line_number":3226,"context_line":"        image_id, image \u003d self._get_image(context, image_href)"},{"line_number":3227,"context_line":"        self._check_auto_disk_config(image\u003dimage, **kwargs)"},{"line_number":3228,"context_line":""},{"line_number":3229,"context_line":"        flavor \u003d instance.get_flavor()"},{"line_number":3230,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_679b5fc8","line":3227,"range":{"start_line":3227,"start_character":8,"end_line":3227,"end_character":59},"updated":"2019-03-01 16:17:54.000000000","message":"Seems this is also something we\u0027d likely need to check if the root volume image changes...","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":3279,"context_line":"        self._checks_for_create_and_rebuild(context, image_id, image,"},{"line_number":3280,"context_line":"                flavor, metadata, files_to_inject, root_bdm)"},{"line_number":3281,"context_line":""},{"line_number":3282,"context_line":"        kernel_id, ramdisk_id \u003d self._handle_kernel_and_ramdisk("},{"line_number":3283,"context_line":"                context, None, None, image)"},{"line_number":3284,"context_line":""},{"line_number":3285,"context_line":"        def _reset_image_metadata():"}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_073cd3bc","line":3282,"range":{"start_line":3282,"start_character":37,"end_line":3282,"end_character":63},"updated":"2019-03-01 16:17:54.000000000","message":"And what about this? The new root image could have a different kernel/ramdisk right?","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":3282,"context_line":"        kernel_id, ramdisk_id \u003d self._handle_kernel_and_ramdisk("},{"line_number":3283,"context_line":"                context, None, None, image)"},{"line_number":3284,"context_line":""},{"line_number":3285,"context_line":"        def _reset_image_metadata():"},{"line_number":3286,"context_line":"            \"\"\"Remove old image properties that we\u0027re storing as instance"},{"line_number":3287,"context_line":"            system metadata.  These properties start with \u0027image_\u0027."},{"line_number":3288,"context_line":"            Then add the properties for the new image."}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_042051af","line":3285,"range":{"start_line":3285,"start_character":12,"end_line":3285,"end_character":33},"updated":"2019-03-01 16:17:54.000000000","message":"Wouldn\u0027t we need to do something like this for a new root volume with a new image which has new metadata as well?","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":3308,"context_line":"            instance.save()"},{"line_number":3309,"context_line":"            return orig_sys_metadata"},{"line_number":3310,"context_line":""},{"line_number":3311,"context_line":"        # Since image might have changed, we may have new values for"},{"line_number":3312,"context_line":"        # os_type, vm_mode, etc"},{"line_number":3313,"context_line":"        options_from_image \u003d self._inherit_properties_from_image("},{"line_number":3314,"context_line":"                image, auto_disk_config)"},{"line_number":3315,"context_line":"        instance.update(options_from_image)"},{"line_number":3316,"context_line":""},{"line_number":3317,"context_line":"        instance.task_state \u003d task_states.REBUILDING"},{"line_number":3318,"context_line":"        # An empty instance.image_ref is currently used as an indication"}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_e712ef57","line":3315,"range":{"start_line":3311,"start_character":8,"end_line":3315,"end_character":43},"updated":"2019-03-01 16:17:54.000000000","message":"And what about something like this?","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":4011,"context_line":"                action\u003daction, instance_uuid\u003dinstance.uuid)"},{"line_number":4012,"context_line":""},{"line_number":4013,"context_line":"    @staticmethod"},{"line_number":4014,"context_line":"    def _update_root_bdm(volume_bdm, volume, tag\u003dNone):"},{"line_number":4015,"context_line":"        volume_bdm.volume_id \u003d volume[\u0027id\u0027]"},{"line_number":4016,"context_line":"        if tag:"},{"line_number":4017,"context_line":"            volume_bdm.tag \u003d tag"}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_a4f9454e","line":4014,"updated":"2019-03-01 16:17:54.000000000","message":"I still think we could do this with a non-remotable BDM object method, it shouldn\u0027t change the version on the object if it\u0027s not remotable.","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":4200,"context_line":"                raise exception.InvalidBDMVolumeNotBootable(id\u003dvolume_id)"},{"line_number":4201,"context_line":"            volume_bdm \u003d self._find_root_volume_bdm_for_attach("},{"line_number":4202,"context_line":"                context, instance)"},{"line_number":4203,"context_line":"            # TODO(Kevin_Zheng): Handle tags for shelved_offloaded instances"},{"line_number":4204,"context_line":"            # Bug ID 1817927 filed for this."},{"line_number":4205,"context_line":"            self._update_root_bdm(volume_bdm, volume)"},{"line_number":4206,"context_line":"            self._update_request_spec_for_new_root_volume("}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_67603fa6","line":4203,"updated":"2019-03-01 16:17:54.000000000","message":"Based on the latest ML discussion it sounds like we\u0027d:\n\n- leave the tag on the bdm if the user doesn\u0027t specify a new one\n- overwrite the tag on the bdm if the user specifies a new one and the root bdm already had a tag\n- fail if the user specifies a tag and the root bdm did not previously have one","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"8bd1d1643877a68badafde2e88cd29af0768b80d","unresolved":false,"context_lines":[{"line_number":4200,"context_line":"                raise exception.InvalidBDMVolumeNotBootable(id\u003dvolume_id)"},{"line_number":4201,"context_line":"            volume_bdm \u003d self._find_root_volume_bdm_for_attach("},{"line_number":4202,"context_line":"                context, instance)"},{"line_number":4203,"context_line":"            # TODO(Kevin_Zheng): Handle tags for shelved_offloaded instances"},{"line_number":4204,"context_line":"            # Bug ID 1817927 filed for this."},{"line_number":4205,"context_line":"            self._update_root_bdm(volume_bdm, volume)"},{"line_number":4206,"context_line":"            self._update_request_spec_for_new_root_volume("}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_8a242c62","line":4203,"in_reply_to":"9fdfeff1_67603fa6","updated":"2019-03-04 11:32:50.000000000","message":"Done","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fe2e4244b1986fb40ab88e9206a58c14300a63f8","unresolved":false,"context_lines":[{"line_number":4273,"context_line":""},{"line_number":4274,"context_line":"        volume \u003d self.volume_api.get(context, volume_id)"},{"line_number":4275,"context_line":"        is_shelved_offloaded \u003d instance.vm_state \u003d\u003d vm_states.SHELVED_OFFLOADED"},{"line_number":4276,"context_line":"        if is_shelved_offloaded:"},{"line_number":4277,"context_line":"            if tag:"},{"line_number":4278,"context_line":"                # NOTE(artom) Local attach (to a shelved-offload instance)"},{"line_number":4279,"context_line":"                # cannot support device tagging because we have no way to call"},{"line_number":4280,"context_line":"                # the compute manager to check that it supports device tagging."},{"line_number":4281,"context_line":"                # In fact, we don\u0027t even know which computer manager the"},{"line_number":4282,"context_line":"                # instance will eventually end up on when it\u0027s unshelved."},{"line_number":4283,"context_line":"                raise exception.VolumeTaggedAttachToShelvedNotSupported()"},{"line_number":4284,"context_line":"            if volume[\u0027multiattach\u0027]:"},{"line_number":4285,"context_line":"                # NOTE(mriedem): Similar to tagged attach, we don\u0027t support"},{"line_number":4286,"context_line":"                # attaching a multiattach volume to shelved offloaded instances"},{"line_number":4287,"context_line":"                # because we can\u0027t tell if the compute host (since there isn\u0027t"},{"line_number":4288,"context_line":"                # one) supports it. This could possibly be supported in the"},{"line_number":4289,"context_line":"                # future if the scheduler was made aware of which computes"},{"line_number":4290,"context_line":"                # support multiattach volumes."},{"line_number":4291,"context_line":"                raise exception.MultiattachToShelvedNotSupported()"},{"line_number":4292,"context_line":"            return self._attach_volume_shelved_offloaded(context,"},{"line_number":4293,"context_line":"                                                         instance,"},{"line_number":4294,"context_line":"                                                         volume,"}],"source_content_type":"text/x-python","patch_set":23,"id":"9fdfeff1_c7f9ebc4","line":4291,"range":{"start_line":4276,"start_character":8,"end_line":4291,"end_character":66},"updated":"2019-03-01 16:17:54.000000000","message":"As noted above, this will need to change for the root bdm stuff based on the ML discussion, i.e. you can overwrite a previous tag on the root bdm and we won\u0027t fail in that case, and you can attach a new multiattach root volume if the existing root bdm is multiattach (and to figure that out, you need to retain the connection_info on detach since the multiattach flag is in the connection_info unfortunately).\n\nBut we will disallow adding a tag or attaching a root multiattach volume if the previous root bdm didn\u0027t have a tag or wasn\u0027t multiattach.","commit_id":"3aab8b906e4bb254d1d50b9d6906e49ae9930def"}],"nova/compute/cells_api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":460,"context_line":"    @check_instance_cell"},{"line_number":461,"context_line":"    def _attach_volume(self, context, instance, volume, device,"},{"line_number":462,"context_line":"                       disk_bus, device_type, tag\u003dNone,"},{"line_number":463,"context_line":"                       supports_multiattach\u003dFalse, is_root\u003dFalse):"},{"line_number":464,"context_line":"        \"\"\"Attach an existing volume to an existing instance.\"\"\""},{"line_number":465,"context_line":"        if tag:"},{"line_number":466,"context_line":"            raise exception.VolumeTaggedAttachNotSupported()"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_0184315d","line":463,"range":{"start_line":463,"start_character":51,"end_line":463,"end_character":58},"updated":"2019-02-25 17:32:51.000000000","message":"We could probably handle this like tag and multiattach volumes here - if True raise an exception since cells v1 does not support attaching a root volume.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":460,"context_line":"    @check_instance_cell"},{"line_number":461,"context_line":"    def _attach_volume(self, context, instance, volume, device,"},{"line_number":462,"context_line":"                       disk_bus, device_type, tag\u003dNone,"},{"line_number":463,"context_line":"                       supports_multiattach\u003dFalse, is_root\u003dFalse):"},{"line_number":464,"context_line":"        \"\"\"Attach an existing volume to an existing instance.\"\"\""},{"line_number":465,"context_line":"        if tag:"},{"line_number":466,"context_line":"            raise exception.VolumeTaggedAttachNotSupported()"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_3d5dc878","line":463,"range":{"start_line":463,"start_character":51,"end_line":463,"end_character":58},"in_reply_to":"9fdfeff1_0184315d","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                volume[\u0027id\u0027], device, disk_bus, device_type)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    @check_instance_cell"},{"line_number":477,"context_line":"    def _detach_volume(self, context, instance, volume, is_root\u003dFalse):"},{"line_number":478,"context_line":"        \"\"\"Detach a volume from an instance.\"\"\""},{"line_number":479,"context_line":"        self._cast_to_cells(context, instance, \u0027detach_volume\u0027,"},{"line_number":480,"context_line":"                volume)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_c1794982","line":477,"range":{"start_line":477,"start_character":56,"end_line":477,"end_character":63},"updated":"2019-02-25 17:32:51.000000000","message":"Should probably race something if this is True since cells v1 doesn\u0027t support detaching root volumes.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":474,"context_line":"                volume[\u0027id\u0027], device, disk_bus, device_type)"},{"line_number":475,"context_line":""},{"line_number":476,"context_line":"    @check_instance_cell"},{"line_number":477,"context_line":"    def _detach_volume(self, context, instance, volume, is_root\u003dFalse):"},{"line_number":478,"context_line":"        \"\"\"Detach a volume from an instance.\"\"\""},{"line_number":479,"context_line":"        self._cast_to_cells(context, instance, \u0027detach_volume\u0027,"},{"line_number":480,"context_line":"                volume)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_1d580488","line":477,"range":{"start_line":477,"start_character":56,"end_line":477,"end_character":63},"in_reply_to":"9fdfeff1_c1794982","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}],"nova/compute/vm_states.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":78,"context_line":"ALLOW_RESOURCE_REMOVAL \u003d [DELETED, SHELVED_OFFLOADED]"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"# states we allow detach/attach root volume in"},{"line_number":81,"context_line":"ALLOW_DETACH_ATTACH_ROOT \u003d [SHELVED, SHELVED_OFFLOADED, STOPPED]"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_618add64","line":81,"range":{"start_line":81,"start_character":28,"end_line":81,"end_character":35},"updated":"2019-02-25 17:32:51.000000000","message":"Not sure about this one, as mentioned earlier.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"1df97d33546e82aa6b4b4277675eb84f82c627e4","unresolved":false,"context_lines":[{"line_number":78,"context_line":"ALLOW_RESOURCE_REMOVAL \u003d [DELETED, SHELVED_OFFLOADED]"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"# states we allow detach/attach root volume in"},{"line_number":81,"context_line":"ALLOW_DETACH_ATTACH_ROOT \u003d [SHELVED, SHELVED_OFFLOADED, STOPPED]"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_bd79b8c5","line":81,"range":{"start_line":81,"start_character":28,"end_line":81,"end_character":35},"in_reply_to":"9fdfeff1_618add64","updated":"2019-02-26 08:52:26.000000000","message":"Done","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}],"nova/objects/block_device.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"798f25cca3680e0c1a49f98b968b85dfb1ca180a","unresolved":false,"context_lines":[{"line_number":70,"context_line":"    # Version 1.18: Added attachment_id"},{"line_number":71,"context_line":"    # Version 1.19: Added uuid"},{"line_number":72,"context_line":"    # Version 1.20: Added volume_type"},{"line_number":73,"context_line":"    # Version 1.21: Added is_multiattach()"},{"line_number":74,"context_line":"    VERSION \u003d \u00271.21\u0027"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    fields \u003d {"},{"line_number":77,"context_line":"        \u0027id\u0027: fields.IntegerField(),"}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_39c23888","line":74,"range":{"start_line":73,"start_character":4,"end_line":74,"end_character":20},"updated":"2019-03-04 15:05:30.000000000","message":"You don\u0027t need this since the new method isn\u0027t remotable.","commit_id":"fb80ec313b1da411d289c01d08cab5a9a1a7d383"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"798f25cca3680e0c1a49f98b968b85dfb1ca180a","unresolved":false,"context_lines":[{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    @property"},{"line_number":351,"context_line":"    def is_multi_attach(self):"},{"line_number":352,"context_line":"        return self.connection_info.get(\u0027multiattach\u0027, False)"},{"line_number":353,"context_line":""},{"line_number":354,"context_line":"    def get_image_mapping(self):"},{"line_number":355,"context_line":"        return block_device.BlockDeviceDict(self).get_image_mapping()"}],"source_content_type":"text/x-python","patch_set":24,"id":"9fdfeff1_f9bb500c","line":352,"range":{"start_line":352,"start_character":15,"end_line":352,"end_character":35},"updated":"2019-03-04 15:05:30.000000000","message":"This is a serialized json string so this isn\u0027t going to work.","commit_id":"fb80ec313b1da411d289c01d08cab5a9a1a7d383"}],"nova/tests/functional/api_sample_tests/test_volumes.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":384,"context_line":"        return dict(subs, tag\u003d\u0027foo\u0027)"},{"line_number":385,"context_line":""},{"line_number":386,"context_line":""},{"line_number":387,"context_line":"class VolumeAttachmentsSampleV270(VolumeAttachmentsSample):"},{"line_number":388,"context_line":"    sample_dir \u003d \"os-volumes\""},{"line_number":389,"context_line":"    microversion \u003d \u00272.70\u0027"},{"line_number":390,"context_line":"    scenarios \u003d [(\u0027v2_70\u0027, {\u0027api_major_version\u0027: \u0027v2.1\u0027})]"}],"source_content_type":"text/x-python","patch_set":11,"id":"9fdfeff1_21d7f54d","line":387,"range":{"start_line":387,"start_character":6,"end_line":387,"end_character":33},"updated":"2019-02-25 17:32:51.000000000","message":"You\u0027re probably going to want to extend https://review.openstack.org/#/c/631948/9/nova/tests/functional/api_sample_tests/test_volumes.py@399 once you rebase.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}],"nova/tests/functional/test_attach_detach_root_volume.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"047ac82dfe80c1193136f89d4eac671769375c74","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova.tests.functional import test_servers"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class DetachAttachRootVolumeTest(integrated_helpers.InstanceHelperMixin,"},{"line_number":24,"context_line":"                                 test_servers.ServersTestBase):"},{"line_number":25,"context_line":"    USE_NEUTRON \u003d True"},{"line_number":26,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_9528fb85","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":32},"updated":"2019-03-01 00:07:10.000000000","message":"We likely also need a test where the image backing the new root volume is different from the original volume and causes unshelve to fail, or at least indicate the new backing image was used for scheduler filtering. We have some tests that do this for rebuild so you could borrow from those by using the IsolatedHostsFilter. See TestBootFromVolumeIsolatedHostsFilter and RebuildVolumeBackedSameImage. Although I\u0027m not sure the IsolatedHostsFilter filter will work with a volume-backed server...","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56890e1930fd35391010d3ad37291cdacbd935f3","unresolved":false,"context_lines":[{"line_number":20,"context_line":"from nova.tests.functional import test_servers"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"class DetachAttachRootVolumeTest(integrated_helpers.InstanceHelperMixin,"},{"line_number":24,"context_line":"                                 test_servers.ServersTestBase):"},{"line_number":25,"context_line":"    USE_NEUTRON \u003d True"},{"line_number":26,"context_line":"    api_major_version \u003d \u0027v2.1\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_d5468350","line":23,"range":{"start_line":23,"start_character":6,"end_line":23,"end_character":32},"in_reply_to":"9fdfeff1_9528fb85","updated":"2019-03-01 00:10:35.000000000","message":"IsolatedHostsFilter might not work but AggregateImagePropertiesIsolation might work. You could have two images with different metadata. And then you have 2 compute hosts in separate aggregates, and each image is restricted to a specific aggregate via the metadata key. So when you create the server with image1 it goes in aggregate1 and when you unshelve with new image in the new root volume, the server goes in aggregate2.","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"660897db97307a10f246f948cb22b22754568348","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                if volume_id not in attached_vols:"},{"line_number":48,"context_line":"                    return"},{"line_number":49,"context_line":"            time.sleep(.1)"},{"line_number":50,"context_line":"        self.fail(\u0027Timed out waiting for volume %s to be attached to \u0027"},{"line_number":51,"context_line":"                  \u0027server %s. Currently attached volumes: %s\u0027 %"},{"line_number":52,"context_line":"                  (volume_id, server_id, attached_vols))"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_12dbc1ec","line":50,"range":{"start_line":50,"start_character":57,"end_line":50,"end_character":65},"updated":"2019-03-01 00:02:08.000000000","message":"this would be wrong if we\u0027re detaching","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"b1bce694a0800976ad268795caf8cc5dcae11c78","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                if volume_id not in attached_vols:"},{"line_number":48,"context_line":"                    return"},{"line_number":49,"context_line":"            time.sleep(.1)"},{"line_number":50,"context_line":"        self.fail(\u0027Timed out waiting for volume %s to be attached to \u0027"},{"line_number":51,"context_line":"                  \u0027server %s. Currently attached volumes: %s\u0027 %"},{"line_number":52,"context_line":"                  (volume_id, server_id, attached_vols))"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_50cce15f","line":50,"range":{"start_line":50,"start_character":57,"end_line":50,"end_character":65},"in_reply_to":"9fdfeff1_12dbc1ec","updated":"2019-03-01 02:17:41.000000000","message":"Done","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"660897db97307a10f246f948cb22b22754568348","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        server \u003d self._build_server(flavor_id, image\u003d\u0027\u0027)"},{"line_number":62,"context_line":"        server[\u0027imageRef\u0027] \u003d \u0027\u0027"},{"line_number":63,"context_line":"        volume_uuid \u003d nova_fixtures.CinderFixtureNewAttachFlow.IMAGE_BACKED_VOL"},{"line_number":64,"context_line":"        bdm \u003d {\u0027boot_index\u0027: 0,"},{"line_number":65,"context_line":"               \u0027uuid\u0027: volume_uuid,"},{"line_number":66,"context_line":"               \u0027source_type\u0027: \u0027volume\u0027,"},{"line_number":67,"context_line":"               \u0027destination_type\u0027: \u0027volume\u0027}"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_f2db9de6","line":64,"updated":"2019-03-01 00:02:08.000000000","message":"make this interesting by putting a tag on it","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"b1bce694a0800976ad268795caf8cc5dcae11c78","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        server \u003d self._build_server(flavor_id, image\u003d\u0027\u0027)"},{"line_number":62,"context_line":"        server[\u0027imageRef\u0027] \u003d \u0027\u0027"},{"line_number":63,"context_line":"        volume_uuid \u003d nova_fixtures.CinderFixtureNewAttachFlow.IMAGE_BACKED_VOL"},{"line_number":64,"context_line":"        bdm \u003d {\u0027boot_index\u0027: 0,"},{"line_number":65,"context_line":"               \u0027uuid\u0027: volume_uuid,"},{"line_number":66,"context_line":"               \u0027source_type\u0027: \u0027volume\u0027,"},{"line_number":67,"context_line":"               \u0027destination_type\u0027: \u0027volume\u0027}"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_10ebb9a3","line":64,"in_reply_to":"9fdfeff1_f2db9de6","updated":"2019-03-01 02:17:41.000000000","message":"I will fix the rest first and then add this when we have a conclusion on what to do on tags.","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"660897db97307a10f246f948cb22b22754568348","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        # detach the root volume"},{"line_number":102,"context_line":"        self.api.delete_server_volume(server_id, volume_uuid)"},{"line_number":103,"context_line":"        self._wait_for_volume_actions(server_id, volume_uuid, \u0027detach\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        # attach the root volume"},{"line_number":106,"context_line":"        self.api.post_server_volume("},{"line_number":107,"context_line":"            server_id, dict(volumeAttachment\u003ddict(volumeId\u003dvolume_uuid,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_52b4e981","line":104,"updated":"2019-03-01 00:02:08.000000000","message":"We should have a wrinkle where you try to attach a root volume that is not bootable since that should fail.\n\nWe should also have a wrinkle where you attach with a tag (or write a separate test that does the tags testing).","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"b1bce694a0800976ad268795caf8cc5dcae11c78","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        # detach the root volume"},{"line_number":102,"context_line":"        self.api.delete_server_volume(server_id, volume_uuid)"},{"line_number":103,"context_line":"        self._wait_for_volume_actions(server_id, volume_uuid, \u0027detach\u0027)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        # attach the root volume"},{"line_number":106,"context_line":"        self.api.post_server_volume("},{"line_number":107,"context_line":"            server_id, dict(volumeAttachment\u003ddict(volumeId\u003dvolume_uuid,"}],"source_content_type":"text/x-python","patch_set":21,"id":"9fdfeff1_9034894a","line":104,"in_reply_to":"9fdfeff1_52b4e981","updated":"2019-03-01 02:17:41.000000000","message":"I will have a test on bootable first and then deal with the tag once we have a final disicion on that.","commit_id":"86aebfec45b21fc75400b523f169cf0db984188f"}],"releasenotes/notes/bp-allow-attach-detach-root-volume-125313f69f7a0620.yaml":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Added support for detaching a root volume and attaching a root volume by"},{"line_number":5,"context_line":"    specify ``is_root\u003dTrue`` when attaching in microversion 2.70. These"},{"line_number":6,"context_line":"    actions will be only allowed to perform on instances in ``STOPPED``,"},{"line_number":7,"context_line":"    ``SHELVED`` and ``SHELVED_OFFLOADED`` status. If try to request ``START``"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9fdfeff1_61b89d10","line":4,"updated":"2019-02-25 17:32:51.000000000","message":"Same comments as earlier.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    Added support for detaching a root volume and attaching a root volume by"},{"line_number":5,"context_line":"    specify ``is_root\u003dTrue`` when attaching in microversion 2.70. These"},{"line_number":6,"context_line":"    actions will be only allowed to perform on instances in ``STOPPED``,"},{"line_number":7,"context_line":"    ``SHELVED`` and ``SHELVED_OFFLOADED`` status. If try to request ``START``"},{"line_number":8,"context_line":"    or ``UNSHELVE`` action on instances without ``root volume``, the"},{"line_number":9,"context_line":"    corresponding API will reply ``HTTP 403``."},{"line_number":10,"context_line":""}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9fdfeff1_4169d989","line":7,"range":{"start_line":7,"start_character":70,"end_line":7,"end_character":75},"updated":"2019-02-25 17:32:51.000000000","message":"os-start","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    specify ``is_root\u003dTrue`` when attaching in microversion 2.70. These"},{"line_number":6,"context_line":"    actions will be only allowed to perform on instances in ``STOPPED``,"},{"line_number":7,"context_line":"    ``SHELVED`` and ``SHELVED_OFFLOADED`` status. If try to request ``START``"},{"line_number":8,"context_line":"    or ``UNSHELVE`` action on instances without ``root volume``, the"},{"line_number":9,"context_line":"    corresponding API will reply ``HTTP 403``."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"    Added support for including the ``boot_index`` field in"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9fdfeff1_61fbbdbd","line":8,"range":{"start_line":8,"start_character":48,"end_line":8,"end_character":63},"updated":"2019-02-25 17:32:51.000000000","message":"``root volume`` doesn\u0027t need to be in back-ticks, just say \"without a root volume\"","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":5,"context_line":"    specify ``is_root\u003dTrue`` when attaching in microversion 2.70. These"},{"line_number":6,"context_line":"    actions will be only allowed to perform on instances in ``STOPPED``,"},{"line_number":7,"context_line":"    ``SHELVED`` and ``SHELVED_OFFLOADED`` status. If try to request ``START``"},{"line_number":8,"context_line":"    or ``UNSHELVE`` action on instances without ``root volume``, the"},{"line_number":9,"context_line":"    corresponding API will reply ``HTTP 403``."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"    Added support for including the ``boot_index`` field in"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9fdfeff1_210a95d1","line":8,"range":{"start_line":8,"start_character":9,"end_line":8,"end_character":17},"updated":"2019-02-25 17:32:51.000000000","message":"unshelve","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":6,"context_line":"    actions will be only allowed to perform on instances in ``STOPPED``,"},{"line_number":7,"context_line":"    ``SHELVED`` and ``SHELVED_OFFLOADED`` status. If try to request ``START``"},{"line_number":8,"context_line":"    or ``UNSHELVE`` action on instances without ``root volume``, the"},{"line_number":9,"context_line":"    corresponding API will reply ``HTTP 403``."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"    Added support for including the ``boot_index`` field in"},{"line_number":12,"context_line":"    ``GET /servers/{server_id}/os-volume_attachments`` and"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9fdfeff1_c1238957","line":9,"range":{"start_line":9,"start_character":40,"end_line":9,"end_character":43},"updated":"2019-02-25 17:32:51.000000000","message":"409","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c3cb2c26b91ef505a086cf21379890c93c3ca758","unresolved":false,"context_lines":[{"line_number":8,"context_line":"    or ``UNSHELVE`` action on instances without ``root volume``, the"},{"line_number":9,"context_line":"    corresponding API will reply ``HTTP 403``."},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"    Added support for including the ``boot_index`` field in"},{"line_number":12,"context_line":"    ``GET /servers/{server_id}/os-volume_attachments`` and"},{"line_number":13,"context_line":"    ``GET /servers/{server_id}/os-volume_attachments/{volume_id}`` API."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"9fdfeff1_e1280d34","line":11,"updated":"2019-02-25 17:32:51.000000000","message":"POST would also be in this I would think.","commit_id":"babb3d5cd104ebf47c53a1ea07db3a1a74bb27e9"}]}
