)]}'
{"specs/train/approved/enable-rebuild-for-instances-in-cell0.rst":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8f575480d641729b66fd52a82654691afe9b986a","unresolved":false,"context_lines":[{"line_number":19,"context_line":"have successfully started up before. But if a user tries to rebuild an instance"},{"line_number":20,"context_line":"that was never launched before because scheduler failed to find a valid host"},{"line_number":21,"context_line":"due to the lack of available resources, the request fails with an exception of"},{"line_number":22,"context_line":"type ``InstanceInvalidState``. We are not addressing the case were the server"},{"line_number":23,"context_line":"was never launched due to exceeding the maximum number of build retries."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Use Cases"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_ef951533","line":22,"range":{"start_line":22,"start_character":7,"end_line":22,"end_character":27},"updated":"2019-04-09 19:59:13.000000000","message":"Adding a footnote reference to https://github.com/openstack/nova/blob/d42a007425d9adb691134137e1e0b7dda356df62/nova/compute/api.py#L147 would be useful.","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":19,"context_line":"have successfully started up before. But if a user tries to rebuild an instance"},{"line_number":20,"context_line":"that was never launched before because scheduler failed to find a valid host"},{"line_number":21,"context_line":"due to the lack of available resources, the request fails with an exception of"},{"line_number":22,"context_line":"type ``InstanceInvalidState``. We are not addressing the case were the server"},{"line_number":23,"context_line":"was never launched due to exceeding the maximum number of build retries."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"Use Cases"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_d6aa1f82","line":22,"range":{"start_line":22,"start_character":7,"end_line":22,"end_character":27},"in_reply_to":"5fc1f717_ef951533","updated":"2019-04-10 16:40:15.000000000","message":"Done","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8f575480d641729b66fd52a82654691afe9b986a","unresolved":false,"context_lines":[{"line_number":32,"context_line":"   execution of these actions I want to be able to rebuild the server that"},{"line_number":33,"context_line":"   failed."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"   NOTE::"},{"line_number":36,"context_line":"   Adding the PENDING state as well as setting instances to it, are out of the"},{"line_number":37,"context_line":"   scope of this spec, as they are being addressed by another change[1]."},{"line_number":38,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_6f74c536","line":35,"range":{"start_line":35,"start_character":3,"end_line":35,"end_character":9},"updated":"2019-04-09 19:59:13.000000000","message":"This doesn\u0027t format properly, should be:\n\n.. note:: Adding the PENDING....","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":32,"context_line":"   execution of these actions I want to be able to rebuild the server that"},{"line_number":33,"context_line":"   failed."},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"   NOTE::"},{"line_number":36,"context_line":"   Adding the PENDING state as well as setting instances to it, are out of the"},{"line_number":37,"context_line":"   scope of this spec, as they are being addressed by another change[1]."},{"line_number":38,"context_line":""}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_b6a753bc","line":35,"range":{"start_line":35,"start_character":3,"end_line":35,"end_character":9},"in_reply_to":"5fc1f717_6f74c536","updated":"2019-04-10 16:40:15.000000000","message":"Done","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8f575480d641729b66fd52a82654691afe9b986a","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"   NOTE::"},{"line_number":36,"context_line":"   Adding the PENDING state as well as setting instances to it, are out of the"},{"line_number":37,"context_line":"   scope of this spec, as they are being addressed by another change[1]."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"Proposed change"},{"line_number":40,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_4fbc69ba","line":37,"range":{"start_line":37,"start_character":68,"end_line":37,"end_character":71},"updated":"2019-04-09 19:59:13.000000000","message":"nit: use proper footnotes:\n\nhttp://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#footnotes","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"   NOTE::"},{"line_number":36,"context_line":"   Adding the PENDING state as well as setting instances to it, are out of the"},{"line_number":37,"context_line":"   scope of this spec, as they are being addressed by another change[1]."},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"Proposed change"},{"line_number":40,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_16a507b5","line":37,"range":{"start_line":37,"start_character":68,"end_line":37,"end_character":71},"in_reply_to":"5fc1f717_4fbc69ba","updated":"2019-04-10 16:40:15.000000000","message":"Done","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d79ae7b4d54de8b70ab6db7c3dbf4bddf4507d6f","unresolved":false,"context_lines":[{"line_number":46,"context_line":"   a new BuildRequest and update the instance mapping."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"#. At this point the api should also delete the instance records from cell0 DB."},{"line_number":49,"context_line":"   If this is a soft delete, then after the successful completion of the"},{"line_number":50,"context_line":"   operation, we would end up with one record of the instance in the new cell\u0027s"},{"line_number":51,"context_line":"   DB and a record of the same instance in cell0 (deleted\u003dTrue). A better"},{"line_number":52,"context_line":"   approach, here, would be to hard delete the instance\u0027s information from"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_0f9f4102","line":49,"updated":"2019-04-09 20:04:19.000000000","message":"When I originally reviewed this (https://review.openstack.org/#/c/554218/) I assumed this was soft delete as in the SOFT_DELETED status in the API, but now I know you\u0027re talking about (soft) delete where the records\u0027 deleted value is non-zero.","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":46,"context_line":"   a new BuildRequest and update the instance mapping."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"#. At this point the api should also delete the instance records from cell0 DB."},{"line_number":49,"context_line":"   If this is a soft delete, then after the successful completion of the"},{"line_number":50,"context_line":"   operation, we would end up with one record of the instance in the new cell\u0027s"},{"line_number":51,"context_line":"   DB and a record of the same instance in cell0 (deleted\u003dTrue). A better"},{"line_number":52,"context_line":"   approach, here, would be to hard delete the instance\u0027s information from"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_0c965cf1","line":49,"in_reply_to":"5fc1f717_0f9f4102","updated":"2019-04-10 16:40:15.000000000","message":"I\u0027ll try to make it clearer","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8f575480d641729b66fd52a82654691afe9b986a","unresolved":false,"context_lines":[{"line_number":50,"context_line":"   operation, we would end up with one record of the instance in the new cell\u0027s"},{"line_number":51,"context_line":"   DB and a record of the same instance in cell0 (deleted\u003dTrue). A better"},{"line_number":52,"context_line":"   approach, here, would be to hard delete the instance\u0027s information from"},{"line_number":53,"context_line":"   cell0. While rebuilding the instance and before deleting it from cell0,"},{"line_number":54,"context_line":"   a user could try to update it (i.e. its metadata, tags, etc). We, then,"},{"line_number":55,"context_line":"   might end up in race and those changes end up not making it across to the"},{"line_number":56,"context_line":"   new cell. Although, the window, for this, is really small, we have to metion"},{"line_number":57,"context_line":"   it here."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_cfccd962","line":54,"range":{"start_line":53,"start_character":10,"end_line":54,"end_character":64},"updated":"2019-04-09 19:59:13.000000000","message":"Is it possible to do that on an instance with the task_state set?\n\nhttps://github.com/openstack/nova/blob/d42a007425d9adb691134137e1e0b7dda356df62/nova/compute/api.py#L4501\n\nhttps://github.com/openstack/nova/blob/d42a007425d9adb691134137e1e0b7dda356df62/nova/api/openstack/compute/server_tags.py#L53\n\nDoesn\u0027t look like it - am I missing something?","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":50,"context_line":"   operation, we would end up with one record of the instance in the new cell\u0027s"},{"line_number":51,"context_line":"   DB and a record of the same instance in cell0 (deleted\u003dTrue). A better"},{"line_number":52,"context_line":"   approach, here, would be to hard delete the instance\u0027s information from"},{"line_number":53,"context_line":"   cell0. While rebuilding the instance and before deleting it from cell0,"},{"line_number":54,"context_line":"   a user could try to update it (i.e. its metadata, tags, etc). We, then,"},{"line_number":55,"context_line":"   might end up in race and those changes end up not making it across to the"},{"line_number":56,"context_line":"   new cell. Although, the window, for this, is really small, we have to metion"},{"line_number":57,"context_line":"   it here."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_0f616ea9","line":54,"range":{"start_line":53,"start_character":10,"end_line":54,"end_character":64},"in_reply_to":"5fc1f717_cfccd962","updated":"2019-04-10 16:40:15.000000000","message":"Hmm.. I was under the impression that this wasn\u0027t checked.. I think you are right I can remove this part.","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"804d124d93eefbb66c2feebce59e14b9f842a516","unresolved":false,"context_lines":[{"line_number":69,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":70,"context_line":"   appropriate."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The only problem is that when an instance fails during build, its network_info"},{"line_number":73,"context_line":"field is empty. Currently there is no way to recover the requested networks"},{"line_number":74,"context_line":"while trying to rebuild the instance. So the NetworkRequestList object"},{"line_number":75,"context_line":"should be stored while building the server."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_e021919f","line":72,"updated":"2019-04-10 15:12:54.000000000","message":"Technically we have the same problem for some other fields (I haven\u0027t done an extensive audit), but personality files also comes to mind since we don\u0027t persist those anywhere during the initial server create. Now the rebuild API does have a personality files parameter *except* that parameter was deprecated in 2.56:\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003drebuild-server-rebuild-action-detail#rebuild-server-rebuild-action\n\nSo if I try to create a server with personality files using microversion 2.1, it fails, and then try to rebuild from cell0 with the new microversion for this change, I\u0027ve lost the personality files and can\u0027t provide them with the rebuild call - that\u0027s probably a limitation worth documenting, although granted we deprecated personality files for a reason so it\u0027s just that, a limitation and people can\u0027t rely on them if they want to use this rebuild from cell0 thing (that or we have to consider persisting personality files in the RequestSpec).\n\nLuckily you can specify a key_name during rebuild because we don\u0027t persist that with the RequestSpec either (but we could pull it off the instance in cell0 before destroying it). Same for trusted_image_certificates (you have to do the same for block_device_mappings and tags right? Since those aren\u0027t in the RequestSpec).\n\nconfig_drive is another parameter on server create that is not available in the rebuild API and is not persisted in the RequestSpec so you\u0027d have to pull it from the instance in cell0.","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3251c77478dbb188faba2c338e1ed8280305659b","unresolved":false,"context_lines":[{"line_number":69,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":70,"context_line":"   appropriate."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The only problem is that when an instance fails during build, its network_info"},{"line_number":73,"context_line":"field is empty. Currently there is no way to recover the requested networks"},{"line_number":74,"context_line":"while trying to rebuild the instance. So the NetworkRequestList object"},{"line_number":75,"context_line":"should be stored while building the server."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_a0ff0932","line":72,"in_reply_to":"5fc1f717_0007fd83","updated":"2019-04-10 15:32:56.000000000","message":"I posted this limitation on the ML as well:\n\nhttp://lists.openstack.org/pipermail/openstack-discuss/2019-April/004901.html","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":69,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":70,"context_line":"   appropriate."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The only problem is that when an instance fails during build, its network_info"},{"line_number":73,"context_line":"field is empty. Currently there is no way to recover the requested networks"},{"line_number":74,"context_line":"while trying to rebuild the instance. So the NetworkRequestList object"},{"line_number":75,"context_line":"should be stored while building the server."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_36c6036a","line":72,"in_reply_to":"5fc1f717_a0ff0932","updated":"2019-04-10 16:40:15.000000000","message":"\u003e I posted this limitation on the ML as well:\n \u003e \n \u003e http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004901.html\n\nI saw that. Thanks a lot. I added a reference to it","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"115b8146386121dded84472945aafd63d3389f23","unresolved":false,"context_lines":[{"line_number":69,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":70,"context_line":"   appropriate."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The only problem is that when an instance fails during build, its network_info"},{"line_number":73,"context_line":"field is empty. Currently there is no way to recover the requested networks"},{"line_number":74,"context_line":"while trying to rebuild the instance. So the NetworkRequestList object"},{"line_number":75,"context_line":"should be stored while building the server."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_0007fd83","line":72,"in_reply_to":"5fc1f717_e021919f","updated":"2019-04-10 15:24:38.000000000","message":"\u003e Now the rebuild API does have a personality files parameter *except* that parameter was deprecated in 2.56:\n\nSorry it\u0027s 2.57:\n\nhttps://docs.openstack.org/nova/latest/reference/api-microversion-history.html#id52","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":69,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":70,"context_line":"   appropriate."},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"The only problem is that when an instance fails during build, its network_info"},{"line_number":73,"context_line":"field is empty. Currently there is no way to recover the requested networks"},{"line_number":74,"context_line":"while trying to rebuild the instance. So the NetworkRequestList object"},{"line_number":75,"context_line":"should be stored while building the server."}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_f6a15baa","line":72,"in_reply_to":"5fc1f717_e021919f","updated":"2019-04-10 16:40:15.000000000","message":"Added the personality files problem saying that either we can persist them or document the limitation","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d79ae7b4d54de8b70ab6db7c3dbf4bddf4507d6f","unresolved":false,"context_lines":[{"line_number":90,"context_line":"Alternatives"},{"line_number":91,"context_line":"------------"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"None."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"Data model impact"},{"line_number":96,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_8ff57153","line":93,"updated":"2019-04-09 20:04:19.000000000","message":"I\u0027m reminded of several comments I made in the original spec in Stein which never had follow up changes to the spec - we could take this opportunity to answer/clarify those for this spec:\n\nhttps://review.openstack.org/#/c/554218/","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":90,"context_line":"Alternatives"},{"line_number":91,"context_line":"------------"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"None."},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"Data model impact"},{"line_number":96,"context_line":"-----------------"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_8ff9dec8","line":93,"in_reply_to":"5fc1f717_8ff57153","updated":"2019-04-10 16:40:15.000000000","message":"Yes I\u0027ll try to answer your questions here","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8f575480d641729b66fd52a82654691afe9b986a","unresolved":false,"context_lines":[{"line_number":168,"context_line":"Testing"},{"line_number":169,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"#. Unit and functional tests have to be added to verify the rebuilding of"},{"line_number":172,"context_line":"   instances in cell0."},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Documentation Impact"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_af3f0d23","line":171,"updated":"2019-04-09 19:59:13.000000000","message":"This could certainly be more detailed about the types and scope of functional tests to make sure things like bdms and tags are managed correctly through the rebuild process.","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"1f8c0c535115462a187ce3307dc30a65cb6ccb88","unresolved":false,"context_lines":[{"line_number":168,"context_line":"Testing"},{"line_number":169,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"#. Unit and functional tests have to be added to verify the rebuilding of"},{"line_number":172,"context_line":"   instances in cell0."},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"Documentation Impact"}],"source_content_type":"text/x-rst","patch_set":1,"id":"5fc1f717_a0514964","line":171,"in_reply_to":"5fc1f717_af3f0d23","updated":"2019-04-10 16:40:15.000000000","message":"Done","commit_id":"9e1c06a404fc944a3a769e7374e8457af89ee043"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bc16d59bc4a85b302908144885e37ebbf10bbc75","unresolved":false,"context_lines":[{"line_number":43,"context_line":"scheduling failures caused by lack of resources would then be like this:"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"#. The nova-api, after identifying an instance as being in cell0, should create"},{"line_number":46,"context_line":"   a new BuildRequest and update the instance mapping."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"#. At this point the api should also delete the instance records from cell0 DB."},{"line_number":49,"context_line":"   If this is a soft delete [#]_, then after the successful completion of the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_5c1809d2","line":46,"range":{"start_line":46,"start_character":26,"end_line":46,"end_character":53},"updated":"2019-04-16 18:06:37.000000000","message":"In what way? To set cell_mapping \u003d None?","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":43,"context_line":"scheduling failures caused by lack of resources would then be like this:"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"#. The nova-api, after identifying an instance as being in cell0, should create"},{"line_number":46,"context_line":"   a new BuildRequest and update the instance mapping."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"#. At this point the api should also delete the instance records from cell0 DB."},{"line_number":49,"context_line":"   If this is a soft delete [#]_, then after the successful completion of the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_ef3ed6d8","line":46,"range":{"start_line":46,"start_character":26,"end_line":46,"end_character":53},"in_reply_to":"3fce034c_5c1809d2","updated":"2019-04-16 21:37:33.000000000","message":"Yeah: https://review.openstack.org/#/c/570203/15/nova/compute/api.py@3514","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":43,"context_line":"scheduling failures caused by lack of resources would then be like this:"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"#. The nova-api, after identifying an instance as being in cell0, should create"},{"line_number":46,"context_line":"   a new BuildRequest and update the instance mapping."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"#. At this point the api should also delete the instance records from cell0 DB."},{"line_number":49,"context_line":"   If this is a soft delete [#]_, then after the successful completion of the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_f20c793c","line":46,"range":{"start_line":46,"start_character":26,"end_line":46,"end_character":53},"in_reply_to":"3fce034c_5c1809d2","updated":"2019-06-07 11:48:53.000000000","message":"Yes this was the initial idea, although because of [1] it\u0027s not possible right now. I don\u0027t know if there is a reason for not allowing the update an instance_mapping with None as cell_id. The point of this is to point the API to the build request.\n\n[1]https://github.com/openstack/nova/blob/master/nova/objects/instance_mapping.py#L73","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"86a360f0d7dd4257fe62a34db05efec941ac7718","unresolved":false,"context_lines":[{"line_number":43,"context_line":"scheduling failures caused by lack of resources would then be like this:"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"#. The nova-api, after identifying an instance as being in cell0, should create"},{"line_number":46,"context_line":"   a new BuildRequest and update the instance mapping."},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"#. At this point the api should also delete the instance records from cell0 DB."},{"line_number":49,"context_line":"   If this is a soft delete [#]_, then after the successful completion of the"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9fb8cfa7_de00fc36","line":46,"range":{"start_line":46,"start_character":26,"end_line":46,"end_character":53},"in_reply_to":"3fce034c_f20c793c","updated":"2019-06-28 01:05:18.000000000","message":"I\u0027m not sure why you can\u0027t reset the cell_id to None, you can definitely change the cell mapping on an instance mapping - I do this for the cross-cell resize series. But that\u0027s an implementation detail we can tackle (maybe we need to delete and recreate the instance mapping?).","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bc16d59bc4a85b302908144885e37ebbf10bbc75","unresolved":false,"context_lines":[{"line_number":56,"context_line":"   ``rebuild_instance_in_cell0``. This new method\u0027s purpose is almost (if not"},{"line_number":57,"context_line":"   exactly) the same as the existing ``schedule_and_build_instances``. So we"},{"line_number":58,"context_line":"   could either call to it internally or extract parts of it\u0027s functionality"},{"line_number":59,"context_line":"   and reuse them."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"#. Finally, an RPC API call is needed from the conductor to the compute"},{"line_number":62,"context_line":"   service of the selected cell. The ``rebuild_instance`` method tries to"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_dc687922","line":59,"updated":"2019-04-16 18:06:37.000000000","message":"What\u0027s the reason it has to be a new method and not just call \u0027schedule_and_build_instances\u0027 directly? Would be nice to add why to this paragraph.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":56,"context_line":"   ``rebuild_instance_in_cell0``. This new method\u0027s purpose is almost (if not"},{"line_number":57,"context_line":"   exactly) the same as the existing ``schedule_and_build_instances``. So we"},{"line_number":58,"context_line":"   could either call to it internally or extract parts of it\u0027s functionality"},{"line_number":59,"context_line":"   and reuse them."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"#. Finally, an RPC API call is needed from the conductor to the compute"},{"line_number":62,"context_line":"   service of the selected cell. The ``rebuild_instance`` method tries to"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_cf143a51","line":59,"in_reply_to":"3fce034c_dc687922","updated":"2019-04-16 21:37:33.000000000","message":"Good point, and I\u0027ve -1ed the code change as a result:\n\nhttps://review.openstack.org/#/c/570203/15/nova/compute/api.py@3531","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":56,"context_line":"   ``rebuild_instance_in_cell0``. This new method\u0027s purpose is almost (if not"},{"line_number":57,"context_line":"   exactly) the same as the existing ``schedule_and_build_instances``. So we"},{"line_number":58,"context_line":"   could either call to it internally or extract parts of it\u0027s functionality"},{"line_number":59,"context_line":"   and reuse them."},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"#. Finally, an RPC API call is needed from the conductor to the compute"},{"line_number":62,"context_line":"   service of the selected cell. The ``rebuild_instance`` method tries to"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_327a0188","line":59,"in_reply_to":"3fce034c_dc687922","updated":"2019-06-07 11:48:53.000000000","message":"I agree, the reason behind this was mainly, to not call, from rebuild code in the API, schedule and build code in the super-conductor. The idea was to extract common functionality, but in the end we need to do exactly what ``schedule_and_build_instances`` does, since the instance has to go through scheduling again. If it\u0027s ok the wrapper could be easily dropped.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"bc16d59bc4a85b302908144885e37ebbf10bbc75","unresolved":false,"context_lines":[{"line_number":63,"context_line":"   destroy an existing instance and then re-create it. In this case and since"},{"line_number":64,"context_line":"   the instance was in cell0, there is nothing to destroy and re-create. So,"},{"line_number":65,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_1c604132","line":66,"updated":"2019-04-16 18:06:37.000000000","message":"If we\u0027re able to call \u0027schedule_and_build_instances\u0027 directly (in the previous bullet point), then we get the call to \u0027build_and_run_instance\u0027 for free right?","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8c11e3174430ea23925087ebec3ad9a38c697e8a","unresolved":false,"context_lines":[{"line_number":63,"context_line":"   destroy an existing instance and then re-create it. In this case and since"},{"line_number":64,"context_line":"   the instance was in cell0, there is nothing to destroy and re-create. So,"},{"line_number":65,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_bdb24793","line":66,"in_reply_to":"3fce034c_1c604132","updated":"2019-04-16 20:26:19.000000000","message":"He actually just has a very light wrapper in conductor for the new method:\n\nhttps://review.openstack.org/#/c/570203/15/nova/conductor/manager.py@1342\n\nBut looking at that again I agree I\u0027m not sure why we need it, the only difference is schedule_and_build_instances takes a list of build requests and such and rebuild_instance_in_cell0 takes a single build request etc.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":63,"context_line":"   destroy an existing instance and then re-create it. In this case and since"},{"line_number":64,"context_line":"   the instance was in cell0, there is nothing to destroy and re-create. So,"},{"line_number":65,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_12ea650e","line":66,"in_reply_to":"3fce034c_1c604132","updated":"2019-06-07 11:48:53.000000000","message":"You are right","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":65,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"},{"line_number":70,"context_line":"the instance buried in cell0."},{"line_number":71,"context_line":"Currently, there is no way to recover the requested networks while trying to"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_d257fd01","line":68,"updated":"2019-04-16 21:37:33.000000000","message":"You don\u0027t necessarily need to call it out in the spec, but the rebuild API does allow the user to change the keypair and trusted_image_certificates, and if they provide them to the rebuild API we should honor those and not re-use what was stored with the instance in cell0. I\u0027m not sure if your code is already handling that.\n\nYou should definitely have a functional test where you create the server with a certain keyname and trusted image cert but then overwrite that on rebuild from cell0 and assert the key/trusted image cert IDs were used from rebuild and not copied from server create.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"86a360f0d7dd4257fe62a34db05efec941ac7718","unresolved":false,"context_lines":[{"line_number":65,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"},{"line_number":70,"context_line":"the instance buried in cell0."},{"line_number":71,"context_line":"Currently, there is no way to recover the requested networks while trying to"}],"source_content_type":"text/x-rst","patch_set":2,"id":"9fb8cfa7_5ec3aced","line":68,"in_reply_to":"3fce034c_52554dc5","updated":"2019-06-28 01:05:18.000000000","message":"\u003e oh yes. I seem to have forgotten about this.. Sure this can be\n \u003e handled in the API.\n\nThis was added to the functional test section below so we have a reminder, works for me.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":65,"context_line":"   an RPC API call to the existing method ``build_and_run_instance`` seems"},{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"},{"line_number":70,"context_line":"the instance buried in cell0."},{"line_number":71,"context_line":"Currently, there is no way to recover the requested networks while trying to"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_52554dc5","line":68,"in_reply_to":"3fce034c_d257fd01","updated":"2019-06-07 11:48:53.000000000","message":"oh yes. I seem to have forgotten about this.. Sure this can be handled in the API.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"},{"line_number":70,"context_line":"the instance buried in cell0."},{"line_number":71,"context_line":"Currently, there is no way to recover the requested networks while trying to"},{"line_number":72,"context_line":"rebuild the instance. For this:"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_af09ae31","line":69,"range":{"start_line":69,"start_character":43,"end_line":69,"end_character":56},"updated":"2019-04-16 21:37:33.000000000","message":"config_drive","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":66,"context_line":"   appropriate."},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"Information provided by the user in the initial request such as keypair,"},{"line_number":69,"context_line":"trusted_image_certificates, BDMs, tags and config_driver can be retrieved from"},{"line_number":70,"context_line":"the instance buried in cell0."},{"line_number":71,"context_line":"Currently, there is no way to recover the requested networks while trying to"},{"line_number":72,"context_line":"rebuild the instance. For this:"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_c90c2b3d","line":69,"range":{"start_line":69,"start_character":43,"end_line":69,"end_character":56},"in_reply_to":"3fce034c_af09ae31","updated":"2019-06-07 11:48:53.000000000","message":"oops","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":83,"context_line":"The same applies for personality files, that can be provided during the initial"},{"line_number":84,"context_line":"create request and since microversion 2.57 it is deprecated from the rebuild"},{"line_number":85,"context_line":"API [#]_. Since the field is not persisted we have no way of retrieving them"},{"line_number":86,"context_line":"during rebuild from cell0. For this:"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"#. Handle personality files  as requested networks and persist them in the"},{"line_number":89,"context_line":"   RequestSpec."}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_b20ef12f","line":86,"range":{"start_line":86,"start_character":27,"end_line":86,"end_character":36},"updated":"2019-04-16 21:37:33.000000000","message":"What you have listed here is alternatives correct? Maybe clarify that by saying, \"For this we have a couple of alternatives:\"","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":83,"context_line":"The same applies for personality files, that can be provided during the initial"},{"line_number":84,"context_line":"create request and since microversion 2.57 it is deprecated from the rebuild"},{"line_number":85,"context_line":"API [#]_. Since the field is not persisted we have no way of retrieving them"},{"line_number":86,"context_line":"during rebuild from cell0. For this:"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"#. Handle personality files  as requested networks and persist them in the"},{"line_number":89,"context_line":"   RequestSpec."}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_b26fd190","line":86,"range":{"start_line":86,"start_character":27,"end_line":86,"end_character":36},"in_reply_to":"3fce034c_b20ef12f","updated":"2019-06-07 11:48:53.000000000","message":"Done","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"#. Document this as a limitation of the feature and that if people would like"},{"line_number":92,"context_line":"   to use the new rebuild functionality they should not use personality files."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"There is an ongoing discussion on how to handle personality files in the"},{"line_number":95,"context_line":"mailing list [#]_."},{"line_number":96,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_d2f37d09","line":93,"updated":"2019-04-16 21:37:33.000000000","message":"Dan had another alternative in the ML thread:\n\nhttp://lists.openstack.org/pipermail/openstack-discuss/2019-April/004904.html\n\n\u003e Another alternative would be to chuck something into system_metadata for\nthe instance that says \"this was created with personality files\". We\ncould use that for the rebuild-from-cell0 operation, or any other future\none that can\u0027t honor those files and just fail the request. \"Sorry bro,\nthis instance was created in a way that can\u0027t support this request.\"\n\nSo that\u0027s kind of a mix of the two alternatives here - if the user created a server with personality files we track that in system_metadata and then when rebuilding from cell0 if we check that we fail since we can\u0027t honor the original server create request. We\u0027d at least then not accept the rebuild from cell0 but not inject the files which could lead to a failure late when the application in the guest, which depends on those injected files, doesn\u0027t work since they aren\u0027t there.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"#. Document this as a limitation of the feature and that if people would like"},{"line_number":92,"context_line":"   to use the new rebuild functionality they should not use personality files."},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"There is an ongoing discussion on how to handle personality files in the"},{"line_number":95,"context_line":"mailing list [#]_."},{"line_number":96,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_52030db9","line":93,"in_reply_to":"3fce034c_d2f37d09","updated":"2019-06-07 11:48:53.000000000","message":"Adding this also.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ef3a7642a75db8bbd08c6009137f11f60eb2d5b4","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"There is an ongoing discussion on how to handle personality files in the"},{"line_number":95,"context_line":"mailing list [#]_."},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"Alternatives"},{"line_number":98,"context_line":"------------"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"ffb9cba7_f4f25e06","line":96,"updated":"2019-04-23 13:02:46.000000000","message":"Another thing I got thinking about lately is quota. The server create flow checks quota for a few things (instances/cores/ram [1] and server group members [2]) before casting to conductor, and then schedule_and_build_instances in conductor checks instances/cores/ram quota again [3] in case of a concurrent server create race. The server create flow also checks port quota [4].\n\nIn thinking about how counting quota usage works today, in a rebuild from cell0 scenario we should be OK for instances/cores/ram/server group members quota because we passed server create and the flavor and group membership isn\u0027t changing during rebuild and those records are already in the DB for counting.\n\nThe port usage could have changed though, which means when rebuilding from cell0 we could fail late in the compute service trying to create a new port (or allocate a fixed IP for an existing port), not to mention the original network could be gone (that\u0027s probably rare). I think in either case the late failure in compute is probably acceptable and we don\u0027t need to duplicate that port quota check in the API for rebuild. If the user hits that, their server is basically dead and they need to delete and start over with a new server create request. I try to think of rebuild from cell0 as best effort.\n\nNow if you\u0027re using placement to count cores/ram usage [5], which CERN will be, things will be a bit different because that is counted based on allocations in placement which don\u0027t get created until the scheduler creates them after picking a host. This does mean you could create a server and pass quota checks at t0, fail to schedule and go into cell0, create another server at t1 which maxes out the quota usage for the tenant, and then rebuild the first server from cell0 which could put you over quota if we don\u0027t check cores/ram usage again during that rebuild from cell0 flow (again, this is just in the counting-from-placement scenario). But maybe we\u0027re OK here because of the cores/ram count in conductor [3]. The user won\u0027t get the same quick fail response in the API like they would during server create, but like the port quota issue above, that might be OK (best effort). As long as there is a failed instance action event and fault on the server for the user/admin to figure out why the server failed the rebuild we should be OK.\n\n[1] https://github.com/openstack/nova/blob/fc3890667e4971e3f0f35ac921c2a6c25f72adec/nova/compute/api.py#L937\n[2] https://github.com/openstack/nova/blob/fc3890667e4971e3f0f35ac921c2a6c25f72adec/nova/compute/api.py#L1025\n[3] https://github.com/openstack/nova/blob/fc3890667e4971e3f0f35ac921c2a6c25f72adec/nova/conductor/manager.py#L1422\n[4] https://github.com/openstack/nova/blob/fc3890667e4971e3f0f35ac921c2a6c25f72adec/nova/compute/api.py#L844\n[5] https://review.opendev.org/#/c/638073/","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"There is an ongoing discussion on how to handle personality files in the"},{"line_number":95,"context_line":"mailing list [#]_."},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"Alternatives"},{"line_number":98,"context_line":"------------"},{"line_number":99,"context_line":""}],"source_content_type":"text/x-rst","patch_set":2,"id":"9fb8cfa7_00068ecf","line":96,"in_reply_to":"ffb9cba7_f4f25e06","updated":"2019-06-07 11:48:53.000000000","message":"Thanks a lot for your insights! Even when we are counting quota from Nova (not Placement) and since we hard delete the instance, there is a slight window (between hard deleting and being scheduled again) for a race. As I can see, rechecking at conductor level should be done even if we count usages from placement or not.","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":186,"context_line":"#. New unit tests have to be implmented and existing ones should be adapted."},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"#. New functional tests have to be implemented to verify the rebuilding of"},{"line_number":189,"context_line":"   instances in cell0 and the handling of instance tags."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"#. The new tests should take into consideration BFV instances and the handling"},{"line_number":192,"context_line":"   of BDMs."}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_52b9cd2b","line":189,"range":{"start_line":189,"start_character":39,"end_line":189,"end_character":56},"updated":"2019-04-16 21:37:33.000000000","message":"well, among other things (bdms, trusted_image_certificates, keypairs, etc)","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":27057,"name":"Theodoros Tsioutsias","email":"theodoros.tsioutsias@cern.ch","username":"ttsiouts"},"change_message_id":"322d02a49f1b24709730546ff5da3150d3fe27b7","unresolved":false,"context_lines":[{"line_number":186,"context_line":"#. New unit tests have to be implmented and existing ones should be adapted."},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"#. New functional tests have to be implemented to verify the rebuilding of"},{"line_number":189,"context_line":"   instances in cell0 and the handling of instance tags."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"#. The new tests should take into consideration BFV instances and the handling"},{"line_number":192,"context_line":"   of BDMs."}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_323201a9","line":189,"range":{"start_line":189,"start_character":39,"end_line":189,"end_character":56},"in_reply_to":"3fce034c_52b9cd2b","updated":"2019-06-07 11:48:53.000000000","message":"Done","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"57e255783d6ff6bb5bc7c0d4aa879eb6db40ccb0","unresolved":false,"context_lines":[{"line_number":188,"context_line":"#. New functional tests have to be implemented to verify the rebuilding of"},{"line_number":189,"context_line":"   instances in cell0 and the handling of instance tags."},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"#. The new tests should take into consideration BFV instances and the handling"},{"line_number":192,"context_line":"   of BDMs."},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"Documentation Impact"}],"source_content_type":"text/x-rst","patch_set":2,"id":"3fce034c_72b40936","line":191,"updated":"2019-04-16 21:37:33.000000000","message":"yeah this","commit_id":"e8b66c31539e1ca615a11bc668de454895f20d89"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"86a360f0d7dd4257fe62a34db05efec941ac7718","unresolved":false,"context_lines":[{"line_number":56,"context_line":"   ``rebuild_instance_in_cell0``. This new method\u0027s purpose is almost (if not"},{"line_number":57,"context_line":"   exactly) the same as the existing ``schedule_and_build_instances``. So we"},{"line_number":58,"context_line":"   could either call to it internally or extract parts of it\u0027s functionality"},{"line_number":59,"context_line":"   and reuse them. The reason behind this is mainly to avoid calling schedule"},{"line_number":60,"context_line":"   and build code in the super-conductor directly from rebuild code in the API."},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"#. Finally, an RPC API call is needed from the conductor to the compute"},{"line_number":63,"context_line":"   service of the selected cell. The ``rebuild_instance`` method tries to"}],"source_content_type":"text/x-rst","patch_set":3,"id":"9fb8cfa7_9ef6045d","line":60,"range":{"start_line":59,"start_character":19,"end_line":60,"end_character":79},"updated":"2019-06-28 01:05:18.000000000","message":"As noted in PS2 and the code review we could avoid the wrapper pass through method if we wanted to, but it\u0027s an implementation detail. Cognitively it might be nice for rebuild to not call schedule_and_build_instances in case the parameters ever diverge, e.g. like rebuild_instance handling both rebuild (same host) and evacuate (rebuild on another host), and we also have confusion about resize_instance handling both resize (new flavor) and cold migration (no flavor change).","commit_id":"577a9c5ac2269d73ed1b5502b3bc002a3450eb9f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"86a360f0d7dd4257fe62a34db05efec941ac7718","unresolved":false,"context_lines":[{"line_number":111,"context_line":"There are two distinct cases when checking quota for instances, cores, ram:"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"#. Checking quota from Nova DB"},{"line_number":114,"context_line":"   In this case, the instance\u0027s resources, although in cell0, will be"},{"line_number":115,"context_line":"   aggregated since the instance records will be in the DB. There is though"},{"line_number":116,"context_line":"   a slight window for a race condition when the instance gets hard deleted."},{"line_number":117,"context_line":""}],"source_content_type":"text/x-rst","patch_set":3,"id":"9fb8cfa7_feb5c07e","line":114,"updated":"2019-06-28 01:05:18.000000000","message":"nit: formatting - this line doesn\u0027t wrap since there isn\u0027t a new line, so either add a new line or a colon","commit_id":"577a9c5ac2269d73ed1b5502b3bc002a3450eb9f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"86a360f0d7dd4257fe62a34db05efec941ac7718","unresolved":false,"context_lines":[{"line_number":126,"context_line":""},{"line_number":127,"context_line":"Between initial build and rebuild (from cell0) port usage might have changed."},{"line_number":128,"context_line":"In this case and since port quota is not checked when rebuilding from cell0, we"},{"line_number":129,"context_line":"might fail late in the compute, service trying to create the port. Although the"},{"line_number":130,"context_line":"user will not get a quick failure from the API, this is acceptable because at"},{"line_number":131,"context_line":"this point usage is already over limit and the server would not have booted"},{"line_number":132,"context_line":"successfully."}],"source_content_type":"text/x-rst","patch_set":3,"id":"9fb8cfa7_7ea9d021","line":129,"range":{"start_line":129,"start_character":30,"end_line":129,"end_character":31},"updated":"2019-06-28 01:05:18.000000000","message":"nix","commit_id":"577a9c5ac2269d73ed1b5502b3bc002a3450eb9f"}]}
