)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"8cabd94c59d1589ca646792bd383f3d721d2bbd6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"87577f1f_489600b3","updated":"2024-10-07 11:51:53.000000000","message":"@ratailor@redhat.com:","commit_id":"51169acedb50cffcc876722ea9d1fdd8d4829849"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"0bfeb8d3d6caf5ff77eb749b3e3482e9dc796eca","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"f298925f_9ab66fc0","updated":"2024-10-02 06:12:24.000000000","message":"Could you handle it earlier, as per suggestion to avoid additional db query.","commit_id":"51169acedb50cffcc876722ea9d1fdd8d4829849"}],"nova/scheduler/request_filter.py":[{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"07bf25ec1a78ed9426c99a664799a3570846216f","unresolved":true,"context_lines":[{"line_number":147,"context_line":"    if not az_hint:"},{"line_number":148,"context_line":"        return False"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    aggregates \u003d objects.AggregateList.get_by_metadata(ctxt,"},{"line_number":151,"context_line":"                                                       key\u003d\u0027availability_zone\u0027,"},{"line_number":152,"context_line":"                                                       value\u003daz_hint)"},{"line_number":153,"context_line":"    if aggregates:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3939cf92_11353240","line":150,"updated":"2024-10-08 10:18:39.000000000","message":"If you are worried about an extra DB query, we can get all aggregates in one go here, w/o query on AZ, and sort things out on client side, would that be better?","commit_id":"51169acedb50cffcc876722ea9d1fdd8d4829849"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"0bfeb8d3d6caf5ff77eb749b3e3482e9dc796eca","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        LOG.debug(\u0027map_az_to_placement_aggregate request filter added \u0027"},{"line_number":177,"context_line":"                  \u0027forbidden aggregates %s for default az %r\u0027,"},{"line_number":178,"context_line":"                  \u0027,\u0027.join(forbidden_agg_uuids),"},{"line_number":179,"context_line":"                  az_hint)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    return True"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9292ac35_e6b245c7","line":179,"updated":"2024-10-02 06:12:24.000000000","message":"looks like this adds another db query and \nShouldn\u0027t we modifty below condition to handle it earlier in api layer.\n\nhttps://opendev.org/openstack/nova/src/commit/8c1a47c9cf6e1001fbefd6ff3b76314e39c81d71/nova/compute/api.py#L616\n\nsomething like this:\n\n       if (not availability_zone or \n        availability_zone \u003d\u003d CONF.default_availability_zone):\n            availability_zone \u003d CONF.default_schedule_zone","commit_id":"51169acedb50cffcc876722ea9d1fdd8d4829849"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"24953744cf3d991a24093546a14dc9cd44d059a3","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        LOG.debug(\u0027map_az_to_placement_aggregate request filter added \u0027"},{"line_number":177,"context_line":"                  \u0027forbidden aggregates %s for default az %r\u0027,"},{"line_number":178,"context_line":"                  \u0027,\u0027.join(forbidden_agg_uuids),"},{"line_number":179,"context_line":"                  az_hint)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    return True"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"57d951fe_5afdf403","line":179,"in_reply_to":"12ac9809_220d1f09","updated":"2024-10-08 10:16:39.000000000","message":"If user does not specifies the AZ, there\u0027s nothing to be done, everything works as expected right now already.\nThe existing regression is specifically when user does specify the default AZ in the request, or default_schedule_zone\u003dnova. With AZFilter still in place, the instance was scheduled outside any other AZ. But since it was removed, the instance is scheduled anywhere, effectively as if AZ was not specified at all. This makes it impossible to request instance \u0027not in any specified AZs\u0027 which was working before.\n\nAnd this thing \u0027users should not specify\u0027 never actually works. Barely any openstack \u0027user\u0027 reads https://docs.openstack.org/nova/latest/admin/availability-zones.html, especially since it is in \u0027ADMIN\u0027 section of the docs.\nFor it to work, we must actually block such requests on API level (which we do not for backward compat), but now we changed scheduling breaking said backward compat.\n\nAs a user, I list AZ\u0027s, I get a list of \u0027nova\u0027 and \u0027expensive\u0027, I definitely know I do not want \u0027expensive\u0027, I specify AZ\u003dnova. Before that worked, now it is broken.","commit_id":"51169acedb50cffcc876722ea9d1fdd8d4829849"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"c75f5394307e5b888879eb20efbbbc479f0fc864","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        LOG.debug(\u0027map_az_to_placement_aggregate request filter added \u0027"},{"line_number":177,"context_line":"                  \u0027forbidden aggregates %s for default az %r\u0027,"},{"line_number":178,"context_line":"                  \u0027,\u0027.join(forbidden_agg_uuids),"},{"line_number":179,"context_line":"                  az_hint)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    return True"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"12ac9809_220d1f09","line":179,"in_reply_to":"6f10f332_96cc2040","updated":"2024-10-07 14:15:43.000000000","message":"IMO it should result in same outcome, as when we don\u0027t specify specific az during create request, it is scheduled to \u0027nova\u0027 (default az) in which case, the above condition is true and it sets availability_zone to CONF.default_schedule_zone, which I suggested.\n\nAlso as per below comments, which says that we should not specify az\u003d\u0027nova\u0027 during create request, otherwise we might not be able to migrate instance later.\n\nhttps://opendev.org/openstack/nova/src/commit/8c1a47c9cf6e1001fbefd6ff3b76314e39c81d71/nova/compute/api.py#L1330-L1332","commit_id":"51169acedb50cffcc876722ea9d1fdd8d4829849"},{"author":{"_account_id":9542,"name":"Pavlo Shchelokovskyy","email":"pshchelokovskyy@mirantis.com","username":"pshchelo"},"change_message_id":"8cabd94c59d1589ca646792bd383f3d721d2bbd6","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        LOG.debug(\u0027map_az_to_placement_aggregate request filter added \u0027"},{"line_number":177,"context_line":"                  \u0027forbidden aggregates %s for default az %r\u0027,"},{"line_number":178,"context_line":"                  \u0027,\u0027.join(forbidden_agg_uuids),"},{"line_number":179,"context_line":"                  az_hint)"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":"    return True"},{"line_number":182,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"6f10f332_96cc2040","line":179,"in_reply_to":"9292ac35_e6b245c7","updated":"2024-10-07 11:51:53.000000000","message":"I don\u0027t think this results in the same outcome.\n\ne.g. with default setup: default_az\u003dnova, default_schedule_az\u003dNone.\nhost1 is in aggregate in az \u0027foo\u0027, host 2 is in no aggregate.\nUser sees 2 AZs - \u0027foo\u0027 and \u0027nova\u0027, user asks for \u0027nova\u0027 AZ explicitly.\n\n- with my patch, the instance will be scheduled to host2, and IMO that\u0027s what the user most likely intended;\n- with your suggestion, it is still scheduled to either host1 or host2.\n\nThe thing is, with AZFilter in scheduler, this was working before, but w/o it, now the scheduling behaves differently.","commit_id":"51169acedb50cffcc876722ea9d1fdd8d4829849"}]}
