)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"9adff5b0cd1a203d94125c5a60f511a9a40ff568","unresolved":false,"context_lines":[{"line_number":14,"context_line":"(attaching_volume, detaching_volume, attaching_interface,"},{"line_number":15,"context_line":"detaching_interface) into the instance life cycle."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"blueprint task-states-improvement"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ie53c71373269ffe732866da4e6cce7ded3a7b234"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a2fa921_6bfdfe6c","line":17,"updated":"2015-10-09 09:06:20.000000000","message":"We need add APIImpact flag at here. This spec includes API change.","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"8620f5bbdb856ebbf2e972dd7020b62d7e327344","unresolved":false,"context_lines":[{"line_number":14,"context_line":"(attaching_volume, detaching_volume, attaching_interface,"},{"line_number":15,"context_line":"detaching_interface) into the instance life cycle."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"blueprint task-states-improvement"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Change-Id: Ie53c71373269ffe732866da4e6cce7ded3a7b234"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"7a2fa921_89b2bb4a","line":17,"in_reply_to":"7a2fa921_6bfdfe6c","updated":"2015-10-10 06:52:18.000000000","message":"Done","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"}],"specs/mitaka/approved/avoid-parallel-conflicting-api-operations.rst":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2eea5ff55e9770e7fd2c01dd512670d8161b2012","unresolved":false,"context_lines":[{"line_number":74,"context_line":"action should be \"pending\". And we should consider a special case, if the host"},{"line_number":75,"context_line":"abnormally died during updating action event, the unfinished instance action"},{"line_number":76,"context_line":"exist in DB, aims to avoid this type \"unfinished\" instance action block rebuild"},{"line_number":77,"context_line":"API forever, a new configure option \"api_block_timeout\" should been added, if"},{"line_number":78,"context_line":"instance_action.start_time + CONF.api_block_timeout \u003e now, the rebuild should"},{"line_number":79,"context_line":"been executed even if the parallel instance actions are \"unfinished\"."},{"line_number":80,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_f65d267a","line":77,"range":{"start_line":77,"start_character":13,"end_line":77,"end_character":73},"updated":"2015-11-20 21:26:36.000000000","message":"Meh, it sounds like a hack, I wonder if we could rather find another way to make sure that an instance_action is not currently running... To be clear, I prefer the Tasks model that I\u0027m writing on, but I don\u0027t really want to have this spec waiting for Tasks - we should be very clear IMHO that using instance_actions is just a hack for the moment.","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"92393c18e86dde69ae9a6cd2eeb2db2d4fd43b76","unresolved":false,"context_lines":[{"line_number":74,"context_line":"action should be \"pending\". And we should consider a special case, if the host"},{"line_number":75,"context_line":"abnormally died during updating action event, the unfinished instance action"},{"line_number":76,"context_line":"exist in DB, aims to avoid this type \"unfinished\" instance action block rebuild"},{"line_number":77,"context_line":"API forever, a new configure option \"api_block_timeout\" should been added, if"},{"line_number":78,"context_line":"instance_action.start_time + CONF.api_block_timeout \u003e now, the rebuild should"},{"line_number":79,"context_line":"been executed even if the parallel instance actions are \"unfinished\"."},{"line_number":80,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_8be7a911","line":77,"in_reply_to":"ba8a016a_f65d267a","updated":"2015-11-23 08:41:24.000000000","message":"Agree instance actions just a hack, Tasks might a better way to identify whether the workflow is finished. If Tasks is completed in the future, we can enhance this part code by using Tasks.","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1de5698ebd3f5a9275d9f58d77dae9bbf737e78c","unresolved":false,"context_lines":[{"line_number":87,"context_line":"scope of specification, if other APIs need to make use of this common"},{"line_number":88,"context_line":"mechanism, we can implement it in separate patch in the future."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"Alternatives"},{"line_number":92,"context_line":"------------"},{"line_number":93,"context_line":""}],"source_content_type":"text/x-rst","patch_set":9,"id":"9a8ffd7b_4c71bc43","line":90,"updated":"2015-12-01 20:29:18.000000000","message":"I really think that using instance_actions as locks is the wrong approach.  We already have issues with using task_states for the same thing and this just introduces a second place to encounter the same issues, and potentially worse.  For example there is no clear way to know when an instance_action has finished.  An error state is terminal but an instance_action is in a success state until it errors, success does not mean it\u0027s done.  So with this proposal we\u0027re just making a bet that the operation is done within CONF.api_block_timeout.\n\nThere are multiple long term efforts, Tasks or distributed lock manager, that can help solve this and ideally this effort would go towards shortening the timeframe on one of them.\n\nExcept for the shelved case it sounds like this could be addressed by ensuring all of these operations on compute are serialized with locks and that resource are refreshed when the lock is taken.  But dealing with shelved instances could be pulled out into a separate spec and discussed there.  Like, perhaps we synchronize actions through the host the instance was on before being shelved.","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"954ac127d7aa8f16bbe1c84a613e7d790986766f","unresolved":false,"context_lines":[{"line_number":123,"context_line":"swapping-volume, attaching-interface, detaching-interface."},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"Adding the new task states make instance life cycle more complex, that is"},{"line_number":126,"context_line":"creating more debt, just describe it as an alternative."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"Data model impact"},{"line_number":129,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_3fee33b5","line":126,"updated":"2015-11-20 11:57:26.000000000","message":"I\u0027m really concerned about the deadlock case here, because effectively you are now taking a lock for a long running operation. What happens if that lock is not released, even though the bulk of it\u0027s work is done.\n\nThat means you need to also expose an API for breaking the lock, because these instances are actually unable to be acted upon.\n\nHonestly, thinking about it now, it might actually just be better to be explicit about it and extend the locked interface for a server to say that it\u0027s locked for the following actions: live-migration, and that nova can continue to make changes for it, but the user can not, until nova unlocks it.","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2eea5ff55e9770e7fd2c01dd512670d8161b2012","unresolved":false,"context_lines":[{"line_number":123,"context_line":"swapping-volume, attaching-interface, detaching-interface."},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"Adding the new task states make instance life cycle more complex, that is"},{"line_number":126,"context_line":"creating more debt, just describe it as an alternative."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"Data model impact"},{"line_number":129,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_f60f6686","line":126,"in_reply_to":"ba8a016a_3fee33b5","updated":"2015-11-20 21:26:36.000000000","message":"That\u0027s a good point. We probably need to consider and explain further when and where the instance_actions could be persisted vs. when and where they are checked.\n\nI also like Sean\u0027s idea of using the current lock API internally for that. Maybe it could be good alternative to comment.","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"92393c18e86dde69ae9a6cd2eeb2db2d4fd43b76","unresolved":false,"context_lines":[{"line_number":123,"context_line":"swapping-volume, attaching-interface, detaching-interface."},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"Adding the new task states make instance life cycle more complex, that is"},{"line_number":126,"context_line":"creating more debt, just describe it as an alternative."},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"Data model impact"},{"line_number":129,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_4be541a6","line":126,"in_reply_to":"ba8a016a_f60f6686","updated":"2015-11-23 08:41:24.000000000","message":"I purpose to add new option CONF.api_block_timeout, that can resolved the deadlock issue more or less that had been described in \"Proposed change\", and if the Tasks complete in the future, that might a better mechanism to identify whether the workflow is finished, we can replace instance actions by Tasks.\n\nAgree that making use of lock interface is a good idea, but it might break the backwards compatibility of the API, for example, if we add lock in attaching_volume to avoid the rebuild in parallel, the lock would block all the concurrent attaching_volume requests at the same time, attaching multiple volumes on one server in parallel is supported in current nova.\n\nNow instance actions are persisted in each API request, and instance actions would be checked only in 6 API microversion (rebuild, resize, migrate, live-migration, shelved, unshelved) if the BP can be approved.","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"954ac127d7aa8f16bbe1c84a613e7d790986766f","unresolved":false,"context_lines":[{"line_number":138,"context_line":"   microversion."},{"line_number":139,"context_line":"2. These related APIs(rebuild, resize, migrate, live-migration, shelved,"},{"line_number":140,"context_line":"   unshelved) will raise HTTP 403 Forbidden exception, that should be added"},{"line_number":141,"context_line":"   into @extensions.expected_errors()."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"Security impact"}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_7f783b2c","line":141,"updated":"2015-11-20 11:57:26.000000000","message":"409 conflict is probably better.","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2eea5ff55e9770e7fd2c01dd512670d8161b2012","unresolved":false,"context_lines":[{"line_number":138,"context_line":"   microversion."},{"line_number":139,"context_line":"2. These related APIs(rebuild, resize, migrate, live-migration, shelved,"},{"line_number":140,"context_line":"   unshelved) will raise HTTP 403 Forbidden exception, that should be added"},{"line_number":141,"context_line":"   into @extensions.expected_errors()."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"Security impact"}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_96c93a5d","line":141,"in_reply_to":"ba8a016a_7f783b2c","updated":"2015-11-20 21:26:36.000000000","message":"Agreed, it\u0027s rather a Conflict","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"92393c18e86dde69ae9a6cd2eeb2db2d4fd43b76","unresolved":false,"context_lines":[{"line_number":138,"context_line":"   microversion."},{"line_number":139,"context_line":"2. These related APIs(rebuild, resize, migrate, live-migration, shelved,"},{"line_number":140,"context_line":"   unshelved) will raise HTTP 403 Forbidden exception, that should be added"},{"line_number":141,"context_line":"   into @extensions.expected_errors()."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"Security impact"}],"source_content_type":"text/x-rst","patch_set":9,"id":"ba8a016a_eba75509","line":141,"in_reply_to":"ba8a016a_7f783b2c","updated":"2015-11-23 08:41:24.000000000","message":"Done, thank you","commit_id":"4eb7b38d10c56dbda601747e0a853690e6da712c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5cedbf940dc110713a13278ceb4deb13af0d3249","unresolved":false,"context_lines":[{"line_number":20,"context_line":"Currently when we attach/detach volume and network interface from instance,"},{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. In some API concurrent requests scenarios the operation results are"},{"line_number":24,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":25,"context_line":"   rebuilding-instance and detaching-volume for the same instance. Because"},{"line_number":26,"context_line":"   task_state of instance isn\u0027t set when detaching volume,"}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_71e7b912","line":23,"updated":"2015-12-01 20:14:35.000000000","message":"Since there is no \"2\" I think you should remove and dedent this.","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5cedbf940dc110713a13278ceb4deb13af0d3249","unresolved":false,"context_lines":[{"line_number":47,"context_line":"Use Cases"},{"line_number":48,"context_line":"---------"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"1. Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":51,"context_line":"   and have been recorded in instance actions. The other concurrent conflicting"},{"line_number":52,"context_line":"   API requests will be denied, because these API operations can\u0027t be executed"},{"line_number":53,"context_line":"   at the same time. The end users should be notified by raising exception from"}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_d1b6a5f8","line":50,"updated":"2015-12-01 20:14:35.000000000","message":"Here too.","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5cedbf940dc110713a13278ceb4deb13af0d3249","unresolved":false,"context_lines":[{"line_number":48,"context_line":"---------"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"1. Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":51,"context_line":"   and have been recorded in instance actions. The other concurrent conflicting"},{"line_number":52,"context_line":"   API requests will be denied, because these API operations can\u0027t be executed"},{"line_number":53,"context_line":"   at the same time. The end users should be notified by raising exception from"},{"line_number":54,"context_line":"   API, let them know they are doing some wrong things."}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_319ff160","line":51,"range":{"start_line":51,"start_character":29,"end_line":51,"end_character":45},"updated":"2015-12-01 20:14:35.000000000","message":"We\u0027re not going to query the actions to determine whether we can start the thing or not. I think you meant task_state here?","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5cedbf940dc110713a13278ceb4deb13af0d3249","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"When the instance start to do rebuild, we should check whether the concurrent"},{"line_number":61,"context_line":"conflicting API requests execute on the same instance in API layer. All the"},{"line_number":62,"context_line":"API actions that happen on an instance should been recorded in"},{"line_number":63,"context_line":"\"instance actions\" table, that can be used to identify the parallel API"},{"line_number":64,"context_line":"requests. If there are any pending \"instance actions\", for example: attaching"},{"line_number":65,"context_line":"volume, a HTTP 409 Conflict exception should be raised, if no pending"},{"line_number":66,"context_line":"\"instance actions\", the rebuild continue to execute like as before. If some API"},{"line_number":67,"context_line":"actions don\u0027t present in instance actions, these should been added. That don\u0027t"}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_314931d1","line":64,"range":{"start_line":62,"start_character":0,"end_line":64,"end_character":9},"updated":"2015-12-01 20:14:35.000000000","message":"I think this is a terrible idea. It\u0027s way too much data, too racy, etc. We have task_state for this purpose and we should use it.","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5cedbf940dc110713a13278ceb4deb13af0d3249","unresolved":false,"context_lines":[{"line_number":80,"context_line":""},{"line_number":81,"context_line":"All the proposed changes will only impact 6 APIs(rebuild, resize, migrate,"},{"line_number":82,"context_line":"live-migration, shelved, unshelved), these changes can be safely hidden in a"},{"line_number":83,"context_line":"microversion."},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"Notes: we will build a common mechanism to identify the parallel API requests,"},{"line_number":86,"context_line":"rebuild/resize/migrate/live-migration/shelved/unshelved API are included in the"}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_117c2dea","line":83,"updated":"2015-12-01 20:14:35.000000000","message":"I don\u0027t see this. I don\u0027t think we should have a microversion for \"fixed a race\". Otherwise people that don\u0027t request that version are implicitly asking for the racy behavior.\n\nWe already lock on task_state for a lot of API calls. Adding these to that list doesn\u0027t require an API change I don\u0027t think. 409 Conflict should be reasonable return codes for all those calls, right?","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5cedbf940dc110713a13278ceb4deb13af0d3249","unresolved":false,"context_lines":[{"line_number":91,"context_line":"Alternatives"},{"line_number":92,"context_line":"------------"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"Adds 5 task states (attaching_volume, detaching_volume, swapping_volume,"},{"line_number":95,"context_line":"attaching_interface, detaching_interface) into the instance life cycle. Set the"},{"line_number":96,"context_line":"instance.task_state as \u0027attaching_volume\u0027 in compute/api.py and assert the"},{"line_number":97,"context_line":"current task_state is None when we attach a volume to the instance, like this::"}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_f15f2973","line":94,"updated":"2015-12-01 20:14:35.000000000","message":"Yes, do this!","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"2d1487e6c0bf66d1767b3162ca856cb3e9e13861","unresolved":false,"context_lines":[{"line_number":91,"context_line":"Alternatives"},{"line_number":92,"context_line":"------------"},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"Adds 5 task states (attaching_volume, detaching_volume, swapping_volume,"},{"line_number":95,"context_line":"attaching_interface, detaching_interface) into the instance life cycle. Set the"},{"line_number":96,"context_line":"instance.task_state as \u0027attaching_volume\u0027 in compute/api.py and assert the"},{"line_number":97,"context_line":"current task_state is None when we attach a volume to the instance, like this::"}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_6df1fe69","line":94,"in_reply_to":"9a8ffd7b_f15f2973","updated":"2015-12-02 10:46:56.000000000","message":"I pretty much agree with Dan because we already have all the infra to do this in a non racy way (expected_task_state kw arg to save) and we are actually using it.\n\nTBH I am not really sure this needs a spec at all, as we definitely don\u0027t want a microversion for this (as commented above).\n\nThis is basically a bugfix completely described here https://bugs.launchpad.net/nova/+bug/1275144","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"2d1487e6c0bf66d1767b3162ca856cb3e9e13861","unresolved":false,"context_lines":[{"line_number":118,"context_line":"present in one deployment, we should set these task_states only when the"},{"line_number":119,"context_line":"version of target host is matched with API."},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":122,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":123,"context_line":"swapping-volume, attaching-interface, detaching-interface."},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"Adding the new task states make instance life cycle more complex, that is"},{"line_number":126,"context_line":"creating more debt, just describe it as an alternative."}],"source_content_type":"text/x-rst","patch_set":10,"id":"9a8ffd7b_cd5eea44","line":123,"range":{"start_line":121,"start_character":0,"end_line":123,"end_character":57},"updated":"2015-12-02 10:46:56.000000000","message":"This bit (as Dan pointed out on IRC yesterday) is a bit tricky and we should probably have a proper discussion on how to do this and make sure we clear all the states.\n\nI still don\u0027t think we want to block this work with the spec freeze because there is some complex-ish thinking that needs to happen. I propose to defer to email/code and go ahead with this approach (and not the one you propose here) as a series of bugfixes.","commit_id":"8ceff316d0e812ca6e0540475a485adb4d58a292"}],"specs/mitaka/approved/task-states-improvement.rst":[{"author":{"_account_id":7133,"name":"Ryan Moore","email":"ryan.moore@hpe.com","username":"moory"},"change_message_id":"bcb63a5aad868244a568c48912f35143dd61f47b","unresolved":false,"context_lines":[{"line_number":20,"context_line":"Currently when we attach/detach volume and network interface from instance,"},{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have on idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_27f332a0","line":23,"updated":"2015-09-15 14:25:17.000000000","message":"s/on/no","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"5cdfe2381e749f4518b15c8f011c088061ae8c18","unresolved":false,"context_lines":[{"line_number":20,"context_line":"Currently when we attach/detach volume and network interface from instance,"},{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have on idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_5944bbb5","line":23,"in_reply_to":"ba15a1d1_27f332a0","updated":"2015-09-17 03:51:07.000000000","message":"Done","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":7133,"name":"Ryan Moore","email":"ryan.moore@hpe.com","username":"moory"},"change_message_id":"bcb63a5aad868244a568c48912f35143dd61f47b","unresolved":false,"context_lines":[{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and attaching-volume for the instance."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Use Cases"},{"line_number":30,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_87223e00","line":27,"updated":"2015-09-15 14:25:17.000000000","message":"is this sentence complete? does not read sensibly.","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"5cdfe2381e749f4518b15c8f011c088061ae8c18","unresolved":false,"context_lines":[{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and attaching-volume for the instance."},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"Use Cases"},{"line_number":30,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_d9852bcf","line":27,"in_reply_to":"ba15a1d1_87223e00","updated":"2015-09-17 03:51:07.000000000","message":"Sorry, I will modify the describe to more clear.","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":7133,"name":"Ryan Moore","email":"ryan.moore@hpe.com","username":"moory"},"change_message_id":"bcb63a5aad868244a568c48912f35143dd61f47b","unresolved":false,"context_lines":[{"line_number":29,"context_line":"Use Cases"},{"line_number":30,"context_line":"---------"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"1. End users attach/detach volume and network interface to instance, they can"},{"line_number":33,"context_line":"   know which operation is in progress according to task state of the instance."},{"line_number":34,"context_line":"2. In API concurrent requests scenarios, some API requests will be denied,"},{"line_number":35,"context_line":"   because another operation is underway, these API operations can\u0027t be"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_675fea41","line":32,"updated":"2015-09-15 14:25:17.000000000","message":"As an end user while performing volume/network_interface attach/detach actions I would like to determine which operation is in progress from the task_state of the instance.","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"5cdfe2381e749f4518b15c8f011c088061ae8c18","unresolved":false,"context_lines":[{"line_number":29,"context_line":"Use Cases"},{"line_number":30,"context_line":"---------"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"1. End users attach/detach volume and network interface to instance, they can"},{"line_number":33,"context_line":"   know which operation is in progress according to task state of the instance."},{"line_number":34,"context_line":"2. In API concurrent requests scenarios, some API requests will be denied,"},{"line_number":35,"context_line":"   because another operation is underway, these API operations can\u0027t be"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_19ce432e","line":32,"in_reply_to":"ba15a1d1_675fea41","updated":"2015-09-17 03:51:07.000000000","message":"yes, it make sense, it\u0027s not implemented in the current nova, so I push this spec.","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":7133,"name":"Ryan Moore","email":"ryan.moore@hpe.com","username":"moory"},"change_message_id":"bcb63a5aad868244a568c48912f35143dd61f47b","unresolved":false,"context_lines":[{"line_number":94,"context_line":"Other end user impact"},{"line_number":95,"context_line":"---------------------"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"Four new task states will be exported to end users, and python-novaclient don\u0027t"},{"line_number":98,"context_line":"need to be modified."},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"Performance Impact"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_199c52bf","line":97,"updated":"2015-09-15 14:25:17.000000000","message":"s/don\u0027t/doesn\u0027t","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"5cdfe2381e749f4518b15c8f011c088061ae8c18","unresolved":false,"context_lines":[{"line_number":94,"context_line":"Other end user impact"},{"line_number":95,"context_line":"---------------------"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"Four new task states will be exported to end users, and python-novaclient don\u0027t"},{"line_number":98,"context_line":"need to be modified."},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"Performance Impact"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_b9ce372b","line":97,"in_reply_to":"ba15a1d1_199c52bf","updated":"2015-09-17 03:51:07.000000000","message":"Done","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":7133,"name":"Ryan Moore","email":"ryan.moore@hpe.com","username":"moory"},"change_message_id":"bcb63a5aad868244a568c48912f35143dd61f47b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"Work Items"},{"line_number":127,"context_line":"----------"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"1. Adds 4 new task_state into task_states.py (attaching_volume,"},{"line_number":130,"context_line":"   detaching_volume, attaching_interface, detaching_interface)"},{"line_number":131,"context_line":"2. Update the instance.task_state to related value at the beginning of"},{"line_number":132,"context_line":"   attach/detach operation method in compute/api.py."}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_f9a87edd","line":129,"updated":"2015-09-15 14:25:17.000000000","message":"s/Adds/Add","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"5cdfe2381e749f4518b15c8f011c088061ae8c18","unresolved":false,"context_lines":[{"line_number":126,"context_line":"Work Items"},{"line_number":127,"context_line":"----------"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"1. Adds 4 new task_state into task_states.py (attaching_volume,"},{"line_number":130,"context_line":"   detaching_volume, attaching_interface, detaching_interface)"},{"line_number":131,"context_line":"2. Update the instance.task_state to related value at the beginning of"},{"line_number":132,"context_line":"   attach/detach operation method in compute/api.py."}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_d9d3ebd3","line":129,"in_reply_to":"ba15a1d1_f9a87edd","updated":"2015-09-17 03:51:07.000000000","message":"Done","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":7133,"name":"Ryan Moore","email":"ryan.moore@hpe.com","username":"moory"},"change_message_id":"bcb63a5aad868244a568c48912f35143dd61f47b","unresolved":false,"context_lines":[{"line_number":130,"context_line":"   detaching_volume, attaching_interface, detaching_interface)"},{"line_number":131,"context_line":"2. Update the instance.task_state to related value at the beginning of"},{"line_number":132,"context_line":"   attach/detach operation method in compute/api.py."},{"line_number":133,"context_line":"3. Update the instance.task_state to None when these operations success in"},{"line_number":134,"context_line":"   compute/manager.py"},{"line_number":135,"context_line":"4. Adds the decorator @reverts_task_state on the attach/detach_* methods."},{"line_number":136,"context_line":"5. Update the related unit testes and add some new test cases to cover the new"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_1983f257","line":133,"updated":"2015-09-15 14:25:17.000000000","message":"operations are successful","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"5cdfe2381e749f4518b15c8f011c088061ae8c18","unresolved":false,"context_lines":[{"line_number":130,"context_line":"   detaching_volume, attaching_interface, detaching_interface)"},{"line_number":131,"context_line":"2. Update the instance.task_state to related value at the beginning of"},{"line_number":132,"context_line":"   attach/detach operation method in compute/api.py."},{"line_number":133,"context_line":"3. Update the instance.task_state to None when these operations success in"},{"line_number":134,"context_line":"   compute/manager.py"},{"line_number":135,"context_line":"4. Adds the decorator @reverts_task_state on the attach/detach_* methods."},{"line_number":136,"context_line":"5. Update the related unit testes and add some new test cases to cover the new"}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_79ddffde","line":133,"in_reply_to":"ba15a1d1_1983f257","updated":"2015-09-17 03:51:07.000000000","message":"Done","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":7133,"name":"Ryan Moore","email":"ryan.moore@hpe.com","username":"moory"},"change_message_id":"bcb63a5aad868244a568c48912f35143dd61f47b","unresolved":false,"context_lines":[{"line_number":133,"context_line":"3. Update the instance.task_state to None when these operations success in"},{"line_number":134,"context_line":"   compute/manager.py"},{"line_number":135,"context_line":"4. Adds the decorator @reverts_task_state on the attach/detach_* methods."},{"line_number":136,"context_line":"5. Update the related unit testes and add some new test cases to cover the new"},{"line_number":137,"context_line":"   logic."},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_59916a98","line":136,"updated":"2015-09-15 14:25:17.000000000","message":"s/testes/tests","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"5cdfe2381e749f4518b15c8f011c088061ae8c18","unresolved":false,"context_lines":[{"line_number":133,"context_line":"3. Update the instance.task_state to None when these operations success in"},{"line_number":134,"context_line":"   compute/manager.py"},{"line_number":135,"context_line":"4. Adds the decorator @reverts_task_state on the attach/detach_* methods."},{"line_number":136,"context_line":"5. Update the related unit testes and add some new test cases to cover the new"},{"line_number":137,"context_line":"   logic."},{"line_number":138,"context_line":""},{"line_number":139,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"ba15a1d1_99da53e7","line":136,"in_reply_to":"ba15a1d1_59916a98","updated":"2015-09-17 03:51:07.000000000","message":"Done","commit_id":"3a2d4f5e153c0c60308934eac331bc1e0a144c0f"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"227d021ab67e0575e1fa955a96d636547cb4ba8d","unresolved":false,"context_lines":[{"line_number":28,"context_line":"   task_state of instance isn\u0027t set when attaching volume,"},{"line_number":29,"context_line":"   @check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":30,"context_line":"   and attaching-volume on one instance at the same time, it cause the"},{"line_number":31,"context_line":"   unpredictable result."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Use Cases"},{"line_number":34,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a1a9d01_ed730d4c","line":31,"updated":"2015-09-25 09:55:27.000000000","message":"can you add some real examples?\nWhich problems are you trying to solve adding those new task states?","commit_id":"c0012693b9924b81126f03ba9b8066cae4acd339"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6636f7ff808cbab93517fdbf2d1ae2a5afff8d61","unresolved":false,"context_lines":[{"line_number":28,"context_line":"   task_state of instance isn\u0027t set when attaching volume,"},{"line_number":29,"context_line":"   @check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":30,"context_line":"   and attaching-volume on one instance at the same time, it cause the"},{"line_number":31,"context_line":"   unpredictable result."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Use Cases"},{"line_number":34,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a1a9d01_49c99677","line":31,"in_reply_to":"9a1a9d01_ed730d4c","updated":"2015-09-28 09:19:10.000000000","message":"I had shared my real example in above describe, I do API concurrent request rebuilding instance and attaching-volume. The two operations will be executed on one instance in compute driver at the same time. It might cause unpredictable result and we should do these task one by one.","commit_id":"c0012693b9924b81126f03ba9b8066cae4acd339"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"9d52e4da740de159f9d858d995552b7937e98322","unresolved":false,"context_lines":[{"line_number":40,"context_line":"   executed at the same time. The end users should be notified by raising some"},{"line_number":41,"context_line":"   exceptions from API, let them know they are doing some wrong things, it"},{"line_number":42,"context_line":"   might cause unpredictable and inconclusive result, like: do the concurrent"},{"line_number":43,"context_line":"   operation rebuilding-instance and attaching-volume for the instance"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Project Priority"},{"line_number":46,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a1a9d01_0db0c142","line":43,"updated":"2015-09-25 09:54:33.000000000","message":"please can you report which will be the denied operations according to the new task states?","commit_id":"c0012693b9924b81126f03ba9b8066cae4acd339"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6636f7ff808cbab93517fdbf2d1ae2a5afff8d61","unresolved":false,"context_lines":[{"line_number":40,"context_line":"   executed at the same time. The end users should be notified by raising some"},{"line_number":41,"context_line":"   exceptions from API, let them know they are doing some wrong things, it"},{"line_number":42,"context_line":"   might cause unpredictable and inconclusive result, like: do the concurrent"},{"line_number":43,"context_line":"   operation rebuilding-instance and attaching-volume for the instance"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"Project Priority"},{"line_number":46,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a1a9d01_5fbaa40b","line":43,"in_reply_to":"9a1a9d01_0db0c142","updated":"2015-09-28 09:19:10.000000000","message":"In API concurrent requests scenarios, the request had set the instance task state in the first would continue to execute, and the others will be denied according to the setting of decorator \u0027check_instance_state\u0027.\n\nI will update the describe, make it more easy to understand","commit_id":"c0012693b9924b81126f03ba9b8066cae4acd339"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"9d52e4da740de159f9d858d995552b7937e98322","unresolved":false,"context_lines":[{"line_number":139,"context_line":"4. Add the decorator @reverts_task_state on the attach/detach_* methods."},{"line_number":140,"context_line":"5. Update the related unit tests and add some new test cases to cover the new"},{"line_number":141,"context_line":"   logic."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"Dependencies"},{"line_number":145,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a1a9d01_6d14ddf4","line":142,"updated":"2015-09-25 09:54:33.000000000","message":"I think you missed the for updating the allowed operations according to the new task states","commit_id":"c0012693b9924b81126f03ba9b8066cae4acd339"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6636f7ff808cbab93517fdbf2d1ae2a5afff8d61","unresolved":false,"context_lines":[{"line_number":139,"context_line":"4. Add the decorator @reverts_task_state on the attach/detach_* methods."},{"line_number":140,"context_line":"5. Update the related unit tests and add some new test cases to cover the new"},{"line_number":141,"context_line":"   logic."},{"line_number":142,"context_line":""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"Dependencies"},{"line_number":145,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9a1a9d01_7f6e8830","line":142,"in_reply_to":"9a1a9d01_6d14ddf4","updated":"2015-09-28 09:19:10.000000000","message":"I will add some describe in work item #2, make reviewers know that in which case the API request might be denied.","commit_id":"c0012693b9924b81126f03ba9b8066cae4acd339"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dd8a1539cfc4bdf8ae8beeb36476bdbdc3dea3d3","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and attaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_8551b310","line":24,"updated":"2015-09-28 19:45:40.000000000","message":"Representing this with new task states is the wrong approach I think. Instance actions is a much better place, and eventually generic tasks.","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"f71685cc0cf046be51fe5560df2c05d619861cb4","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and attaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_b225db09","line":24,"in_reply_to":"9a1a9d01_52c33657","updated":"2015-09-30 02:12:50.000000000","message":"I do a double-check on current master branch, attaching/detaching volume/interface API don\u0027t record instance action and action event, even if it do, I think it\u0027s not convenient for operators, because the tasks execute on the instance would be split into two different data source (task state and instance action), rebuiding is present in task state, but attaching-volume come from instance action.\n\nAnd the most important is that setting task state can solve the concurrent issue in the following describe.","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"7d9c6a551ec93a9795ee7101e45d35c387d48d90","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and attaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_86bd2fb9","line":24,"in_reply_to":"9a1a9d01_8551b310","updated":"2015-09-29 03:50:38.000000000","message":"I think the operations of attaching/detaching volume/interface from an instance should be showed to end users, that can make the users have a clear knowing that what happen on instance currently, task state is a suitable place, because that match the design target of task state. On the other hand the reason of adding these task state is clarified in my following comments","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5de4e4a688e9c5ca22eece92aa059d98c004aea1","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and attaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_52c33657","line":24,"in_reply_to":"9a1a9d01_86bd2fb9","updated":"2015-09-29 15:24:59.000000000","message":"But the operations are visible to the user via instance actions.\n\nI understand that task_state is a seemingly-easy and high-visibility place to add it, but it comes with added complexity everywhere else that needs to now account for a new task state, including the clients.","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dd8a1539cfc4bdf8ae8beeb36476bdbdc3dea3d3","unresolved":false,"context_lines":[{"line_number":28,"context_line":"   task_state of instance isn\u0027t set when attaching volume,"},{"line_number":29,"context_line":"   @check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":30,"context_line":"   and attaching-volume on one instance at the same time, it cause the"},{"line_number":31,"context_line":"   unpredictable result, we should do these tasks one by one."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Use Cases"},{"line_number":34,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_e5b0af45","line":31,"updated":"2015-09-28 19:45:40.000000000","message":"Can you describe what the unpredictable result is? I think this should be allowed, and whether we attach first or start rebuild first, the rebuilt instance should come back with the new volume/interface. If we have actual races in nova-compute, then synchronizing on the instance uuid is probably all we need.","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"7d9c6a551ec93a9795ee7101e45d35c387d48d90","unresolved":false,"context_lines":[{"line_number":28,"context_line":"   task_state of instance isn\u0027t set when attaching volume,"},{"line_number":29,"context_line":"   @check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":30,"context_line":"   and attaching-volume on one instance at the same time, it cause the"},{"line_number":31,"context_line":"   unpredictable result, we should do these tasks one by one."},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"Use Cases"},{"line_number":34,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_e6c66b99","line":31,"in_reply_to":"9a1a9d01_e5b0af45","updated":"2015-09-29 03:50:38.000000000","message":"Sorry, I will update the describe to add a clear case.\n\nThink about the following operation sequence.\n\n1. start to detach volume from instance in nova-api\n\n2. start to rebuild instance in nova-api, get the instance bdms from db, because the detaching volume don\u0027t finish, so the bdms contain the volume that will be detached.\n\n3. start to detach volume from instance in nova-compute, and detaching finish successfully, the bdm of this volume is destroyed.\n\n4. start to rebuild the instance in nova-compute, try to detach all the volumes according to the bdms that pass through from nova-api and contain the volume had been detached. That would be failed, because the bdm of the volume can\u0027t be found. Exception VolumeBDMNotFound was raised. See details in:\n\nhttp://paste.openstack.org/show/474568/\n\n5. Rebuilding failed, the instance is set to ERROR.\n\nI said the result is unpredictable, because the issue must meet the special time sequence, and synchronizing on the instance uuid can\u0027t solve the issue, we must set the task state when we do attaching/detaching volume/interface, and make use of the mechanism @check_instance_state in nova-api, so that the operations execute one by one.","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dd8a1539cfc4bdf8ae8beeb36476bdbdc3dea3d3","unresolved":false,"context_lines":[{"line_number":43,"context_line":"   inconclusive result, like: do the concurrent operation rebuilding-instance"},{"line_number":44,"context_line":"   and attaching-volume for the instance. The request had set the instance task"},{"line_number":45,"context_line":"   state in the first would continue to execute, and the others will be denied"},{"line_number":46,"context_line":"   according to the setting of decorator \u0027check_instance_state\u0027."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"Project Priority"},{"line_number":49,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_65381fa1","line":46,"updated":"2015-09-28 19:45:40.000000000","message":"These aren\u0027t really formatted as use cases, they\u0027re just restatements of your problem descriptions above.","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"7d9c6a551ec93a9795ee7101e45d35c387d48d90","unresolved":false,"context_lines":[{"line_number":43,"context_line":"   inconclusive result, like: do the concurrent operation rebuilding-instance"},{"line_number":44,"context_line":"   and attaching-volume for the instance. The request had set the instance task"},{"line_number":45,"context_line":"   state in the first would continue to execute, and the others will be denied"},{"line_number":46,"context_line":"   according to the setting of decorator \u0027check_instance_state\u0027."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"Project Priority"},{"line_number":49,"context_line":"----------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_46e077fa","line":46,"in_reply_to":"9a1a9d01_65381fa1","updated":"2015-09-29 03:50:38.000000000","message":"Done","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"dd8a1539cfc4bdf8ae8beeb36476bdbdc3dea3d3","unresolved":false,"context_lines":[{"line_number":86,"context_line":"REST API impact"},{"line_number":87,"context_line":"---------------"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"None"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"Security impact"},{"line_number":92,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_2559c7fe","line":89,"updated":"2015-09-28 19:45:40.000000000","message":"There\u0027s clearly a REST impact if we\u0027re exposing new things for the users to see.","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"7d9c6a551ec93a9795ee7101e45d35c387d48d90","unresolved":false,"context_lines":[{"line_number":86,"context_line":"REST API impact"},{"line_number":87,"context_line":"---------------"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"None"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"Security impact"},{"line_number":92,"context_line":"---------------"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9a1a9d01_06e7df11","line":89,"in_reply_to":"9a1a9d01_2559c7fe","updated":"2015-09-29 03:50:38.000000000","message":"Done","commit_id":"12ed566fa00ba54360c9febb0c8b64a891a55ea5"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"f8bb466636e8f2c4811c7a466fe624d370f1589b","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and detaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a1a9d01_bd1dc363","line":24,"updated":"2015-09-29 15:42:58.000000000","message":"The real use case seems the one you reported at the point #2.\nAccording to Dan\u0027s comments the user can get the info looking at the instance actions.","commit_id":"3c013778391bd476342d0f2070227ca395c07ff7"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"e342e9f6b8318eaeadb4fa8e5c762d1c86929603","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and detaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a1a9d01_926f772a","line":24,"in_reply_to":"9a1a9d01_bd1dc363","updated":"2015-09-30 02:30:14.000000000","message":"I do a double-check on current master branch, attaching/detaching volume/interface API don\u0027t record instance action and action event, even if it do, I think it\u0027s not convenient for operators, because the tasks execute on the instance would be split into two different data source (task state and instance action), rebuiding is present in task state, but attaching-volume come from instance action.\n\nAnd the most important is that setting task state can solve the concurrent issue in the following describe.","commit_id":"3c013778391bd476342d0f2070227ca395c07ff7"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"f8bb466636e8f2c4811c7a466fe624d370f1589b","unresolved":false,"context_lines":[{"line_number":43,"context_line":"         volumes according to the bdms that pass through from nova-api and"},{"line_number":44,"context_line":"         contain the volume had been detached. That would be failed, because"},{"line_number":45,"context_line":"         the bdm of the volume can\u0027t be found. Exception VolumeBDMNotFound was"},{"line_number":46,"context_line":"         raised."},{"line_number":47,"context_line":"      5. rebuilding failed, the instance is set to ERROR."},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"Use Cases"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a1a9d01_9288eec6","line":46,"updated":"2015-09-29 15:42:58.000000000","message":"Is this specific use case be fixed in the code?\nIf so this will solve the problem of the concurrent Rebuild and Detaching volume requests, am I right?","commit_id":"3c013778391bd476342d0f2070227ca395c07ff7"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"e342e9f6b8318eaeadb4fa8e5c762d1c86929603","unresolved":false,"context_lines":[{"line_number":43,"context_line":"         volumes according to the bdms that pass through from nova-api and"},{"line_number":44,"context_line":"         contain the volume had been detached. That would be failed, because"},{"line_number":45,"context_line":"         the bdm of the volume can\u0027t be found. Exception VolumeBDMNotFound was"},{"line_number":46,"context_line":"         raised."},{"line_number":47,"context_line":"      5. rebuilding failed, the instance is set to ERROR."},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"Use Cases"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a1a9d01_f2dfd337","line":46,"in_reply_to":"9a1a9d01_9288eec6","updated":"2015-09-30 02:30:14.000000000","message":"yes, if we set the task state for the instance when attaching-volume, the rebuilding operation will be denied by @check_instance_state of rebuild(), because the task state of the instance is not None, that fix the concurrent issue.","commit_id":"3c013778391bd476342d0f2070227ca395c07ff7"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"f8bb466636e8f2c4811c7a466fe624d370f1589b","unresolved":false,"context_lines":[{"line_number":88,"context_line":"Alternatives"},{"line_number":89,"context_line":"------------"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"None"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"Data model impact"},{"line_number":94,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a1a9d01_3256c22a","line":91,"updated":"2015-09-29 15:42:58.000000000","message":"can you state exactly all the combination of actions which, at the moment, are causing issues?\nIf we have the list we can probably understand if we the only solution to solve them is adding the new task states.","commit_id":"3c013778391bd476342d0f2070227ca395c07ff7"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"e342e9f6b8318eaeadb4fa8e5c762d1c86929603","unresolved":false,"context_lines":[{"line_number":88,"context_line":"Alternatives"},{"line_number":89,"context_line":"------------"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"None"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"Data model impact"},{"line_number":94,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":4,"id":"9a1a9d01_f246f379","line":91,"in_reply_to":"9a1a9d01_3256c22a","updated":"2015-09-30 02:30:14.000000000","message":"I think it\u0027s very difficult to list all the possible issue cases, but I purpose the spec according to a principle that the operations change the state of instance should set task state in order to avoiding the conflict between other operations, so I think we should add the task state for attaching/detaching volume/interface.\n\nWe make use of the mechanism @check_instance_state in nova-api, but don\u0027t modify any current setting of @check_instance_state, so the denied actions list is same as current implements if the task state of instance isn\u0027t None.","commit_id":"3c013778391bd476342d0f2070227ca395c07ff7"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"1fdc22e634119b062dbb0413378537f49521ccd3","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Project Priority"},{"line_number":61,"context_line":"----------------"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"None"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":5,"id":"7a2fa921_e5d13224","line":62,"updated":"2015-10-09 12:43:22.000000000","message":"remove this section, it\u0027s removed in the template now","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"8620f5bbdb856ebbf2e972dd7020b62d7e327344","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"Project Priority"},{"line_number":61,"context_line":"----------------"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"None"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":5,"id":"7a2fa921_c9c8b3aa","line":62,"in_reply_to":"7a2fa921_e5d13224","updated":"2015-10-10 06:52:18.000000000","message":"Done","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"1fdc22e634119b062dbb0413378537f49521ccd3","unresolved":false,"context_lines":[{"line_number":71,"context_line":"None when we attach a volume to the instance, like this::"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    instance.task_state \u003d task_states.ATTACHING_VOLUME"},{"line_number":74,"context_line":"    instance.save(expected_task_state\u003d[None])"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"Then update the instance.task_state as None when the attaching-volume workflow"},{"line_number":77,"context_line":"success in compute/manager.py, like this::"}],"source_content_type":"text/x-rst","patch_set":5,"id":"7a2fa921_45002666","line":74,"updated":"2015-10-09 12:43:22.000000000","message":"when you set those task, do we allow following actions such as reboot , delete? those actions will check task status\n\nalso, there are a huge set of recovering from ephemeral state\nin compute/_init_instance, do you plan to handle it if host abnormal died during attach volume?","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"8620f5bbdb856ebbf2e972dd7020b62d7e327344","unresolved":false,"context_lines":[{"line_number":71,"context_line":"None when we attach a volume to the instance, like this::"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    instance.task_state \u003d task_states.ATTACHING_VOLUME"},{"line_number":74,"context_line":"    instance.save(expected_task_state\u003d[None])"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"Then update the instance.task_state as None when the attaching-volume workflow"},{"line_number":77,"context_line":"success in compute/manager.py, like this::"}],"source_content_type":"text/x-rst","patch_set":5,"id":"7a2fa921_0f054b0f","line":74,"in_reply_to":"7a2fa921_45002666","updated":"2015-10-10 06:52:18.000000000","message":"If we set the 4 task_state, reboot isn\u0027t allowed, but delete is allowed, please see details in my following comments, and I will clarify it in \"REST API impact\" section in next patch.\n\nAnd thank your reminding, I will add some content about how to recovering from the new task_state in _init_instance() if the host died during attaching/detaching volume/interface. The basic idea is same as snapshot_instance(), reset the ephemeral state to None.\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/manager.py#L992-L1007","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"},{"author":{"_account_id":1865,"name":"Andrea Rosa","email":"andrea.rosa@gmail.com","username":"andrea-rosa-m"},"change_message_id":"e4502d15c626ec8db6c31998c86479bc014e4c1b","unresolved":false,"context_lines":[{"line_number":159,"context_line":"   attach/detach operation method in compute/api.py. The request had set the"},{"line_number":160,"context_line":"   instance task state in the first would continue to execute, and the others"},{"line_number":161,"context_line":"   will be denied according to the setting of decorator \u0027check_instance_state\u0027"},{"line_number":162,"context_line":"   in API concurrent requests scenarios."},{"line_number":163,"context_line":"3. Update the instance.task_state to None when these operations are successful"},{"line_number":164,"context_line":"   in compute/manager.py"},{"line_number":165,"context_line":"4. Add the decorator @reverts_task_state on the attach/detach_* methods."}],"source_content_type":"text/x-rst","patch_set":5,"id":"7a2fa921_7cd37860","line":162,"updated":"2015-10-09 14:40:16.000000000","message":"I do not think this works as you expect.\nThe check_instance_state decorator checks if the instance is in one of the vm_states or task_states listed to allow an operation, so in my understanding  if you want to add more tasks states to deny some actions you need to go through all the actions and list all the allowed tasks states.\nSo for example at the moment the rebuild just checks the vm_state and allow all the task_state, if you want to deny a rebuild while the instance task_state is equal to \u0027attaching_volume\u0027, in the decorator you have to list all the task states less \u0027attaching_volume\u0027.","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"8620f5bbdb856ebbf2e972dd7020b62d7e327344","unresolved":false,"context_lines":[{"line_number":159,"context_line":"   attach/detach operation method in compute/api.py. The request had set the"},{"line_number":160,"context_line":"   instance task state in the first would continue to execute, and the others"},{"line_number":161,"context_line":"   will be denied according to the setting of decorator \u0027check_instance_state\u0027"},{"line_number":162,"context_line":"   in API concurrent requests scenarios."},{"line_number":163,"context_line":"3. Update the instance.task_state to None when these operations are successful"},{"line_number":164,"context_line":"   in compute/manager.py"},{"line_number":165,"context_line":"4. Add the decorator @reverts_task_state on the attach/detach_* methods."}],"source_content_type":"text/x-rst","patch_set":5,"id":"7a2fa921_89d4fbeb","line":162,"in_reply_to":"7a2fa921_7cd37860","updated":"2015-10-10 06:52:18.000000000","message":"No, the default value of task_state is (None,) in @check_instance_state, so rebuild just allow instance.task_state\u003dNone, not all task_state, actually, only 4 methods (delete, soft_delete, update_instance_metadata, delete_instance_metadata) allow all task_state. others just allow task_state\u003dNone or a set of special task_state, like: reboot, so if we set the task_state, that will deny all the methods exclude the above 4 methods (delete, soft_delete, update_instance_metadata, delete_instance_metadata).\n\nI will clarify it in \"REST API impact\" section.","commit_id":"0329651ad8bf7dbdde1b63f0de5ca9bd93d9aa8d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"986b5c8fde9e3de1a82a5f5e27ab1399d2446d13","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and detaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_ec6542e1","line":24,"updated":"2015-11-09 10:38:28.000000000","message":"That should be possible via this:\nhttp://developer.openstack.org/api-ref-compute-v2.1.html#os-server-actions-add-v2.1\n\nIf that doesn\u0027t work, its a bug.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d4bbcae4cc5a19102f5f10460756e0690dfe9e29","unresolved":false,"context_lines":[{"line_number":21,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"1. The users have no idea about what\u0027s happening on the instance when"},{"line_number":24,"context_line":"   attaching/detaching volume and network interface."},{"line_number":25,"context_line":"2. In some API concurrent requests scenarios the operation results are"},{"line_number":26,"context_line":"   unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":27,"context_line":"   rebuilding-instance and detaching-volume for the same instance. Because"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_2a200a9b","line":24,"in_reply_to":"da85f559_ec6542e1","updated":"2015-11-10 08:39:01.000000000","message":"I agree that it belong to the instance actions scope, so I will remove it in next patch.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"986b5c8fde9e3de1a82a5f5e27ab1399d2446d13","unresolved":false,"context_lines":[{"line_number":44,"context_line":"         contain the volume had been detached. That would be failed, because"},{"line_number":45,"context_line":"         the bdm of the volume can\u0027t be found. Exception VolumeBDMNotFound was"},{"line_number":46,"context_line":"         raised."},{"line_number":47,"context_line":"      5. rebuilding failed, the instance is set to ERROR."},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"Use Cases"},{"line_number":50,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_ecac62ef","line":47,"updated":"2015-11-09 10:38:28.000000000","message":"Agreed with this problem.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d4bbcae4cc5a19102f5f10460756e0690dfe9e29","unresolved":false,"context_lines":[{"line_number":50,"context_line":"---------"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"1. End users attach/detach volume and network interface to instance, they can"},{"line_number":53,"context_line":"   know which operation is in progress according to task state of the instance."},{"line_number":54,"context_line":"2. Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":55,"context_line":"   and have set the instance task state. The other concurrent API requests will"},{"line_number":56,"context_line":"   be denied, because these API operations can\u0027t be executed at the same time."}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_0a3f46b5","line":53,"updated":"2015-11-10 08:39:01.000000000","message":"remove these in next patch, the instance actions can resolve it.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"986b5c8fde9e3de1a82a5f5e27ab1399d2446d13","unresolved":false,"context_lines":[{"line_number":55,"context_line":"   and have set the instance task state. The other concurrent API requests will"},{"line_number":56,"context_line":"   be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":57,"context_line":"   The end users should be notified by raising exception from API, let them"},{"line_number":58,"context_line":"   know they are doing some wrong things."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_ac697a8d","line":58,"updated":"2015-11-09 10:38:28.000000000","message":"Not sure I like these use cases, they are far too linked to the chosen solution, rather than just focusing on the user goals.\n\nI would suggest something like:\n\n* concurrent volume attach and detach on the same server (currently should work just fine, I think)\n* performing actions that can\u0027t happen in parallel with volume attach, like resize, before a pending attach has finished should not put the server into an ERROR state.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d4bbcae4cc5a19102f5f10460756e0690dfe9e29","unresolved":false,"context_lines":[{"line_number":55,"context_line":"   and have set the instance task state. The other concurrent API requests will"},{"line_number":56,"context_line":"   be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":57,"context_line":"   The end users should be notified by raising exception from API, let them"},{"line_number":58,"context_line":"   know they are doing some wrong things."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_aa55dac6","line":58,"in_reply_to":"da85f559_2f81fc4a","updated":"2015-11-10 08:39:01.000000000","message":"I will think about the suggestion carefully, and update the spec following it.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6d962df508b0c252b92207e6cc10c047cc76fe26","unresolved":false,"context_lines":[{"line_number":55,"context_line":"   and have set the instance task state. The other concurrent API requests will"},{"line_number":56,"context_line":"   be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":57,"context_line":"   The end users should be notified by raising exception from API, let them"},{"line_number":58,"context_line":"   know they are doing some wrong things."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_2f81fc4a","line":58,"in_reply_to":"da85f559_ac697a8d","updated":"2015-11-09 10:49:03.000000000","message":"Just to follow up on those use cases.\n\nMy preferred solution would allow those parallel operations that can happen successfully to keep happeing successfully, and we would isolate the majority of the API changes to a new microversion (i.e. add a new micro version that has a task state for when some of the parallel operations are happening, that blocks everything except attach/detatch volume and vifs happening).\n\nI think that should be doable.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"986b5c8fde9e3de1a82a5f5e27ab1399d2446d13","unresolved":false,"context_lines":[{"line_number":64,"context_line":"Adds 4 task states (attaching_volume, detaching_volume, attaching_interface,"},{"line_number":65,"context_line":"detaching_interface) into the instance life cycle. Set the instance.task_state"},{"line_number":66,"context_line":"as \u0027attaching_volume\u0027 in compute/api.py and assert the current task_state is"},{"line_number":67,"context_line":"None when we attach a volume to the instance, like this::"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    instance.task_state \u003d task_states.ATTACHING_VOLUME"},{"line_number":70,"context_line":"    instance.save(expected_task_state\u003d[None])"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_4cd32e39","line":67,"updated":"2015-11-09 10:38:28.000000000","message":"You are stopping people from attaching multiple volumes at once.\n\nThat might be OK, but thats a massive API change that is not really mentioned.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d4bbcae4cc5a19102f5f10460756e0690dfe9e29","unresolved":false,"context_lines":[{"line_number":64,"context_line":"Adds 4 task states (attaching_volume, detaching_volume, attaching_interface,"},{"line_number":65,"context_line":"detaching_interface) into the instance life cycle. Set the instance.task_state"},{"line_number":66,"context_line":"as \u0027attaching_volume\u0027 in compute/api.py and assert the current task_state is"},{"line_number":67,"context_line":"None when we attach a volume to the instance, like this::"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    instance.task_state \u003d task_states.ATTACHING_VOLUME"},{"line_number":70,"context_line":"    instance.save(expected_task_state\u003d[None])"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_c37c9f74","line":67,"in_reply_to":"da85f559_4cd32e39","updated":"2015-11-10 08:39:01.000000000","message":"Thank you for reminding it, I will clarify the main change in API impact.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d4bbcae4cc5a19102f5f10460756e0690dfe9e29","unresolved":false,"context_lines":[{"line_number":73,"context_line":"success in compute/manager.py, like this::"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    instance.task_state \u003d None"},{"line_number":76,"context_line":"    instance.save(expected_task_state\u003dtask_states.ATTACHING_VOLUME)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"If the attaching-volume failed, revert instance.task_state to None by using the"},{"line_number":79,"context_line":"decorator @reverts_task_state."}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_c399ff6f","line":76,"updated":"2015-11-10 08:39:01.000000000","message":"I want to support attaching multiple volumes/interfaces on one server, but an issue looks like hard to resolve, think about the follow operation sequences:\n\n1. concurrent detaching three volumes on one server.\n\n2. when the first detaching volume is finished, the task_state is set to None, other two detaching are underway. (Note, the separate detaching workflow don\u0027t know that other detaching happen)\n\n3. do rebuild server at the moment, it can start, because the current task_state is None, but two detaching aren\u0027t finished.\n\n4. rebuilding is failed, Exception VolumeBDMNotFound was raised. (same reason with \u0027Problem description\u0027 section)\n\n5. the instance is set to ERROR.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"986b5c8fde9e3de1a82a5f5e27ab1399d2446d13","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":85,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":86,"context_line":"attaching-interface, detaching-interface."},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"Alternatives"},{"line_number":89,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_eca0e292","line":86,"updated":"2015-11-09 10:38:28.000000000","message":"Note, for that to be possible, you probably need several other \"hidden\" task states, as used by other operations like reboot, so you can identify what things need to be cleaned up by the administrator.\n\nBut thats an implementation detail, we should probably leave that for now.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d4bbcae4cc5a19102f5f10460756e0690dfe9e29","unresolved":false,"context_lines":[{"line_number":83,"context_line":""},{"line_number":84,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":85,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":86,"context_line":"attaching-interface, detaching-interface."},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"Alternatives"},{"line_number":89,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_af6e1ac7","line":86,"in_reply_to":"da85f559_eca0e292","updated":"2015-11-10 08:39:01.000000000","message":"Done","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"986b5c8fde9e3de1a82a5f5e27ab1399d2446d13","unresolved":false,"context_lines":[{"line_number":88,"context_line":"Alternatives"},{"line_number":89,"context_line":"------------"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"None"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"Data model impact"},{"line_number":94,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_6c1712a4","line":91,"updated":"2015-11-09 10:38:28.000000000","message":"We could allow multiple interface attach/detach and volume attach/detach in parallel, but this solution excludes that. We have to discuss this in the alternatives.\n\nThe extra complexity of the above, could be argued to be not worth the effort.\n\n*I think thats the key debate in this spec, should we allow multiple attach/detach still, where thats possible?.*","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d4bbcae4cc5a19102f5f10460756e0690dfe9e29","unresolved":false,"context_lines":[{"line_number":88,"context_line":"Alternatives"},{"line_number":89,"context_line":"------------"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"None"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"Data model impact"},{"line_number":94,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_2fe8ea0f","line":91,"in_reply_to":"da85f559_6c1712a4","updated":"2015-11-10 08:39:01.000000000","message":"I will add the idea about allowing multiple attach/detach in parallel at here in next patch, that means we need a way to resolve the issue that I mention in the #76 line comments.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"986b5c8fde9e3de1a82a5f5e27ab1399d2446d13","unresolved":false,"context_lines":[{"line_number":100,"context_line":""},{"line_number":101,"context_line":"1. Four new task states (attaching_volume, detaching_volume,"},{"line_number":102,"context_line":"   attaching_interface, detaching_interface) will present in instance life"},{"line_number":103,"context_line":"   cycle when query instance list or show instance details."},{"line_number":104,"context_line":"2. The task state of instance will be set when these operations"},{"line_number":105,"context_line":"   (attaching_volume, detaching_volume, attaching_interface,"},{"line_number":106,"context_line":"   detaching_interface) execute, so other concurrent operations will be denied"}],"source_content_type":"text/x-rst","patch_set":7,"id":"da85f559_0c0c4693","line":103,"updated":"2015-11-09 10:38:28.000000000","message":"Technically such changes should be only in a micro-version, but thats not really possible here.","commit_id":"7ea322bd666faa3639cd25dc5e5d57067eb40e89"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"adb90fe892496380be912882ca8098dceb7cf7a0","unresolved":false,"context_lines":[{"line_number":42,"context_line":"         contain the volume had been detached. That would be failed, because"},{"line_number":43,"context_line":"         the bdm of the volume can\u0027t be found. Exception VolumeBDMNotFound was"},{"line_number":44,"context_line":"         raised."},{"line_number":45,"context_line":"      5. rebuilding failed, the instance is set to ERROR."},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Use Cases"},{"line_number":48,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_42fce5b7","line":45,"updated":"2015-11-11 10:18:33.000000000","message":"You could also refer to the bug for this: https://bugs.launchpad.net/nova/+bug/1275144","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"be686bb155c708dce062a26097b2de5afe5e5a6d","unresolved":false,"context_lines":[{"line_number":42,"context_line":"         contain the volume had been detached. That would be failed, because"},{"line_number":43,"context_line":"         the bdm of the volume can\u0027t be found. Exception VolumeBDMNotFound was"},{"line_number":44,"context_line":"         raised."},{"line_number":45,"context_line":"      5. rebuilding failed, the instance is set to ERROR."},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"Use Cases"},{"line_number":48,"context_line":"---------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_6f53c917","line":45,"in_reply_to":"da85f559_42fce5b7","updated":"2015-11-16 10:23:08.000000000","message":"Thank you, I can add this refer in next patch.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":7461,"name":"Paul Murray","email":"pmurray@hpe.com","username":"ptm"},"change_message_id":"adb90fe892496380be912882ca8098dceb7cf7a0","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":87,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":88,"context_line":"attaching-interface, detaching-interface."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"Alternatives"},{"line_number":91,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_c29775ea","line":88,"updated":"2015-11-11 10:18:33.000000000","message":"This is all good, but there is one more complication. During an upgrade it is possible that there will be APIs servers on version n of the code and compute managers on version n-1. So we need to allow for the case that the compute managers do not handle the task states. This can be done by checking the version of the compute manager for the instances before setting the instance.task_state. A pain I know.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"be686bb155c708dce062a26097b2de5afe5e5a6d","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":87,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":88,"context_line":"attaching-interface, detaching-interface."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"Alternatives"},{"line_number":91,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_c13e1729","line":88,"in_reply_to":"da85f559_a0e6e812","updated":"2015-11-16 10:23:08.000000000","message":"Yeah, thank you reminding it, we can use rpcapi.can_send_version() to check whether the target is matched, if not, don\u0027t set task_state in API.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"109c5803f6d88cec761a27b9fd3c78269b4eaf1c","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":87,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":88,"context_line":"attaching-interface, detaching-interface."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"Alternatives"},{"line_number":91,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_a0e6e812","line":88,"in_reply_to":"da85f559_c29775ea","updated":"2015-11-11 11:09:47.000000000","message":"You are right, I think we can use the RPC API pin for the compute nodes, and only add the extra state until they are all upgraded, or something a bit like that.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"88564f884216d15aa75b9dcf48c6f7b132805496","unresolved":false,"context_lines":[{"line_number":86,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":87,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":88,"context_line":"attaching-interface, detaching-interface."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"Alternatives"},{"line_number":91,"context_line":"------------"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_edc9c95b","line":89,"updated":"2015-11-13 11:10:39.000000000","message":"So, I feel adding more task states is creating more debt because our current model is a bit flakey. \nIf we say we should add those states, then we would make sure that those states are accurate.\n\nThat\u0027s why I think that maybe the root problem is just the idea that the operator wants to know if there was a problem or not. For that case, os-instance-actions sounds a good candidate to me.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"70d0b2f629a29967753ead60b00d832ee92875e1","unresolved":false,"context_lines":[{"line_number":86,"context_line":"If the host abnormally died during attaching volume, the task_state of instance"},{"line_number":87,"context_line":"will be reset to None when nova-compute init, that is same as detaching-volume,"},{"line_number":88,"context_line":"attaching-interface, detaching-interface."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"Alternatives"},{"line_number":91,"context_line":"------------"},{"line_number":92,"context_line":""}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_8509e9df","line":89,"in_reply_to":"da85f559_edc9c95b","updated":"2015-11-13 14:59:56.000000000","message":"I tend to agree with this.  task_states can help serialize actions but you lose the ability to do parallel processing as mentioned below.  I really don\u0027t want to see task_states grow into something that tries to manage that.  I would be fine with making the change to serialization here to solve a real issue and worrying about parallelization later.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"c0b721bc2105ad206993cc48e42da2ec14454bbf","unresolved":false,"context_lines":[{"line_number":93,"context_line":"This design don\u0027t support attaching/detaching multiple volumes/interfaces on"},{"line_number":94,"context_line":"one server in parallel, that can be operated in current nova, not sure that"},{"line_number":95,"context_line":"it\u0027s worth to adding the extra complexity for supporting it, and a predictable"},{"line_number":96,"context_line":"issue looks like hard to resolve, think about the follow operation sequences:"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"1. concurrent detaching three volumes on one server."},{"line_number":99,"context_line":"2. when the first detaching volume is finished, the task_state is set to None,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_206518b4","line":96,"updated":"2015-11-11 11:07:22.000000000","message":"After sleeping on this, I think we need to keep this... so we don\u0027t break the backwards compatibility of the API","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"be686bb155c708dce062a26097b2de5afe5e5a6d","unresolved":false,"context_lines":[{"line_number":93,"context_line":"This design don\u0027t support attaching/detaching multiple volumes/interfaces on"},{"line_number":94,"context_line":"one server in parallel, that can be operated in current nova, not sure that"},{"line_number":95,"context_line":"it\u0027s worth to adding the extra complexity for supporting it, and a predictable"},{"line_number":96,"context_line":"issue looks like hard to resolve, think about the follow operation sequences:"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"1. concurrent detaching three volumes on one server."},{"line_number":99,"context_line":"2. when the first detaching volume is finished, the task_state is set to None,"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_8ae61b42","line":96,"in_reply_to":"da85f559_206518b4","updated":"2015-11-16 10:23:08.000000000","message":"ok, backwards compatibility is first","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"179717424268eea74a69df8c13680f18628ff9a2","unresolved":false,"context_lines":[{"line_number":95,"context_line":"it\u0027s worth to adding the extra complexity for supporting it, and a predictable"},{"line_number":96,"context_line":"issue looks like hard to resolve, think about the follow operation sequences:"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"1. concurrent detaching three volumes on one server."},{"line_number":99,"context_line":"2. when the first detaching volume is finished, the task_state is set to None,"},{"line_number":100,"context_line":"   other two detaching are underway. (Note, the separate detaching workflow"},{"line_number":101,"context_line":"   don\u0027t know that other detaching happen)"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_e0d390d3","line":98,"updated":"2015-11-11 11:26:15.000000000","message":"This should be recorded in the \"instance actions\" table, so we should be able to tell all three are happening.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"179717424268eea74a69df8c13680f18628ff9a2","unresolved":false,"context_lines":[{"line_number":98,"context_line":"1. concurrent detaching three volumes on one server."},{"line_number":99,"context_line":"2. when the first detaching volume is finished, the task_state is set to None,"},{"line_number":100,"context_line":"   other two detaching are underway. (Note, the separate detaching workflow"},{"line_number":101,"context_line":"   don\u0027t know that other detaching happen)"},{"line_number":102,"context_line":"3. do rebuild server at the moment, it can start, because the current"},{"line_number":103,"context_line":"   task_state is None, but two detaching aren\u0027t finished."},{"line_number":104,"context_line":"4. rebuilding is failed, Exception VolumeBDMNotFound was raised. (same reason"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_a053486a","line":101,"updated":"2015-11-11 11:26:15.000000000","message":"We could set the task state to \"other\" if there are any pending \"instance actions\".\n\nThis could be done at the API level, rather than updating the DB instance task_state, although thats probably more expensive DB wise.\n\nWe can hide this from older API versions, and just add the Other task state in a new micro version.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"179717424268eea74a69df8c13680f18628ff9a2","unresolved":false,"context_lines":[{"line_number":100,"context_line":"   other two detaching are underway. (Note, the separate detaching workflow"},{"line_number":101,"context_line":"   don\u0027t know that other detaching happen)"},{"line_number":102,"context_line":"3. do rebuild server at the moment, it can start, because the current"},{"line_number":103,"context_line":"   task_state is None, but two detaching aren\u0027t finished."},{"line_number":104,"context_line":"4. rebuilding is failed, Exception VolumeBDMNotFound was raised. (same reason"},{"line_number":105,"context_line":"   with \u0027Problem description\u0027 section)"},{"line_number":106,"context_line":"5. the instance is set to ERROR."}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_20f51856","line":103,"updated":"2015-11-11 11:26:15.000000000","message":"Rebuild is an exclusive action, so must ensure there are no pending \"instance actions\" before updating the task_state. That can send the HTTPConflict error, or similar.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"88564f884216d15aa75b9dcf48c6f7b132805496","unresolved":false,"context_lines":[{"line_number":103,"context_line":"   task_state is None, but two detaching aren\u0027t finished."},{"line_number":104,"context_line":"4. rebuilding is failed, Exception VolumeBDMNotFound was raised. (same reason"},{"line_number":105,"context_line":"   with \u0027Problem description\u0027 section)"},{"line_number":106,"context_line":"5. the instance is set to ERROR."},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"Data model impact"},{"line_number":109,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":8,"id":"da85f559_0df52d82","line":106,"updated":"2015-11-13 11:10:39.000000000","message":"See, the above section sounds like a possible bugfix once we log correctly all the actions.","commit_id":"7431b8fb0d030fd29ee01b33fbc94d2d24b30e16"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e7b99885e60859be4e1cbd5a17cad2a6e0137409","unresolved":false,"context_lines":[{"line_number":56,"context_line":"know they are doing some wrong things."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"},{"line_number":59,"context_line":"parallel now, the backwards compatibility of the API can\u0027t be broken."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":12,"id":"7a740942_559f1e5f","line":59,"updated":"2015-12-10 12:32:48.000000000","message":"This does appear to break that.\n\nCurrently you can have mutliple attach and detach in parallel. This only allows either multiple attach or multiple detach. I.e. you don\u0027t seem to allow one detach and one attach in paralllel?\n\nMaybe we just have one new task state, something like:\nattach_or_detach_device\n\nAlthough I hope someone has a better name for it...","commit_id":"bf52aa6e347b52a29350806dbb0e7827fc4c7b6c"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"764d908ec6f9309083fb8db3a6ed37719352c9fa","unresolved":false,"context_lines":[{"line_number":56,"context_line":"know they are doing some wrong things."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"},{"line_number":59,"context_line":"parallel now, the backwards compatibility of the API can\u0027t be broken."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":12,"id":"5a710552_c4d85720","line":59,"in_reply_to":"7a740942_559f1e5f","updated":"2015-12-16 04:17:27.000000000","message":"think about these again, one new task state can fix all the concurrent scenarios, multiple attach or one attach and one detach in parallel, the new task state that I prefer is \"device_updating\", other better name is welcome.\n\nthank you.","commit_id":"bf52aa6e347b52a29350806dbb0e7827fc4c7b6c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e7b99885e60859be4e1cbd5a17cad2a6e0137409","unresolved":false,"context_lines":[{"line_number":84,"context_line":"success in compute/manager.py, like this::"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    instance.task_state \u003d None"},{"line_number":87,"context_line":"    instance.save(expected_task_state\u003d[None, task_states.ATTACHING_VOLUME])"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"If the attaching-volume failed, revert instance.task_state to None by using the"},{"line_number":90,"context_line":"decorator @reverts_task_state."}],"source_content_type":"text/x-rst","patch_set":12,"id":"7a740942_3a4da199","line":87,"updated":"2015-12-10 12:32:48.000000000","message":"But what about multiple attaches happing in parallel.\n\nTechnically, only the last detach to finish should set the state back to None?\n\nMaybe we need some kind of compare and swap count for the number of attaching things?","commit_id":"bf52aa6e347b52a29350806dbb0e7827fc4c7b6c"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"764d908ec6f9309083fb8db3a6ed37719352c9fa","unresolved":false,"context_lines":[{"line_number":84,"context_line":"success in compute/manager.py, like this::"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    instance.task_state \u003d None"},{"line_number":87,"context_line":"    instance.save(expected_task_state\u003d[None, task_states.ATTACHING_VOLUME])"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"If the attaching-volume failed, revert instance.task_state to None by using the"},{"line_number":90,"context_line":"decorator @reverts_task_state."}],"source_content_type":"text/x-rst","patch_set":12,"id":"5a710552_eb889224","line":87,"in_reply_to":"7a740942_3a4da199","updated":"2015-12-16 04:17:27.000000000","message":"We set the new task state \u0027device_updating\u0027 in nova-api, and reset it to None in nova-compute, so we must add one new database column  to record the swap count, but I hesitate that whether it\u0027s valuable to add these complex logic to resolve this minor issue, if we add one new database column, more code should be added, like: swap count cleanup when host abnormally died and database migration, so I prefer to keep the implement simple.","commit_id":"bf52aa6e347b52a29350806dbb0e7827fc4c7b6c"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"e7b99885e60859be4e1cbd5a17cad2a6e0137409","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"1. Five new task states (attaching_volume, detaching_volume, swapping_volume,"},{"line_number":122,"context_line":"   attaching_interface, detaching_interface) will present in instance life"},{"line_number":123,"context_line":"   cycle when query instance list or show instance details."},{"line_number":124,"context_line":"2. The task state of instance will be set when these operations"},{"line_number":125,"context_line":"   (attaching_volume, detaching_volume, swapping_volume, attaching_interface,"},{"line_number":126,"context_line":"   detaching_interface) execute, so other concurrent operations will be denied"}],"source_content_type":"text/x-rst","patch_set":12,"id":"7a740942_3a34c1f9","line":123,"updated":"2015-12-10 12:32:48.000000000","message":"This breaks out API contract.\n\nThese new stats should only be visible in a new microversion.","commit_id":"bf52aa6e347b52a29350806dbb0e7827fc4c7b6c"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"764d908ec6f9309083fb8db3a6ed37719352c9fa","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"1. Five new task states (attaching_volume, detaching_volume, swapping_volume,"},{"line_number":122,"context_line":"   attaching_interface, detaching_interface) will present in instance life"},{"line_number":123,"context_line":"   cycle when query instance list or show instance details."},{"line_number":124,"context_line":"2. The task state of instance will be set when these operations"},{"line_number":125,"context_line":"   (attaching_volume, detaching_volume, swapping_volume, attaching_interface,"},{"line_number":126,"context_line":"   detaching_interface) execute, so other concurrent operations will be denied"}],"source_content_type":"text/x-rst","patch_set":12,"id":"5a710552_7f5a4d85","line":123,"in_reply_to":"7a740942_3a34c1f9","updated":"2015-12-16 04:17:27.000000000","message":"ok, just add one new task_state, so microversion should be added in ExtendedStatusController.","commit_id":"bf52aa6e347b52a29350806dbb0e7827fc4c7b6c"}],"specs/newton/approved/task-states-improvement.rst":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"887cd41d600bd9f9130a84623d8e99a2d9b1be03","unresolved":false,"context_lines":[{"line_number":41,"context_line":"     contain the volume had been detached. That would be failed, because"},{"line_number":42,"context_line":"     the bdm of the volume can\u0027t be found. Exception VolumeBDMNotFound was"},{"line_number":43,"context_line":"     raised."},{"line_number":44,"context_line":"  5. rebuilding failed, the instance is set to ERROR."},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"And the related issue also is described in bug [1]"},{"line_number":47,"context_line":""}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_592bba30","line":44,"updated":"2016-04-16 15:54:14.000000000","message":"Yep, exactly.","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"887cd41d600bd9f9130a84623d8e99a2d9b1be03","unresolved":false,"context_lines":[{"line_number":49,"context_line":"---------"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":52,"context_line":"and have set the instance task state. The other concurrent API requests will"},{"line_number":53,"context_line":"be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":54,"context_line":"The end users should be notified by raising exception from API, let them"},{"line_number":55,"context_line":"know they are doing some wrong things."}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_b9200e4b","line":52,"updated":"2016-04-16 15:54:14.000000000","message":"s/task state. The/task state, the\n\ns/requests will/requests should/","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d6774ef4c325f2e08a82823abb4946c100b2b35d","unresolved":false,"context_lines":[{"line_number":49,"context_line":"---------"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":52,"context_line":"and have set the instance task state. The other concurrent API requests will"},{"line_number":53,"context_line":"be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":54,"context_line":"The end users should be notified by raising exception from API, let them"},{"line_number":55,"context_line":"know they are doing some wrong things."}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_10407933","line":52,"in_reply_to":"1a122d0e_b9200e4b","updated":"2016-04-20 02:56:49.000000000","message":"Done","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d6774ef4c325f2e08a82823abb4946c100b2b35d","unresolved":false,"context_lines":[{"line_number":49,"context_line":"---------"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":52,"context_line":"and have set the instance task state. The other concurrent API requests will"},{"line_number":53,"context_line":"be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":54,"context_line":"The end users should be notified by raising exception from API, let them"},{"line_number":55,"context_line":"know they are doing some wrong things."}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_bc1ec16d","line":52,"in_reply_to":"1a122d0e_b9200e4b","updated":"2016-04-20 02:56:49.000000000","message":"Done","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"887cd41d600bd9f9130a84623d8e99a2d9b1be03","unresolved":false,"context_lines":[{"line_number":51,"context_line":"Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":52,"context_line":"and have set the instance task state. The other concurrent API requests will"},{"line_number":53,"context_line":"be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":54,"context_line":"The end users should be notified by raising exception from API, let them"},{"line_number":55,"context_line":"know they are doing some wrong things."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_991d5212","line":54,"updated":"2016-04-16 15:54:14.000000000","message":"s/API, let them/API to let them/","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d6774ef4c325f2e08a82823abb4946c100b2b35d","unresolved":false,"context_lines":[{"line_number":51,"context_line":"Solve the issue of API concurrent requests. If one API operation is underway"},{"line_number":52,"context_line":"and have set the instance task state. The other concurrent API requests will"},{"line_number":53,"context_line":"be denied, because these API operations can\u0027t be executed at the same time."},{"line_number":54,"context_line":"The end users should be notified by raising exception from API, let them"},{"line_number":55,"context_line":"know they are doing some wrong things."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_3c0bd12b","line":54,"in_reply_to":"1a122d0e_991d5212","updated":"2016-04-20 02:56:49.000000000","message":"Done","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"887cd41d600bd9f9130a84623d8e99a2d9b1be03","unresolved":false,"context_lines":[{"line_number":64,"context_line":"Adds one new task state \"device_updating\" into the instance life cycle."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"For supporting attach_volume in parallel and keep the API backwards"},{"line_number":67,"context_line":"compatibility, the decorator @check_instance_stat of attach_volume API should"},{"line_number":68,"context_line":"be updated like this::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @check_instance_stat(vm_state\u003d[...],"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_f91a8616","line":67,"updated":"2016-04-16 15:54:14.000000000","message":"s/compatibility/compatible/\n\ns/@check_instance_stat/@check_instance_state/ (here and below in the code)","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d6774ef4c325f2e08a82823abb4946c100b2b35d","unresolved":false,"context_lines":[{"line_number":64,"context_line":"Adds one new task state \"device_updating\" into the instance life cycle."},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"For supporting attach_volume in parallel and keep the API backwards"},{"line_number":67,"context_line":"compatibility, the decorator @check_instance_stat of attach_volume API should"},{"line_number":68,"context_line":"be updated like this::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @check_instance_stat(vm_state\u003d[...],"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_b04ee56c","line":67,"in_reply_to":"1a122d0e_f91a8616","updated":"2016-04-20 02:56:49.000000000","message":"Done","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"887cd41d600bd9f9130a84623d8e99a2d9b1be03","unresolved":false,"context_lines":[{"line_number":68,"context_line":"be updated like this::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @check_instance_stat(vm_state\u003d[...],"},{"line_number":71,"context_line":"                         task_state\u003d[None, task_states.DEVICE_UPDATING])"},{"line_number":72,"context_line":"    def attach_volume(...):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Set the instance.task_state as \"device_updating\" in compute/api.py and assert"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_d917caeb","line":71,"updated":"2016-04-16 15:54:14.000000000","message":"I would prefer to use BLOCK_DEVICE_DETACHING and BLOCK_DEVICE_ATTACHING be the states and something similar for NETWORK_DEVICE_ATTACHING/DETACHING. Task states are cheap :) Might as well be specific.","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d6774ef4c325f2e08a82823abb4946c100b2b35d","unresolved":false,"context_lines":[{"line_number":68,"context_line":"be updated like this::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @check_instance_stat(vm_state\u003d[...],"},{"line_number":71,"context_line":"                         task_state\u003d[None, task_states.DEVICE_UPDATING])"},{"line_number":72,"context_line":"    def attach_volume(...):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Set the instance.task_state as \"device_updating\" in compute/api.py and assert"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_f3b18702","line":71,"in_reply_to":"1a122d0e_ace997e8","updated":"2016-04-20 02:56:49.000000000","message":"The main part of proposed change is adding the decorator on attach/detach volume/interface, I can supply the more details in my implement patch if the spec can be approved :-)","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"3f775612f31db9149a6820d3f6f72fb880953586","unresolved":false,"context_lines":[{"line_number":68,"context_line":"be updated like this::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @check_instance_stat(vm_state\u003d[...],"},{"line_number":71,"context_line":"                         task_state\u003d[None, task_states.DEVICE_UPDATING])"},{"line_number":72,"context_line":"    def attach_volume(...):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Set the instance.task_state as \"device_updating\" in compute/api.py and assert"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_ace997e8","line":71,"in_reply_to":"1a122d0e_d917caeb","updated":"2016-04-19 12:13:27.000000000","message":"+1 for more detailed approach here","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d6774ef4c325f2e08a82823abb4946c100b2b35d","unresolved":false,"context_lines":[{"line_number":68,"context_line":"be updated like this::"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    @check_instance_stat(vm_state\u003d[...],"},{"line_number":71,"context_line":"                         task_state\u003d[None, task_states.DEVICE_UPDATING])"},{"line_number":72,"context_line":"    def attach_volume(...):"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"Set the instance.task_state as \"device_updating\" in compute/api.py and assert"}],"source_content_type":"text/x-rst","patch_set":17,"id":"1a122d0e_9305b312","line":71,"in_reply_to":"1a122d0e_d917caeb","updated":"2016-04-20 02:56:49.000000000","message":"Actually 4 new task states would be added in my original idea like you say, John suggest to use one task state to keep the backward compatibility for multiple attach and detach in parallel in PS7 comments, and I agree that only one task state can resolve the race issue, so I update the specification to one task state.","commit_id":"91e0e660f0389e6eda63ed7e9e0c5680939d9541"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Improve task states for attaching/detaching volume and network interface"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/task-states-improvement"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Adds one new task state \"device_updating\" into the instance life cycle."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_d6e1862b","line":11,"updated":"2016-10-13 00:06:30.000000000","message":"Recommend changing the blueprint name to add-task-status-device-updating to better represent what this is about.","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"10a49dd3137154353e2331be1e949ecf5aa93e1a","unresolved":false,"context_lines":[{"line_number":8,"context_line":"Improve task states for attaching/detaching volume and network interface"},{"line_number":9,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"https://blueprints.launchpad.net/nova/+spec/task-states-improvement"},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Adds one new task state \"device_updating\" into the instance life cycle."},{"line_number":14,"context_line":""}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_fbdc1914","line":11,"in_reply_to":"1a95cdbc_d6e1862b","updated":"2016-10-13 03:15:32.000000000","message":"Done","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":17,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Currently when we attach/detach volume and network interface from instance,"},{"line_number":20,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In some API concurrent requests scenarios the operation results are"},{"line_number":23,"context_line":"unpredictable and inconclusive, for example: do the concurrent operation"}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_b6023ab2","line":20,"updated":"2016-10-13 00:06:30.000000000","message":"s/is unchanged, it causes/is unchanged. This can cause some issues./","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"10a49dd3137154353e2331be1e949ecf5aa93e1a","unresolved":false,"context_lines":[{"line_number":17,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Currently when we attach/detach volume and network interface from instance,"},{"line_number":20,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In some API concurrent requests scenarios the operation results are"},{"line_number":23,"context_line":"unpredictable and inconclusive, for example: do the concurrent operation"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_9b5ebd74","line":20,"in_reply_to":"1a95cdbc_b6023ab2","updated":"2016-10-13 03:15:32.000000000","message":"Done","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":19,"context_line":"Currently when we attach/detach volume and network interface from instance,"},{"line_number":20,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In some API concurrent requests scenarios the operation results are"},{"line_number":23,"context_line":"unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":24,"context_line":"rebuilding-instance and detaching-volume for the same instance. Because"},{"line_number":25,"context_line":"task_state of instance isn\u0027t set when detaching volume,"}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_96e53e0a","line":22,"updated":"2016-10-13 00:06:30.000000000","message":"s/concurrent requests scenarios the operation results/scenarios with concurrent requests, operation results/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"10a49dd3137154353e2331be1e949ecf5aa93e1a","unresolved":false,"context_lines":[{"line_number":19,"context_line":"Currently when we attach/detach volume and network interface from instance,"},{"line_number":20,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In some API concurrent requests scenarios the operation results are"},{"line_number":23,"context_line":"unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":24,"context_line":"rebuilding-instance and detaching-volume for the same instance. Because"},{"line_number":25,"context_line":"task_state of instance isn\u0027t set when detaching volume,"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_bb554151","line":22,"in_reply_to":"1a95cdbc_96e53e0a","updated":"2016-10-13 03:15:32.000000000","message":"Done","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":20,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In some API concurrent requests scenarios the operation results are"},{"line_number":23,"context_line":"unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":24,"context_line":"rebuilding-instance and detaching-volume for the same instance. Because"},{"line_number":25,"context_line":"task_state of instance isn\u0027t set when detaching volume,"},{"line_number":26,"context_line":"@check_instance_state is bypassed, nova-compute start to execute rebuilding"}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_d699867a","line":23,"updated":"2016-10-13 00:06:30.000000000","message":"s/inconclusive, for example: do the concurrent//inconclusive; for example when one performs a concurrent/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"10a49dd3137154353e2331be1e949ecf5aa93e1a","unresolved":false,"context_lines":[{"line_number":20,"context_line":"the task state of the instance is unchanged, it cause some issues."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In some API concurrent requests scenarios the operation results are"},{"line_number":23,"context_line":"unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":24,"context_line":"rebuilding-instance and detaching-volume for the same instance. Because"},{"line_number":25,"context_line":"task_state of instance isn\u0027t set when detaching volume,"},{"line_number":26,"context_line":"@check_instance_state is bypassed, nova-compute start to execute rebuilding"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_db503561","line":23,"in_reply_to":"1a95cdbc_d699867a","updated":"2016-10-13 03:15:32.000000000","message":"Done","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":23,"context_line":"unpredictable and inconclusive, for example: do the concurrent operation"},{"line_number":24,"context_line":"rebuilding-instance and detaching-volume for the same instance. Because"},{"line_number":25,"context_line":"task_state of instance isn\u0027t set when detaching volume,"},{"line_number":26,"context_line":"@check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":27,"context_line":"and detaching-volume on one instance at the same time. It cause the"},{"line_number":28,"context_line":"unpredictable result, sometimes the operations were successful, but"},{"line_number":29,"context_line":"sometimes it would be fails according to the time sequence of concurrent"}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_76a6f2ae","line":26,"updated":"2016-10-13 00:06:30.000000000","message":"s/start to execute/starts to execute/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":24,"context_line":"rebuilding-instance and detaching-volume for the same instance. Because"},{"line_number":25,"context_line":"task_state of instance isn\u0027t set when detaching volume,"},{"line_number":26,"context_line":"@check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":27,"context_line":"and detaching-volume on one instance at the same time. It cause the"},{"line_number":28,"context_line":"unpredictable result, sometimes the operations were successful, but"},{"line_number":29,"context_line":"sometimes it would be fails according to the time sequence of concurrent"},{"line_number":30,"context_line":"operations. We should do these tasks one by one."}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_f6b842ca","line":27,"updated":"2016-10-13 00:06:30.000000000","message":"s/on one instance//\ns/It cause the/It causes an/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":25,"context_line":"task_state of instance isn\u0027t set when detaching volume,"},{"line_number":26,"context_line":"@check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":27,"context_line":"and detaching-volume on one instance at the same time. It cause the"},{"line_number":28,"context_line":"unpredictable result, sometimes the operations were successful, but"},{"line_number":29,"context_line":"sometimes it would be fails according to the time sequence of concurrent"},{"line_number":30,"context_line":"operations. We should do these tasks one by one."},{"line_number":31,"context_line":""}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_5637364c","line":28,"updated":"2016-10-13 00:06:30.000000000","message":"s/were successful/are successful/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":26,"context_line":"@check_instance_state is bypassed, nova-compute start to execute rebuilding"},{"line_number":27,"context_line":"and detaching-volume on one instance at the same time. It cause the"},{"line_number":28,"context_line":"unpredictable result, sometimes the operations were successful, but"},{"line_number":29,"context_line":"sometimes it would be fails according to the time sequence of concurrent"},{"line_number":30,"context_line":"operations. We should do these tasks one by one."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Think about the following failed case:"}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_963d3e2d","line":29,"updated":"2016-10-13 00:06:30.000000000","message":"s/be fails according to the/fail, depending on the/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":27,"context_line":"and detaching-volume on one instance at the same time. It cause the"},{"line_number":28,"context_line":"unpredictable result, sometimes the operations were successful, but"},{"line_number":29,"context_line":"sometimes it would be fails according to the time sequence of concurrent"},{"line_number":30,"context_line":"operations. We should do these tasks one by one."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Think about the following failed case:"},{"line_number":33,"context_line":"  1. start to detach volume from instance in nova-api"}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_d0018906","line":30,"updated":"2016-10-13 00:06:30.000000000","message":"s/We should do these tasks one by one/We should ensure that for certain operations, we only permit a single user to execute at a time/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":29,"context_line":"sometimes it would be fails according to the time sequence of concurrent"},{"line_number":30,"context_line":"operations. We should do these tasks one by one."},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Think about the following failed case:"},{"line_number":33,"context_line":"  1. start to detach volume from instance in nova-api"},{"line_number":34,"context_line":"  2. start to rebuild instance in nova-api, get the instance bdms from db,"},{"line_number":35,"context_line":"     because the detaching volume don\u0027t finish, so the bdms contain the"}],"source_content_type":"text/x-rst","patch_set":20,"id":"1a95cdbc_f0520512","line":32,"updated":"2016-10-13 00:06:30.000000000","message":"s/failed case/scenario/","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":55,"context_line":"know they are doing some wrong things."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"},{"line_number":58,"context_line":"parallel now, the backwards compatibility of the API can\u0027t be broken."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_6fc047e1","line":58,"updated":"2016-10-13 00:06:30.000000000","message":"It\u0027s concurrent attach/detach of multiple instances to a single volume, not multiple concurrent calls to attach the same volume (or different volumes) to the same instance...","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b35c0916a5eec1c3b996fca623d05f9fbba65288","unresolved":false,"context_lines":[{"line_number":55,"context_line":"know they are doing some wrong things."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"},{"line_number":58,"context_line":"parallel now, the backwards compatibility of the API can\u0027t be broken."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_ef8537ad","line":58,"updated":"2016-10-13 00:06:30.000000000","message":"It\u0027s concurrent attach/detach of multiple instances to a single volume, not multiple concurrent calls to attach the same volume (or different volumes) to the same instance...","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"10a49dd3137154353e2331be1e949ecf5aa93e1a","unresolved":false,"context_lines":[{"line_number":55,"context_line":"know they are doing some wrong things."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"},{"line_number":58,"context_line":"parallel now, the backwards compatibility of the API can\u0027t be broken."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_7ba00944","line":58,"in_reply_to":"fa6399be_6fc047e1","updated":"2016-10-13 03:15:32.000000000","message":"Done","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"10a49dd3137154353e2331be1e949ecf5aa93e1a","unresolved":false,"context_lines":[{"line_number":55,"context_line":"know they are doing some wrong things."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"},{"line_number":58,"context_line":"parallel now, the backwards compatibility of the API can\u0027t be broken."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_bb8aa1bd","line":58,"in_reply_to":"fa6399be_6fc047e1","updated":"2016-10-13 03:15:32.000000000","message":"Done","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"10a49dd3137154353e2331be1e949ecf5aa93e1a","unresolved":false,"context_lines":[{"line_number":55,"context_line":"know they are doing some wrong things."},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"Notes: we support the concurrent attach/detach multiple volumes/interfaces in"},{"line_number":58,"context_line":"parallel now, the backwards compatibility of the API can\u0027t be broken."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"Proposed change"}],"source_content_type":"text/x-rst","patch_set":20,"id":"fa6399be_db8595ad","line":58,"in_reply_to":"fa6399be_ef8537ad","updated":"2016-10-13 03:15:32.000000000","message":"Done","commit_id":"b60d7f6d80672900b72f91bf3aefc4d7f7f987cd"}],"specs/ocata/approved/task-states-improvement.rst":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40b5440a89ada5de301e182b1f80e96817842546","unresolved":false,"context_lines":[{"line_number":20,"context_line":"the task state of the instance is unchanged. This can cause some issues."},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"In some API scenarios with concurrent requests, operation results are"},{"line_number":23,"context_line":"unpredictable and inconclusive; for example when one performs a concurrent"},{"line_number":24,"context_line":"operation rebuilding-instance and detaching-volume for the same instance."},{"line_number":25,"context_line":"Because task_state of instance isn\u0027t set when detaching volume,"},{"line_number":26,"context_line":"@check_instance_state is bypassed, nova-compute starts to execute rebuilding"}],"source_content_type":"text/x-rst","patch_set":22,"id":"fa6399be_ff222251","line":23,"range":{"start_line":23,"start_character":18,"end_line":23,"end_character":30},"updated":"2016-10-13 17:10:22.000000000","message":"I don\u0027t think this is the right word.","commit_id":"3277c132bc62cf6399286f39fd9382ce99a58972"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40b5440a89ada5de301e182b1f80e96817842546","unresolved":false,"context_lines":[{"line_number":94,"context_line":"detaching-volume, attaching-interface, detaching-interface. And we should make"},{"line_number":95,"context_line":"sure nova-compute init workflow isn\u0027t impacted by the new task state."},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"In upgrade scenario, it is possible that there will be APIs servers on version"},{"line_number":98,"context_line":"n of the code and compute managers on version n-1. So we need to allow for the"},{"line_number":99,"context_line":"case that the compute managers do not handle the task states. We can use"},{"line_number":100,"context_line":"rpcapi.can_send_version() to check whether the target is matched, if not, reset"}],"source_content_type":"text/x-rst","patch_set":22,"id":"fa6399be_158975c9","line":97,"range":{"start_line":97,"start_character":55,"end_line":97,"end_character":59},"updated":"2016-10-13 17:10:22.000000000","message":"s/APIs/API/","commit_id":"3277c132bc62cf6399286f39fd9382ce99a58972"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40b5440a89ada5de301e182b1f80e96817842546","unresolved":false,"context_lines":[{"line_number":99,"context_line":"case that the compute managers do not handle the task states. We can use"},{"line_number":100,"context_line":"rpcapi.can_send_version() to check whether the target is matched, if not, reset"},{"line_number":101,"context_line":"the instance.task_state to None in attach/detach/swap volume/interface rpc api."},{"line_number":102,"context_line":"We need a new rpc api version to ship this logic."},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"Alternatives"},{"line_number":105,"context_line":"------------"}],"source_content_type":"text/x-rst","patch_set":22,"id":"fa6399be_3580398b","line":102,"updated":"2016-10-13 17:10:22.000000000","message":"I\u0027m not sure this is important. We can probably handle this in instance.save(), which always runs on the conductors not the computes. Having the RPC API tweak the instance state (even in memory) is not a good idea, IMHO.","commit_id":"3277c132bc62cf6399286f39fd9382ce99a58972"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"40b5440a89ada5de301e182b1f80e96817842546","unresolved":false,"context_lines":[{"line_number":104,"context_line":"Alternatives"},{"line_number":105,"context_line":"------------"},{"line_number":106,"context_line":""},{"line_number":107,"context_line":"None"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"Data model impact"},{"line_number":110,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":22,"id":"fa6399be_352e79a5","line":107,"updated":"2016-10-13 17:10:22.000000000","message":"One alternative is to do nothing. However:\n\nI wonder if another alternative would be to use the existing BLOCK_DEVICE_MAPPING and NETWORKING states for volume and interface attach respectively?","commit_id":"3277c132bc62cf6399286f39fd9382ce99a58972"}]}
