)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cd00b98c0d22012cf2218052890dc6e5916d32bf","unresolved":false,"context_lines":[{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I0ca50665b86b9fdb4618192d4d6a3bcaa6ea2291"},{"line_number":21,"context_line":"Signed-off-by: Stephen Finucane \u003csfinucan@redhat.com\u003e"},{"line_number":22,"context_line":"Closes-Bug: #1831269"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9fb8cfa7_6c7741d6","line":22,"updated":"2019-06-07 14:54:20.000000000","message":"Likely a duplicate of bug 1805767.","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Recalculate \u0027RequestSpec.numa_topology\u0027 on resize"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When resizing, it\u0027s possible to change the NUMA topology of an instance,"},{"line_number":10,"context_line":"or remove it entirely, through different flavor extra specs or image"},{"line_number":11,"context_line":"metadata. Unfortunately we cache the NUMA topology object in"},{"line_number":12,"context_line":"\u0027RequestSpec.numa_topology\u0027 and don\u0027t update it until we land on a host."},{"line_number":13,"context_line":"This means if a given host doesn\u0027t have enough free CPUs or mempages of"},{"line_number":14,"context_line":"the size requested by the *old* flavor, that host can be rejected by the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9fb8cfa7_0df703d7","line":11,"range":{"start_line":10,"start_character":60,"end_line":11,"end_character":8},"updated":"2019-06-17 22:03:51.000000000","message":"This is confusing - the image doesn\u0027t change on a resize, only the flavor. The image could possibly change during a rebuild but that\u0027s a different operation (and there is a different bug for that as well: https://bugs.launchpad.net/nova/+bug/1763766).","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Recalculate \u0027RequestSpec.numa_topology\u0027 on resize"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When resizing, it\u0027s possible to change the NUMA topology of an instance,"},{"line_number":10,"context_line":"or remove it entirely, through different flavor extra specs or image"},{"line_number":11,"context_line":"metadata. Unfortunately we cache the NUMA topology object in"},{"line_number":12,"context_line":"\u0027RequestSpec.numa_topology\u0027 and don\u0027t update it until we land on a host."},{"line_number":13,"context_line":"This means if a given host doesn\u0027t have enough free CPUs or mempages of"},{"line_number":14,"context_line":"the size requested by the *old* flavor, that host can be rejected by the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9fb8cfa7_433142ec","line":11,"range":{"start_line":10,"start_character":60,"end_line":11,"end_character":8},"in_reply_to":"9fb8cfa7_0df703d7","updated":"2019-08-20 16:31:48.000000000","message":"Done","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When resizing, it\u0027s possible to change the NUMA topology of an instance,"},{"line_number":10,"context_line":"or remove it entirely, through different flavor extra specs or image"},{"line_number":11,"context_line":"metadata. Unfortunately we cache the NUMA topology object in"},{"line_number":12,"context_line":"\u0027RequestSpec.numa_topology\u0027 and don\u0027t update it until we land on a host."},{"line_number":13,"context_line":"This means if a given host doesn\u0027t have enough free CPUs or mempages of"},{"line_number":14,"context_line":"the size requested by the *old* flavor, that host can be rejected by the"},{"line_number":15,"context_line":"filter."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9fb8cfa7_2d1d270f","line":12,"range":{"start_line":12,"start_character":48,"end_line":12,"end_character":72},"updated":"2019-06-17 22:03:51.000000000","message":"What do you mean by \"land on a host\" here? The compute service does not update the RequestSpec.numa_topology field, nor does conductor as far as I know.","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":9,"context_line":"When resizing, it\u0027s possible to change the NUMA topology of an instance,"},{"line_number":10,"context_line":"or remove it entirely, through different flavor extra specs or image"},{"line_number":11,"context_line":"metadata. Unfortunately we cache the NUMA topology object in"},{"line_number":12,"context_line":"\u0027RequestSpec.numa_topology\u0027 and don\u0027t update it until we land on a host."},{"line_number":13,"context_line":"This means if a given host doesn\u0027t have enough free CPUs or mempages of"},{"line_number":14,"context_line":"the size requested by the *old* flavor, that host can be rejected by the"},{"line_number":15,"context_line":"filter."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9fb8cfa7_633fa6b5","line":12,"range":{"start_line":12,"start_character":48,"end_line":12,"end_character":72},"in_reply_to":"9fb8cfa7_2d1d270f","updated":"2019-08-20 16:31:48.000000000","message":"This was back when I thought this field was being updated on the compute node. It\u0027s not so this is incorrect now, as you point out. Updated.","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":15,"context_line":"filter."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Correct this by regenerating the \u0027RequestSpec.numa_topology\u0027 field as"},{"line_number":18,"context_line":"part of the resize operation."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I0ca50665b86b9fdb4618192d4d6a3bcaa6ea2291"},{"line_number":21,"context_line":"Signed-off-by: Stephen Finucane \u003csfinucan@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9fb8cfa7_0de5c30a","line":18,"updated":"2019-06-17 22:03:51.000000000","message":"Should probably also mention the revert part of this change.","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":15,"context_line":"filter."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Correct this by regenerating the \u0027RequestSpec.numa_topology\u0027 field as"},{"line_number":18,"context_line":"part of the resize operation."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Change-Id: I0ca50665b86b9fdb4618192d4d6a3bcaa6ea2291"},{"line_number":21,"context_line":"Signed-off-by: Stephen Finucane \u003csfinucan@redhat.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"9fb8cfa7_2349ae5f","line":18,"in_reply_to":"9fb8cfa7_0de5c30a","updated":"2019-08-20 16:31:48.000000000","message":"Good call. Done","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"}],"nova/compute/api.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8bfb1d6e23640ee6bd904fcd4268ffa9a1edbe66","unresolved":false,"context_lines":[{"line_number":3559,"context_line":"            context, instance.uuid)"},{"line_number":3560,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3561,"context_line":"        request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3562,"context_line":"            new_instance_type, instance.image_meta)"},{"line_number":3563,"context_line":""},{"line_number":3564,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3565,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_ead627c4","line":3562,"updated":"2019-05-31 17:18:31.000000000","message":"Not sure if I\u0027m allowed to do this, since it would need to be rolled back after. Sean suggests temporarily mutating the object. TBD.","commit_id":"03819f9336867df8b5ce042ba9523316e038e0e7"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"01d63653f05a30ae9819ffbd8ef426a86d3d4cf7","unresolved":false,"context_lines":[{"line_number":3558,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3559,"context_line":"            context, instance.uuid)"},{"line_number":3560,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3561,"context_line":"        request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3562,"context_line":"            new_instance_type, instance.image_meta)"},{"line_number":3563,"context_line":""},{"line_number":3564,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3565,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":1,"id":"9fb8cfa7_eaadc731","line":3562,"range":{"start_line":3561,"start_character":8,"end_line":3562,"end_character":51},"updated":"2019-05-31 17:20:36.000000000","message":"we proably need to make sure we restore things properly on revert. both automatic and manual but this should at least fix this in the success case.\n\nthat said im not sure this will get save back to the db so we should trace through the code path after the long weekend to confrim.\n\nif we never save this to the db after this point this should be enough to resolve the bug.","commit_id":"03819f9336867df8b5ce042ba9523316e038e0e7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14bc44304c5368f2f3b3865930b2bc59ccd6860c","unresolved":false,"context_lines":[{"line_number":3558,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3559,"context_line":"            context, instance.uuid)"},{"line_number":3560,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3561,"context_line":"        request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3562,"context_line":"            new_instance_type, instance.image_meta)"},{"line_number":3563,"context_line":""},{"line_number":3564,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_2c5aa94e","line":3561,"updated":"2019-06-07 14:55:16.000000000","message":"-1 for the same reason I said in Alex\u0027s change:\n\nhttps://review.opendev.org/#/c/620874/\n\nThis will get persisted in the request spec but not reset on revert.","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e50031953c98ae4902631f93a6b2715c88fbbea4","unresolved":false,"context_lines":[{"line_number":3417,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3418,"context_line":"            context, instance.uuid)"},{"line_number":3419,"context_line":"        reqspec.flavor \u003d instance.old_flavor"},{"line_number":3420,"context_line":"        reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3421,"context_line":"            instance.old_flavor, instance.image_meta)"},{"line_number":3422,"context_line":"        reqspec.save()"},{"line_number":3423,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_d27044df","line":3420,"updated":"2019-06-07 16:17:56.000000000","message":"We could avoid this if we can determine we did a cold migration, which you should be able to determine from the migration.migration_type in scope.","commit_id":"d95286fe5430af850a44876901bd348ad197b7e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"595fc8e0d2189704e5ff049d14bfd9fd57599eb9","unresolved":false,"context_lines":[{"line_number":3417,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3418,"context_line":"            context, instance.uuid)"},{"line_number":3419,"context_line":"        reqspec.flavor \u003d instance.old_flavor"},{"line_number":3420,"context_line":"        reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3421,"context_line":"            instance.old_flavor, instance.image_meta)"},{"line_number":3422,"context_line":"        reqspec.save()"},{"line_number":3423,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_8c3059ea","line":3420,"in_reply_to":"9fb8cfa7_74ee11b5","updated":"2019-06-10 14:56:32.000000000","message":"\u003e This is the \u0027revert_resize\u0027 function. There\u0027s no way we could get\n \u003e here for anything unless we were doing a revert of the resize\n \u003e operation (i.e. no cold migration flow through here), right?\n\ncold migrate \u003d\u003d resize but with no flavor change. You can revert a cold migration and when doing so, you go through this code.","commit_id":"d95286fe5430af850a44876901bd348ad197b7e4"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"db241b5fc90f4d1f3135f1214442ea88d3a24fc8","unresolved":false,"context_lines":[{"line_number":3417,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3418,"context_line":"            context, instance.uuid)"},{"line_number":3419,"context_line":"        reqspec.flavor \u003d instance.old_flavor"},{"line_number":3420,"context_line":"        reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3421,"context_line":"            instance.old_flavor, instance.image_meta)"},{"line_number":3422,"context_line":"        reqspec.save()"},{"line_number":3423,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_89e12b2d","line":3420,"in_reply_to":"9fb8cfa7_74ee11b5","updated":"2019-06-10 14:25:40.000000000","message":"im not sure that is correct\n\nwhen we do a cold migration we call resize but just dont pass a flavor to indicate its a migration not a resize\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/api.py#L3464-L3473\n\nif you look at the definition of the revert_resize\n\ntask state you see we use it to indicate that the resize or migration has failed \n\nhttps://github.com/openstack/nova/blob/73b284cd69069699db56e61bfde4054897c15044/api-guide/source/server_concepts.rst#server-status\n\nand if you look at the migrate api ref\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003dmigrate-server-migrate-action-detail#migrate-server-migrate-action\nit also agrres with teh server concepts docs\n\nim pretty sure we use the same revert resize server api\nendpoint for both resize and cold migrations\n\nhttps://developer.openstack.org/api-ref/compute/?expanded\u003drevert-resized-server-revertresize-action-detail#revert-resized-server-revertresize-action\n\nwhich is why when we say cold migrate and resize are basically the same thing we really mean it. cold migration is just a resize to the same flavor reusing all the same task states as any other resize.","commit_id":"d95286fe5430af850a44876901bd348ad197b7e4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"12a165db2201baf0179f2c9225ceeb1ce298321f","unresolved":false,"context_lines":[{"line_number":3417,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3418,"context_line":"            context, instance.uuid)"},{"line_number":3419,"context_line":"        reqspec.flavor \u003d instance.old_flavor"},{"line_number":3420,"context_line":"        reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3421,"context_line":"            instance.old_flavor, instance.image_meta)"},{"line_number":3422,"context_line":"        reqspec.save()"},{"line_number":3423,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_74ee11b5","line":3420,"in_reply_to":"9fb8cfa7_d27044df","updated":"2019-06-10 13:58:09.000000000","message":"This is the \u0027revert_resize\u0027 function. There\u0027s no way we could get here for anything unless we were doing a revert of the resize operation (i.e. no cold migration flow through here), right?","commit_id":"d95286fe5430af850a44876901bd348ad197b7e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e50031953c98ae4902631f93a6b2715c88fbbea4","unresolved":false,"context_lines":[{"line_number":3562,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3563,"context_line":"            context, instance.uuid)"},{"line_number":3564,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3565,"context_line":"        request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3566,"context_line":"            new_instance_type, instance.image_meta)"},{"line_number":3567,"context_line":""},{"line_number":3568,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_1267bc27","line":3565,"updated":"2019-06-07 16:17:56.000000000","message":"We don\u0027t have to do this at all if the flavor doesn\u0027t change (cold migration - see Alex\u0027s change).","commit_id":"d95286fe5430af850a44876901bd348ad197b7e4"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"12a165db2201baf0179f2c9225ceeb1ce298321f","unresolved":false,"context_lines":[{"line_number":3562,"context_line":"        request_spec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3563,"context_line":"            context, instance.uuid)"},{"line_number":3564,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3565,"context_line":"        request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3566,"context_line":"            new_instance_type, instance.image_meta)"},{"line_number":3567,"context_line":""},{"line_number":3568,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_b43d692c","line":3565,"in_reply_to":"9fb8cfa7_1267bc27","updated":"2019-06-10 13:58:09.000000000","message":"Done","commit_id":"d95286fe5430af850a44876901bd348ad197b7e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":3385,"context_line":"    @check_instance_lock"},{"line_number":3386,"context_line":"    @check_instance_state(vm_state\u003d[vm_states.RESIZED])"},{"line_number":3387,"context_line":"    def revert_resize(self, context, instance):"},{"line_number":3388,"context_line":"        \"\"\"Reverts a resize or migration, deleting the \u0027new\u0027 instance in the"},{"line_number":3389,"context_line":"        process."},{"line_number":3390,"context_line":"        \"\"\""},{"line_number":3391,"context_line":"        elevated \u003d context.elevated()"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_8dba13df","line":3388,"updated":"2019-06-17 22:03:51.000000000","message":"nix this - it\u0027s unrelated","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":3416,"context_line":"        # RequestSpec to point back at the original flavor and reflect the NUMA"},{"line_number":3417,"context_line":"        # settings of this flavor, otherwise subsequent move operations through"},{"line_number":3418,"context_line":"        # the scheduler will be using the wrong values. There\u0027s no need to do"},{"line_number":3419,"context_line":"        # this is the flavor hasn\u0027t changed though, either through resizing to"},{"line_number":3420,"context_line":"        # the same flavor or migrating."},{"line_number":3421,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3422,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_2dcbe772","line":3419,"range":{"start_line":3419,"start_character":15,"end_line":3419,"end_character":17},"updated":"2019-06-17 22:03:51.000000000","message":"if","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":3416,"context_line":"        # RequestSpec to point back at the original flavor and reflect the NUMA"},{"line_number":3417,"context_line":"        # settings of this flavor, otherwise subsequent move operations through"},{"line_number":3418,"context_line":"        # the scheduler will be using the wrong values. There\u0027s no need to do"},{"line_number":3419,"context_line":"        # this is the flavor hasn\u0027t changed though, either through resizing to"},{"line_number":3420,"context_line":"        # the same flavor or migrating."},{"line_number":3421,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3422,"context_line":"            context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_03ed8a24","line":3419,"range":{"start_line":3419,"start_character":15,"end_line":3419,"end_character":17},"in_reply_to":"9fb8cfa7_2dcbe772","updated":"2019-08-20 16:31:48.000000000","message":"Done","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":3416,"context_line":"        # RequestSpec to point back at the original flavor and reflect the NUMA"},{"line_number":3417,"context_line":"        # settings of this flavor, otherwise subsequent move operations through"},{"line_number":3418,"context_line":"        # the scheduler will be using the wrong values. There\u0027s no need to do"},{"line_number":3419,"context_line":"        # this is the flavor hasn\u0027t changed though, either through resizing to"},{"line_number":3420,"context_line":"        # the same flavor or migrating."},{"line_number":3421,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3422,"context_line":"            context, instance.uuid)"},{"line_number":3423,"context_line":"        if reqspec.flavor !\u003d instance.old_flavor:"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_edc4ef61","line":3420,"range":{"start_line":3419,"start_character":59,"end_line":3420,"end_character":25},"updated":"2019-06-17 22:03:51.000000000","message":"You can\u0027t resize to the same flavor, see L3536.","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":3420,"context_line":"        # the same flavor or migrating."},{"line_number":3421,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3422,"context_line":"            context, instance.uuid)"},{"line_number":3423,"context_line":"        if reqspec.flavor !\u003d instance.old_flavor:"},{"line_number":3424,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3425,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3426,"context_line":"                instance.old_flavor, instance.image_meta)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_8d88d322","line":3423,"updated":"2019-06-17 22:03:51.000000000","message":"You\u0027re comparing full versioned objects here, which I\u0027m pretty sure is not what you want (these aren\u0027t flavor IDs).\n\nThis can just be:\n\nif migration.migration_type \u003d\u003d \u0027resize\u0027:","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":3420,"context_line":"        # the same flavor or migrating."},{"line_number":3421,"context_line":"        reqspec \u003d objects.RequestSpec.get_by_instance_uuid("},{"line_number":3422,"context_line":"            context, instance.uuid)"},{"line_number":3423,"context_line":"        if reqspec.flavor !\u003d instance.old_flavor:"},{"line_number":3424,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3425,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3426,"context_line":"                instance.old_flavor, instance.image_meta)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_a33fde85","line":3423,"in_reply_to":"9fb8cfa7_8d88d322","updated":"2019-08-20 16:31:48.000000000","message":"Done","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":3573,"context_line":""},{"line_number":3574,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3575,"context_line":"        if not same_instance_type:"},{"line_number":3576,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3577,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3578,"context_line":""},{"line_number":3579,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_4ddbbb4e","line":3576,"updated":"2019-06-17 22:03:51.000000000","message":"This eventually gets persisted in conductor after scheduling and we\u0027ve RPC cast to the first selected destination host:\n\nhttps://github.com/openstack/nova/blob/ea7293c7bed3e5c759523f8d6c69387a4bcd7b9f/nova/conductor/manager.py#L367\n\nIt would probably be worth adding a comment in here that this will get persisted by conductor after scheduling.","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e0afc7faad77b8405b5b7476a83d2ef217fd8dc0","unresolved":false,"context_lines":[{"line_number":3410,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3411,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3412,"context_line":"                instance.old_flavor, instance.image_meta)"},{"line_number":3413,"context_line":"            reqspec.save()"},{"line_number":3414,"context_line":""},{"line_number":3415,"context_line":"        instance.task_state \u003d task_states.RESIZE_REVERTING"},{"line_number":3416,"context_line":"        instance.save(expected_task_state\u003d[None])"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_b92f6086","line":3413,"updated":"2019-07-17 15:46:38.000000000","message":"nit: could we move this inside the if? IIUC save() doesn\u0027t actually call the DB unless necessary, so we won\u0027t save much by moving it inside the if, but seems to me it would make more sense to only call save() if we\u0027ve actually changed anything.\n\n\u003clater\u003e Oh, I think you kept it this way for tests? It\u0027s easier to unconditionally mock save() and add a side effect onto that to check whether we\u0027ve correctly reverted the numa topology.","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":3410,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3411,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3412,"context_line":"                instance.old_flavor, instance.image_meta)"},{"line_number":3413,"context_line":"            reqspec.save()"},{"line_number":3414,"context_line":""},{"line_number":3415,"context_line":"        instance.task_state \u003d task_states.RESIZE_REVERTING"},{"line_number":3416,"context_line":"        instance.save(expected_task_state\u003d[None])"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_ae517b10","line":3413,"in_reply_to":"7faddb67_b92f6086","updated":"2019-08-20 16:31:48.000000000","message":"I\u0027m confused - isn\u0027t this inside the if already?","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e0afc7faad77b8405b5b7476a83d2ef217fd8dc0","unresolved":false,"context_lines":[{"line_number":3558,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3559,"context_line":""},{"line_number":3560,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3561,"context_line":"        if not same_instance_type:"},{"line_number":3562,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3563,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3564,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_399b7066","line":3561,"updated":"2019-07-17 15:46:38.000000000","message":"Could instance.image_meta not change while same_instance_type is True?","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"819fc91728f5182cd9646bfed44447c16d756721","unresolved":false,"context_lines":[{"line_number":3558,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3559,"context_line":""},{"line_number":3560,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3561,"context_line":"        if not same_instance_type:"},{"line_number":3562,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3563,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3564,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_2a209bf7","line":3561,"in_reply_to":"7faddb67_146c3906","updated":"2019-07-23 15:22:07.000000000","message":"I could be wrong but I think the resize flow in compute on the dest host is going to be using the image properties stored within the instance (the image_* system_metadata values) from the last time the image changed in the instance (create, rebuild). Compute might need to re-download the image in which case it could have changed yeah, and you wouldn\u0027t really fail anything there unless you have nova/glance configured for checksum validation of images, but the image properties nova uses likely wouldn\u0027t change (because we use what we stash in the db).","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"87fcf38a0c5ec331591e3aae0930c0311c550b73","unresolved":false,"context_lines":[{"line_number":3558,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3559,"context_line":""},{"line_number":3560,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3561,"context_line":"        if not same_instance_type:"},{"line_number":3562,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3563,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3564,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_146c3906","line":3561,"in_reply_to":"7faddb67_399b7066","updated":"2019-07-17 15:48:35.000000000","message":"So I see this has been discussed before, and while the image itself doesn\u0027t change, is there something preventing the user from adding/removing image props, then resizing with that same image?","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"b821d25a097ca3a3a89e758c39b828b8fbbfd401","unresolved":false,"context_lines":[{"line_number":709,"context_line":"            hardware.vcpus_realtime_topology(instance_type, image_meta)"},{"line_number":710,"context_line":"        hardware.get_cpu_topology_constraints(instance_type, image_meta)"},{"line_number":711,"context_line":"        if validate_numa:"},{"line_number":712,"context_line":"            hardware.numa_get_constraints(instance_type, image_meta)"},{"line_number":713,"context_line":"        if validate_pci:"},{"line_number":714,"context_line":"            pci_request.get_pci_requests_from_flavor(instance_type)"},{"line_number":715,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_7ab16844","line":712,"range":{"start_line":712,"start_character":10,"end_line":712,"end_character":68},"updated":"2019-11-29 19:01:54.000000000","message":"see we do it here","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ac4dbced76848daab24ce6e0bcc833a4381992eb","unresolved":false,"context_lines":[{"line_number":3464,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3465,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3466,"context_line":"                instance.old_flavor, instance.image_meta)"},{"line_number":3467,"context_line":"            reqspec.save()"},{"line_number":3468,"context_line":""},{"line_number":3469,"context_line":"        # NOTE(gibi): This is a performance optimization. If the network info"},{"line_number":3470,"context_line":"        # cache does not have ports with allocations in the binding profile"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_84c40d61","line":3467,"updated":"2019-10-22 08:45:31.000000000","message":"OK this handles revert. But what about when the resize is automatically rolled back due to failure in during prep_resize?","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"fc2c469922d2428f9ce9c7adcc6521d4a8da4c2b","unresolved":false,"context_lines":[{"line_number":3464,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3465,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3466,"context_line":"                instance.old_flavor, instance.image_meta)"},{"line_number":3467,"context_line":"            reqspec.save()"},{"line_number":3468,"context_line":""},{"line_number":3469,"context_line":"        # NOTE(gibi): This is a performance optimization. If the network info"},{"line_number":3470,"context_line":"        # cache does not have ports with allocations in the binding profile"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_97a904de","line":3467,"in_reply_to":"3fa7e38b_84c40d61","updated":"2019-11-21 21:23:55.000000000","message":"Excellent point. I think before I try to address that, I\u0027ll create a diagram for resize like we have for live migration [1]. Once I have that at least proposed, I\u0027ll be better equipped to answer this.\n\n[1] https://docs.openstack.org/nova/latest/reference/live-migration.html","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b482933e8121592b38f8aceba046aceeba11d34f","unresolved":false,"context_lines":[{"line_number":3464,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3465,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3466,"context_line":"                instance.old_flavor, instance.image_meta)"},{"line_number":3467,"context_line":"            reqspec.save()"},{"line_number":3468,"context_line":""},{"line_number":3469,"context_line":"        # NOTE(gibi): This is a performance optimization. If the network info"},{"line_number":3470,"context_line":"        # cache does not have ports with allocations in the binding profile"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_beaf6ddf","line":3467,"in_reply_to":"3fa7e38b_8cb3cfec","updated":"2020-01-22 18:47:27.000000000","message":"I wasn\u0027t able to find any place that we roll back the \u0027flavor\u0027, let alone the \u0027numa_topology\u0027. I\u0027m going to tackle this separately.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"7becccb10f4132ba91abe3dd3738390fd678430e","unresolved":false,"context_lines":[{"line_number":3464,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3465,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3466,"context_line":"                instance.old_flavor, instance.image_meta)"},{"line_number":3467,"context_line":"            reqspec.save()"},{"line_number":3468,"context_line":""},{"line_number":3469,"context_line":"        # NOTE(gibi): This is a performance optimization. If the network info"},{"line_number":3470,"context_line":"        # cache does not have ports with allocations in the binding profile"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_8cb3cfec","line":3467,"in_reply_to":"3fa7e38b_97a904de","updated":"2019-12-18 17:33:38.000000000","message":"I might be wrong, but if the failure happens during the resize, if it causes only reschedule - it should be ok to leave these fields as they are, if it causes failure - instance goes to error state, and I guess the user has to reset state and retry the resize, so these values will be set on the next try anyway. But it does not solve the problem when the user does not retry the resize, that\u0027s true, and even now I have not found the place where flavor inside the request spec is reverted back to old value.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"89e0fb033a61fa5c3b776ba5cc6e9e7a2a84a89b","unresolved":false,"context_lines":[{"line_number":3464,"context_line":"            reqspec.flavor \u003d instance.old_flavor"},{"line_number":3465,"context_line":"            reqspec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3466,"context_line":"                instance.old_flavor, instance.image_meta)"},{"line_number":3467,"context_line":"            reqspec.save()"},{"line_number":3468,"context_line":""},{"line_number":3469,"context_line":"        # NOTE(gibi): This is a performance optimization. If the network info"},{"line_number":3470,"context_line":"        # cache does not have ports with allocations in the binding profile"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_3eea9d0c","line":3467,"in_reply_to":"3fa7e38b_beaf6ddf","updated":"2020-01-22 18:51:36.000000000","message":"I was thinking about doing it in reset-state, as it is the only way to restore instance from error back to active. but yeah this is separate thing","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"b821d25a097ca3a3a89e758c39b828b8fbbfd401","unresolved":false,"context_lines":[{"line_number":3614,"context_line":"            # _validate_flavor_image_nostatus because how it handles checking"},{"line_number":3615,"context_line":"            # disk size validation was not intended for a volume-backed"},{"line_number":3616,"context_line":"            # resize case."},{"line_number":3617,"context_line":"            if volume_backed:"},{"line_number":3618,"context_line":"                self._validate_flavor_image_numa_pci("},{"line_number":3619,"context_line":"                    image, new_instance_type, validate_pci\u003dTrue)"},{"line_number":3620,"context_line":"            else:"},{"line_number":3621,"context_line":"                self._validate_flavor_image_nostatus("},{"line_number":3622,"context_line":"                    context, image, new_instance_type, root_bdm\u003dNone,"},{"line_number":3623,"context_line":"                    validate_pci\u003dTrue)"},{"line_number":3624,"context_line":""},{"line_number":3625,"context_line":"        filter_properties \u003d {\u0027ignore_hosts\u0027: []}"},{"line_number":3626,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_3aea100e","line":3623,"range":{"start_line":3617,"start_character":11,"end_line":3623,"end_character":38},"updated":"2019-11-29 19:01:54.000000000","message":"_validate_flavor_image_nostatus internally calls _validate_flavor_image_numa_pci which calls hardware.numa_get_constraints\nalso but it does not retrun the numa toplogy object as a sideffect.\n\nso we quite often construct the numa toplogy object in the api code not to do validations but generally throw it way if its constuctatble.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ac4dbced76848daab24ce6e0bcc833a4381992eb","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_84ebadda","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"updated":"2019-10-22 08:45:31.000000000","message":"Why don\u0027t we update this at the same place we update the flavor in the spec? \n\nhttps://github.com/openstack/nova/blob/761be5d0cb364333cde267b431b1ef87920f7400/nova/conductor/manager.py#L340","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"6289733951e2b0209bb1b92559b55cd3fed74250","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_fa579800","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"in_reply_to":"3fa7e38b_175ccdee","updated":"2019-11-29 18:53:00.000000000","message":"correct hardware.numa_get_constraints does not do the assignment part that numa_fit_instance_to_host does.\n\nit constructs the set of constrats that numa_fit_instance_to_host need to fulfil in order to do the assignment of resouces to the guest.\n\nso it just parses the falvor and image to achive that and can be done anywhere. im using it in the api to validate things here https://review.opendev.org/#/c/687957/7/nova/compute/api.py@3419 in my rebuild change.\n\nquite a lot of the fucntion in hardware.py are used in the api or conductor and only  a slecte few actully need acess to host specific info.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e5720c53171437f69ecb813cf02453f6e4608260","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_175ccdee","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"in_reply_to":"3fa7e38b_34c12e30","updated":"2019-11-29 18:14:24.000000000","message":"So my previous comment was wrong - while some stuff in hardware.py *does* expect to run on the compute host (like numa_fit_instance_to_host), numa_get_constraints only translates flavor extra specs and image properties into a guest NUMA topology object.\n\nSo we could do this in _get_request_spec_for_cold_migrate, we just need to pass it the correct flavor and image info.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"b482933e8121592b38f8aceba046aceeba11d34f","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_9e84f15e","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"in_reply_to":"3fa7e38b_801f9558","updated":"2020-01-22 18:47:27.000000000","message":"Makes sense to me. Done.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"91f2ce92f326f4cd76ca8512b3af066677510b55","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_ac05b57a","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"in_reply_to":"3fa7e38b_81e49443","updated":"2020-01-29 13:27:28.000000000","message":"hrm, if you are talking about https://github.com/openstack/nova/blob/761be5d0cb364333cde267b431b1ef87920f7400/nova/conductor/manager.py#L340 IIUC this method during initial resize runs before scheduler, scheduler requests host list only during task.execute() here https://github.com/openstack/nova/blob/761be5d0cb364333cde267b431b1ef87920f7400/nova/conductor/tasks/migrate.py#L342 or am I missing something?","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"fc2c469922d2428f9ce9c7adcc6521d4a8da4c2b","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_34c12e30","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"in_reply_to":"3fa7e38b_84ebadda","updated":"2019-11-21 21:23:55.000000000","message":"So I had to track this down because it\u0027s not obvious and I hate how resize and cold migrate are intertwined, but yeah, conductor api\u0027s resize_instance() calls to conductor manager\u0027s migrate_server(), which calls _cold_migrate(), which calls that _get_request_spec_for_cold_migrate() method, so while we could do it in that method, I suspect Stepehen did it here because of two things:\n\n1. We need the same_instance_type boolean.\n2. We need to call to the hardware module, which needs to run on the (destination) compute host, and not the conductor.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c1f02d8568943ed0edf111330e60bf2e83c8e926","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_81e49443","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"in_reply_to":"3fa7e38b_9e84f15e","updated":"2020-01-22 19:52:59.000000000","message":"Actually, I don\u0027t think I can do this. The conductor stuff runs after the scheduler, right? As such, I need to update stuff here, at the api level, so that the scheduler correctly filters hosts using the new NUMA topology information.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"753db47acf65ff5f07bb501fe47d7c3729cad5e4","unresolved":false,"context_lines":[{"line_number":3631,"context_line":"            context, instance.uuid)"},{"line_number":3632,"context_line":"        request_spec.ignore_hosts \u003d filter_properties[\u0027ignore_hosts\u0027]"},{"line_number":3633,"context_line":""},{"line_number":3634,"context_line":"        # don\u0027t recalculate the NUMA topology unless the flavor has changed"},{"line_number":3635,"context_line":"        if not same_instance_type:"},{"line_number":3636,"context_line":"            request_spec.numa_topology \u003d hardware.numa_get_constraints("},{"line_number":3637,"context_line":"                new_instance_type, instance.image_meta)"},{"line_number":3638,"context_line":""},{"line_number":3639,"context_line":"        instance.task_state \u003d task_states.RESIZE_PREP"},{"line_number":3640,"context_line":"        instance.progress \u003d 0"}],"source_content_type":"text/x-python","patch_set":13,"id":"3fa7e38b_801f9558","line":3637,"range":{"start_line":3634,"start_character":1,"end_line":3637,"end_character":55},"in_reply_to":"3fa7e38b_fa579800","updated":"2020-01-07 10:57:32.000000000","message":"I prefer to update the spec for the same reason (resize) at the same place so that the future reader can find such updates in a single place. \n\nIf you feel that it will blow up the size of the change then at least a fat comment above this code should point to the other place and vice versa.","commit_id":"2f533cf9cbb265603979c18e0810b0d64a08695b"}],"nova/tests/functional/libvirt/test_numa_servers.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"0c59faad85ff2a0b393b342e3d72f67979832b48","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        self.computes \u003d {}"},{"line_number":149,"context_line":"        for host in [\u0027test_compute0\u0027, \u0027test_compute1\u0027]:"},{"line_number":150,"context_line":"            fake_connection \u003d self._get_connection(host_info\u003dhost_info)"},{"line_number":151,"context_line":"            fake_connection.getHostname \u003d lambda: host"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"            # This is fun. Firstly we need to do a global\u0027ish mock so we can"},{"line_number":154,"context_line":"            # actually start the service."}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_55ab1488","line":151,"range":{"start_line":151,"start_character":12,"end_line":151,"end_character":54},"updated":"2019-06-05 10:48:11.000000000","message":"im surprised this is not considerd a named lamda and is not forbiden by you hacking/pep8 check. ill have to rememebr that this works :)","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"821c7fd7a1623a3390c0e764a115dbd4b425082d","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        self.computes \u003d {}"},{"line_number":149,"context_line":"        for host in [\u0027test_compute0\u0027, \u0027test_compute1\u0027]:"},{"line_number":150,"context_line":"            fake_connection \u003d self._get_connection(host_info\u003dhost_info)"},{"line_number":151,"context_line":"            fake_connection.getHostname \u003d lambda: host"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"            # This is fun. Firstly we need to do a global\u0027ish mock so we can"},{"line_number":154,"context_line":"            # actually start the service."}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_7d13715d","line":151,"range":{"start_line":151,"start_character":12,"end_line":151,"end_character":54},"in_reply_to":"9fb8cfa7_55ab1488","updated":"2019-06-07 10:12:36.000000000","message":"It is and I\u0027ll have to fix it later (when I bump hacking), but for now I\u0027m keeping this since it lets me centralize it in a later patch","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"0c59faad85ff2a0b393b342e3d72f67979832b48","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        # Start services"},{"line_number":148,"context_line":"        self.computes \u003d {}"},{"line_number":149,"context_line":"        for host in [\u0027test_compute0\u0027, \u0027test_compute1\u0027]:"},{"line_number":150,"context_line":"            fake_connection \u003d self._get_connection(host_info\u003dhost_info)"},{"line_number":151,"context_line":"            fake_connection.getHostname \u003d lambda: host"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"            # This is fun. Firstly we need to do a global\u0027ish mock so we can"},{"line_number":154,"context_line":"            # actually start the service."},{"line_number":155,"context_line":"            with mock.patch(\u0027nova.virt.libvirt.host.Host.get_connection\u0027,"},{"line_number":156,"context_line":"                            return_value\u003dfake_connection):"},{"line_number":157,"context_line":"                compute \u003d self.start_service(\u0027compute\u0027, host\u003dhost)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"            # Once that\u0027s done, we need to do some tweaks to each individual"},{"line_number":160,"context_line":"            # compute \"service\" to make sure they return unique objects"},{"line_number":161,"context_line":"            compute.driver._host.get_connection \u003d lambda: fake_connection"},{"line_number":162,"context_line":"            self.computes[host] \u003d compute"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create server"},{"line_number":165,"context_line":"        extra_spec \u003d {\u0027hw:numa_nodes\u0027: \u00271\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_75873811","line":162,"range":{"start_line":149,"start_character":8,"end_line":162,"end_character":41},"updated":"2019-06-05 10:48:11.000000000","message":"this should proably be a helper function.\n\nim sure there are other places this would be useful\n\nlike line 376 where it looks like this came from.","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"821c7fd7a1623a3390c0e764a115dbd4b425082d","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        # Start services"},{"line_number":148,"context_line":"        self.computes \u003d {}"},{"line_number":149,"context_line":"        for host in [\u0027test_compute0\u0027, \u0027test_compute1\u0027]:"},{"line_number":150,"context_line":"            fake_connection \u003d self._get_connection(host_info\u003dhost_info)"},{"line_number":151,"context_line":"            fake_connection.getHostname \u003d lambda: host"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"            # This is fun. Firstly we need to do a global\u0027ish mock so we can"},{"line_number":154,"context_line":"            # actually start the service."},{"line_number":155,"context_line":"            with mock.patch(\u0027nova.virt.libvirt.host.Host.get_connection\u0027,"},{"line_number":156,"context_line":"                            return_value\u003dfake_connection):"},{"line_number":157,"context_line":"                compute \u003d self.start_service(\u0027compute\u0027, host\u003dhost)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"            # Once that\u0027s done, we need to do some tweaks to each individual"},{"line_number":160,"context_line":"            # compute \"service\" to make sure they return unique objects"},{"line_number":161,"context_line":"            compute.driver._host.get_connection \u003d lambda: fake_connection"},{"line_number":162,"context_line":"            self.computes[host] \u003d compute"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create server"},{"line_number":165,"context_line":"        extra_spec \u003d {\u0027hw:numa_nodes\u0027: \u00271\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_3d1df965","line":162,"range":{"start_line":149,"start_character":8,"end_line":162,"end_character":41},"in_reply_to":"9fb8cfa7_15603c01","updated":"2019-06-07 10:12:36.000000000","message":"https://www.youtube.com/watch?v\u003dtnf7r6lUVfA","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"e3c055fe281bdf4ac2bc3ce45fd31c7a11ba7a26","unresolved":false,"context_lines":[{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        # Start services"},{"line_number":148,"context_line":"        self.computes \u003d {}"},{"line_number":149,"context_line":"        for host in [\u0027test_compute0\u0027, \u0027test_compute1\u0027]:"},{"line_number":150,"context_line":"            fake_connection \u003d self._get_connection(host_info\u003dhost_info)"},{"line_number":151,"context_line":"            fake_connection.getHostname \u003d lambda: host"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"            # This is fun. Firstly we need to do a global\u0027ish mock so we can"},{"line_number":154,"context_line":"            # actually start the service."},{"line_number":155,"context_line":"            with mock.patch(\u0027nova.virt.libvirt.host.Host.get_connection\u0027,"},{"line_number":156,"context_line":"                            return_value\u003dfake_connection):"},{"line_number":157,"context_line":"                compute \u003d self.start_service(\u0027compute\u0027, host\u003dhost)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"            # Once that\u0027s done, we need to do some tweaks to each individual"},{"line_number":160,"context_line":"            # compute \"service\" to make sure they return unique objects"},{"line_number":161,"context_line":"            compute.driver._host.get_connection \u003d lambda: fake_connection"},{"line_number":162,"context_line":"            self.computes[host] \u003d compute"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"        # Create server"},{"line_number":165,"context_line":"        extra_spec \u003d {\u0027hw:numa_nodes\u0027: \u00271\u0027}"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_15603c01","line":162,"range":{"start_line":149,"start_character":8,"end_line":162,"end_character":41},"in_reply_to":"9fb8cfa7_75873811","updated":"2019-06-05 10:50:41.000000000","message":"ah you have done it already here\nhttps://review.opendev.org/#/c/663102","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"0c59faad85ff2a0b393b342e3d72f67979832b48","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        self.assertEqual(2, len(args))"},{"line_number":205,"context_line":"        self.assertEqual({}, kwargs)"},{"line_number":206,"context_line":"        numa_topology \u003d args[1].numa_topology"},{"line_number":207,"context_line":"        self.assertIsNone(numa_topology)"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"class NUMAServersWithNetworksTest(NUMAServersTestBase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_95f0ac69","line":207,"range":{"start_line":207,"start_character":0,"end_line":207,"end_character":40},"updated":"2019-06-05 10:48:11.000000000","message":"ok i guess this works\n\ni proably would have set it to 1 and then 2 and  assert the number changed but None is also a valid value to test for.","commit_id":"8946dbda5d0c9b8493b19005bf35826ad607dc7a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b01a212978fc1f99ce99ba9ac3f13f7fa8380fef","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        self._inspect_filter_numa_topology(cell_count\u003d2)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def test_resize_server_with_numa_fails(self):"},{"line_number":220,"context_line":"        \"\"\"Ensure resize reverts reset the RequestSpec.numa_topology."},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        This is the counter-test for \u0027test_resize_server_with_numa\u0027 which tests"},{"line_number":223,"context_line":"        the revert workflow using a similar three steps."}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_eda70fa7","line":220,"updated":"2019-06-17 22:03:51.000000000","message":"This test isn\u0027t actually calling the revertResize server action API. I\u0027m not sure what you are calling \"revert\" here but I suspect you\u0027re thinking revert is some kind of rollback from resize failure, which it\u0027s not - it means I\u0027ve successfully resized or cold migrated the server but decided I don\u0027t want to use the new flavor and revert to the old flavor.","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        self._inspect_filter_numa_topology(cell_count\u003d2)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def test_resize_server_with_numa_fails(self):"},{"line_number":220,"context_line":"        \"\"\"Ensure resize reverts reset the RequestSpec.numa_topology."},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"        This is the counter-test for \u0027test_resize_server_with_numa\u0027 which tests"},{"line_number":223,"context_line":"        the revert workflow using a similar three steps."}],"source_content_type":"text/x-python","patch_set":8,"id":"9fb8cfa7_a326fe67","line":220,"in_reply_to":"9fb8cfa7_eda70fa7","updated":"2019-08-20 16:31:48.000000000","message":"That\u0027s exactly what I was testing. Fixed.","commit_id":"afd17e97ea49a767686c2db8e203d30cacc578d2"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e0afc7faad77b8405b5b7476a83d2ef217fd8dc0","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        self.assertEqual(2, len(args))"},{"line_number":148,"context_line":"        self.assertEqual({}, kwargs)"},{"line_number":149,"context_line":"        numa_topology \u003d args[1].numa_topology"},{"line_number":150,"context_line":"        self.assertEqual(cell_count, len(numa_topology.cells))"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        # We always reset mock_filter because we don\u0027t want these result"},{"line_number":153,"context_line":"        # fudging later tests"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_74cd6d2f","line":150,"range":{"start_line":150,"start_character":25,"end_line":150,"end_character":61},"updated":"2019-07-17 15:46:38.000000000","message":"nit: flip these around, no? You\u0027re asserting that what happened (numa_topology.cells) is the same as what you were expecting (cell_count)\n\nThis also may be due to my confusion around the \"cell_count\" variable name, I think something like \"expected_cell_count\" would make it clearer.","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":147,"context_line":"        self.assertEqual(2, len(args))"},{"line_number":148,"context_line":"        self.assertEqual({}, kwargs)"},{"line_number":149,"context_line":"        numa_topology \u003d args[1].numa_topology"},{"line_number":150,"context_line":"        self.assertEqual(cell_count, len(numa_topology.cells))"},{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        # We always reset mock_filter because we don\u0027t want these result"},{"line_number":153,"context_line":"        # fudging later tests"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_0e40cf34","line":150,"range":{"start_line":150,"start_character":25,"end_line":150,"end_character":61},"in_reply_to":"7faddb67_74cd6d2f","updated":"2019-08-20 16:31:48.000000000","message":"I think this is correct already:\n\n  assertEqual(expected, actual)\n  assertIn(expected, value)","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e0afc7faad77b8405b5b7476a83d2ef217fd8dc0","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        self.mock_filter.reset_mock()"},{"line_number":155,"context_line":"        self.assertEqual(0, len(self.mock_filter.call_args_list))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"    def test_resize_server_with_numa(self):"},{"line_number":158,"context_line":"        \"\"\"Ensure resizes result in updated RequestSpec.numa_topology."},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        Nothing too complicated going on here. We create an instance with a one"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_39ba906d","line":157,"updated":"2019-07-17 15:46:38.000000000","message":"Aha, thanks for this :)","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e0afc7faad77b8405b5b7476a83d2ef217fd8dc0","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        Nothing too complicated going on here. We create an instance with a one"},{"line_number":161,"context_line":"        NUMA node guest topology and then attempt to resize this to use a"},{"line_number":162,"context_line":"        topology with two nodes. Once done, we revert this resize to ensure the"},{"line_number":163,"context_line":"        instance reverts to using the old flavor as expected."},{"line_number":164,"context_line":"        \"\"\""},{"line_number":165,"context_line":"        host_info \u003d fakelibvirt.NUMAHostInfo(cpu_nodes\u003d2, cpu_sockets\u003d1,"},{"line_number":166,"context_line":"                                             cpu_cores\u003d2, cpu_threads\u003d2,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_39485085","line":163,"range":{"start_line":163,"start_character":42,"end_line":163,"end_character":48},"updated":"2019-07-17 15:46:38.000000000","message":"You mean old numa topology?","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        Nothing too complicated going on here. We create an instance with a one"},{"line_number":161,"context_line":"        NUMA node guest topology and then attempt to resize this to use a"},{"line_number":162,"context_line":"        topology with two nodes. Once done, we revert this resize to ensure the"},{"line_number":163,"context_line":"        instance reverts to using the old flavor as expected."},{"line_number":164,"context_line":"        \"\"\""},{"line_number":165,"context_line":"        host_info \u003d fakelibvirt.NUMAHostInfo(cpu_nodes\u003d2, cpu_sockets\u003d1,"},{"line_number":166,"context_line":"                                             cpu_cores\u003d2, cpu_threads\u003d2,"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_ae7adb84","line":163,"range":{"start_line":163,"start_character":42,"end_line":163,"end_character":48},"in_reply_to":"7faddb67_39485085","updated":"2019-08-20 16:31:48.000000000","message":"Done","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e0afc7faad77b8405b5b7476a83d2ef217fd8dc0","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        post \u003d {\u0027server\u0027: server}"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        created_server \u003d self.api.post_server(post)"},{"line_number":196,"context_line":"        server \u003d self._wait_for_state_change(created_server, \u0027BUILD\u0027)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        # Ensure the filter saw the \u0027numa_topology\u0027 field"},{"line_number":199,"context_line":"        self._inspect_filter_numa_topology(cell_count\u003d1)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_74680d1c","line":196,"range":{"start_line":196,"start_character":62,"end_line":196,"end_character":67},"updated":"2019-07-17 15:46:38.000000000","message":"why not ACTIVE?","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"f76a6616495acc96faf0b0cfaefc281391e148ee","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        post \u003d {\u0027server\u0027: server}"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        created_server \u003d self.api.post_server(post)"},{"line_number":196,"context_line":"        server \u003d self._wait_for_state_change(created_server, \u0027BUILD\u0027)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        # Ensure the filter saw the \u0027numa_topology\u0027 field"},{"line_number":199,"context_line":"        self._inspect_filter_numa_topology(cell_count\u003d1)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_781df4bb","line":196,"range":{"start_line":196,"start_character":62,"end_line":196,"end_character":67},"in_reply_to":"7faddb67_2a75fbfa","updated":"2019-07-24 20:16:17.000000000","message":"Oh god you\u0027re right, why does [1] even exist? +1 to using InstanceHelperMixin and its waiters.\n\n[1] https://github.com/openstack/nova/blob/master/nova/tests/functional/test_servers.py#L89-L94","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"819fc91728f5182cd9646bfed44447c16d756721","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        post \u003d {\u0027server\u0027: server}"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        created_server \u003d self.api.post_server(post)"},{"line_number":196,"context_line":"        server \u003d self._wait_for_state_change(created_server, \u0027BUILD\u0027)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        # Ensure the filter saw the \u0027numa_topology\u0027 field"},{"line_number":199,"context_line":"        self._inspect_filter_numa_topology(cell_count\u003d1)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_2a75fbfa","line":196,"range":{"start_line":196,"start_character":62,"end_line":196,"end_character":67},"in_reply_to":"7faddb67_74680d1c","updated":"2019-07-23 15:22:07.000000000","message":"I think these tests use the confusing version of _wait_for_state_change which is waiting for the \"wait for change *from* the given state\" logic which I hate - I much more prefer the \"wait for terminal state\" logic version used in most tests and which is in the InstanceHelperMixin.","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"40d6e6652f213d4208ad780c5171de930f71cdb5","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        post \u003d {\u0027server\u0027: server}"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":"        created_server \u003d self.api.post_server(post)"},{"line_number":196,"context_line":"        server \u003d self._wait_for_state_change(created_server, \u0027BUILD\u0027)"},{"line_number":197,"context_line":""},{"line_number":198,"context_line":"        # Ensure the filter saw the \u0027numa_topology\u0027 field"},{"line_number":199,"context_line":"        self._inspect_filter_numa_topology(cell_count\u003d1)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_6e7063a5","line":196,"range":{"start_line":196,"start_character":62,"end_line":196,"end_character":67},"in_reply_to":"7faddb67_781df4bb","updated":"2019-08-20 16:31:48.000000000","message":"I\u0027ll tackle this is a follow-up","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"e0afc7faad77b8405b5b7476a83d2ef217fd8dc0","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        # old NUMA topology object"},{"line_number":229,"context_line":"        # TODO(stephenfin): The mock of \u0027migrate_disk_and_power_off\u0027 should"},{"line_number":230,"context_line":"        # probably be less...dumb"},{"line_number":231,"context_line":"        with test.nested("},{"line_number":232,"context_line":"                mock.patch(\u0027nova.virt.libvirt.driver.LibvirtDriver\u0027"},{"line_number":233,"context_line":"                           \u0027.migrate_disk_and_power_off\u0027, return_value\u003d\u0027{}\u0027),"},{"line_number":234,"context_line":"                mock.patch(\u0027nova.compute.api.hardware.numa_get_constraints\u0027,"},{"line_number":235,"context_line":"                           wraps\u003dhardware.numa_get_constraints)"},{"line_number":236,"context_line":"            ) as (_, mock_get_numa):"},{"line_number":237,"context_line":"            post \u003d {\u0027revertResize\u0027: {}}"},{"line_number":238,"context_line":"            self.api.post_server_action(server[\u0027id\u0027], post)"},{"line_number":239,"context_line":""},{"line_number":240,"context_line":"        server \u003d self._wait_for_state_change(created_server, \u0027ACTIVE\u0027)"},{"line_number":241,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7faddb67_149e7906","line":238,"range":{"start_line":231,"start_character":0,"end_line":238,"end_character":59},"updated":"2019-07-17 15:46:38.000000000","message":"Could we not just assert stuff about the request spec instead of all this?","commit_id":"3bdade39f92dd38133171fcf3e57d4d9a688d342"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"4a4fcdb1fab3a3ad14c8545b57fd5eeec5fb1d5a","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from oslo_config import cfg"},{"line_number":20,"context_line":"from oslo_log import log as logging"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from nova import context"},{"line_number":23,"context_line":"from nova.conf import neutron as neutron_conf"},{"line_number":24,"context_line":"from nova import context as nova_context"},{"line_number":25,"context_line":"from nova import objects"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_27def010","line":22,"updated":"2019-08-19 18:27:25.000000000","message":"Need to fix the order of import for the following pep8 error:\n\n ./nova/tests/functional/libvirt/test_numa_servers.py:23:1: H306  imports not in alphabetical order (nova.context, nova.conf.neutron)","commit_id":"e5578501bb962a7d144ed35af535bc86b2053a3e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"f58c09d8a7c8253992a849c4bb29a7af77dabf22","unresolved":false,"context_lines":[{"line_number":19,"context_line":"from oslo_config import cfg"},{"line_number":20,"context_line":"from oslo_log import log as logging"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"from nova import context"},{"line_number":23,"context_line":"from nova.conf import neutron as neutron_conf"},{"line_number":24,"context_line":"from nova import context as nova_context"},{"line_number":25,"context_line":"from nova import objects"}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_8c31cbf0","line":22,"in_reply_to":"7faddb67_27def010","updated":"2019-08-22 10:49:45.000000000","message":"Done","commit_id":"e5578501bb962a7d144ed35af535bc86b2053a3e"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"4a4fcdb1fab3a3ad14c8545b57fd5eeec5fb1d5a","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        # And the request spec for this instance describes a single node NUMA"},{"line_number":206,"context_line":"        # topology"},{"line_number":207,"context_line":"        req_spec \u003d objects.RequestSpec.get_by_instance_uuid(ctxt, server[\u0027id\u0027])"},{"line_number":208,"context_line":"        self.assertEqual(1, len(req_spec.numa_topology.cells))"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        # STEP TWO"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_a72500c4","line":208,"range":{"start_line":207,"start_character":0,"end_line":208,"end_character":62},"updated":"2019-08-19 18:27:25.000000000","message":"nit: This 2 lines can be moved into _inspect_filter_numa_topology() if moving\n\n ctxt \u003d context.get_admin_context()\n\nto the above.","commit_id":"e5578501bb962a7d144ed35af535bc86b2053a3e"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"f58c09d8a7c8253992a849c4bb29a7af77dabf22","unresolved":false,"context_lines":[{"line_number":204,"context_line":""},{"line_number":205,"context_line":"        # And the request spec for this instance describes a single node NUMA"},{"line_number":206,"context_line":"        # topology"},{"line_number":207,"context_line":"        req_spec \u003d objects.RequestSpec.get_by_instance_uuid(ctxt, server[\u0027id\u0027])"},{"line_number":208,"context_line":"        self.assertEqual(1, len(req_spec.numa_topology.cells))"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"        # STEP TWO"},{"line_number":211,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_0c1e3b5f","line":208,"range":{"start_line":207,"start_character":0,"end_line":208,"end_character":62},"in_reply_to":"7faddb67_a72500c4","updated":"2019-08-22 10:49:45.000000000","message":"I didn\u0027t want to do this since it was fudging responsibility, and I need to do this without the request spec below. I did, however, move this to a separate function","commit_id":"e5578501bb962a7d144ed35af535bc86b2053a3e"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"4a4fcdb1fab3a3ad14c8545b57fd5eeec5fb1d5a","unresolved":false,"context_lines":[{"line_number":228,"context_line":"        self._inspect_filter_numa_topology(cell_count\u003d2)"},{"line_number":229,"context_line":""},{"line_number":230,"context_line":"        # And the request spec for this instance was updated"},{"line_number":231,"context_line":"        req_spec \u003d objects.RequestSpec.get_by_instance_uuid(ctxt, server[\u0027id\u0027])"},{"line_number":232,"context_line":"        self.assertEqual(2, len(req_spec.numa_topology.cells))"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        # STEP THREE"},{"line_number":235,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"7faddb67_672b8894","line":232,"range":{"start_line":231,"start_character":0,"end_line":232,"end_character":62},"updated":"2019-08-19 18:27:25.000000000","message":"ditto","commit_id":"e5578501bb962a7d144ed35af535bc86b2053a3e"}]}
