)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"2dda132abb7e0f1ff19632aa29fa1583903f851a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"06b923a2_027793d9","updated":"2022-11-21 11:54:05.000000000","message":"recheck","commit_id":"31162ef1e37d10da8ff01f87a80d7cc528a88282"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"63ae397d92f684e54bd2410661f8d10af8cb167e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"0ffdf5d3_93c18c97","updated":"2022-11-24 12:46:35.000000000","message":"recheck","commit_id":"31162ef1e37d10da8ff01f87a80d7cc528a88282"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"97e2544267147eec08ef6456146caf6f678fe1e6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"6218834a_f4ec431a","updated":"2022-11-17 10:32:17.000000000","message":"recheck","commit_id":"31162ef1e37d10da8ff01f87a80d7cc528a88282"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"bb5d2f34005678463b6734d2c903cf3687cbde99","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"a237a1ae_e4ca1881","updated":"2022-11-18 10:19:13.000000000","message":"recheck","commit_id":"31162ef1e37d10da8ff01f87a80d7cc528a88282"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"ed38463f4eea0fa195ae1499a1275a0cd1608683","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e8b5dfa2_a54d2d15","updated":"2023-03-29 17:47:57.000000000","message":"Actually, looking it more at https://review.opendev.org/c/openstack/nova/+/469675/12/nova/compute/api.py#1173 I can see that we *do* pin the volume AZ at server boot if the instance AZ parameter isn\u0027t specified.\nIn theory, you wouldn\u0027t need to update the RequestSpec.availability_zone value since this should already contain the volume AZ, even if default_schedule_zone is None and no AZ was provided by the user at the creation time.\n\nAre you really sure this bug is still legit ? The above patch was included in stable/ussuri so please make sure your environment does support it.\n\nAnyway, nevermind my previous comment, you should definitely fill a bug report in Launchpad in order to track it correctly : https://bugs.launchpad.net/nova/","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":27515,"name":"Florian Engelmann","email":"engelmann@d-g-c.de","username":"engel75"},"change_message_id":"8c1fa2d6f88c581660fb7118d601f0224f3e244a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"6cbe05cf_e25a8fdc","updated":"2023-03-29 11:18:56.000000000","message":"CONF.cinder.cross_az_attach description:\n\n\"Allow attach between instance and volume in different availability zones.\n\nIf False, volumes attached to an instance must be in the same availability zone in Cinder as the instance availability zone in Nova.\n\nThis also means care should be taken when booting an instance from a volume where source is not “volume” because Nova will attempt to create a volume using the same availability zone as what is assigned to the instance.\n\nIf that AZ is not in Cinder (or allow_availability_zone_fallback\u003dFalse in cinder.conf), the volume create request will fail and the instance will fail the build request.\n\nBy default there is no availability zone restriction on volume attach.\"\n\nSo instances having volumes should not move to another AZ if this setting is false.","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c25b313fe4802d3e01040e722915213469ad42e6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"c34bff02_0475f015","updated":"2023-03-29 17:50:23.000000000","message":"I can try to add a functional test in order to try to test this behaviour, I\u0027ll amend https://opendev.org/openstack/nova/src/branch/master/nova/tests/functional/test_cross_az_attach.py to test cold migrations.","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"75c048aee4a7ab76f0ed72123defc3883043f9c5","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"4a302ce3_9805e7c6","updated":"2023-04-26 12:44:54.000000000","message":"Sylvain, thanks for your review!\n \nHowever, looking at the patch suggested by you in [1], and later testing it, we can confirm that the problem is still there in main/upstream. This happens because the patch in [1] is only addressing the cases when the VM is created based on volumes, and then it sets the AZ of the volumes in the request spec of the VM. That is why everything works for the setups where cross_az_attach\u003dFalse. However, if we create a VM based on an image, and then it (Nova) creates a new volume in Cinder, the AZ is not set in the request spec (but it is used to execute the first call to placement to select the hosts); thus, the issues described in [2] can still happen.\n\n[1] https://review.opendev.org/c/openstack/nova/+/469675/12/nova/compute/api.py#1173\n[2] https://review.opendev.org/c/openstack/nova/+/864760","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"436a2a069786239e987682a329cdd5f61132c9de","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"8f0c60cc_8c7e95be","updated":"2022-11-30 11:13:58.000000000","message":"recheck","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"a13ac027569dcc6d7805aadec6c3abbf3a34cf22","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"b4678c5a_7e386a5b","updated":"2022-11-27 23:04:09.000000000","message":"recheck","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"48f0a6775d0f55788d7a92a3d7fe8e683ba2940c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"998984f8_b5b7daa2","in_reply_to":"05024761_d85bc838","updated":"2023-05-02 16:07:38.000000000","message":"Bug report created at: https://bugs.launchpad.net/nova/+bug/2018318","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"1032ac10faf143e9dd1f39b78a99793a04aa36ef","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"05024761_d85bc838","in_reply_to":"4a302ce3_9805e7c6","updated":"2023-04-26 15:21:00.000000000","message":"\u003e However, if we create a VM based on an image, and then it (Nova) creates a new volume in Cinder, the AZ is not set in the request spec (but it is used to execute the first call to placement to select the hosts); thus, the issues described in [2] can still happen.\n\u003e \n\nReplying on it, but then you should write a bug report in Launchpad [1] and attach it to the change above.\n\nThat being said, I\u0027m still against the implementation change. Instead of directly modifying the instance.az value, we should rather do then the same than in [2] and lookup at the image metadata to see whether it will create a Cinder volume.\n\n\n[1] https://bugs.launchpad.net/nova/\n[2] https://review.opendev.org/c/openstack/nova/+/469675/12/nova/compute/api.py#1173","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f6ebf23748851cc2cc1f24e2fb113f6a96defa52","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"88504864_b5f57484","in_reply_to":"6cbe05cf_e25a8fdc","updated":"2023-03-29 17:39:19.000000000","message":"\u003e CONF.cinder.cross_az_attach description:\n\u003e \n\u003e\u003e This also means care should be taken when booting an instance from a volume where source is not “volume” because Nova will attempt to create a volume using the same availability zone as what is assigned to the instance.\n\u003e \n\u003e So instances having volumes should not move to another AZ if this setting is false.\n\n\nI don\u0027t disagree with the issue, I disagree with the proposal here which is to override the RequestSpec AZ field.\nSee https://review.opendev.org/c/openstack/nova/+/469675/ and https://docs.openstack.org/nova/latest/admin/availability-zones.html#implications-for-moving-servers it\u0027s saying that we basically lack of support for cross_az_attach\u003dFalse and we don\u0027t really honor that flag for move operations.\n\nI personnally feel that modifying such thing isn\u0027t trivial and requires a bit of subsequent effort. Accordingly, I\u0027d rather propose you to increase your visibility by filling in a blueprint and engaging with the Nova community about a proposed design solution, ideally during the vPTG that is happening those days.\n\nFWIW, I marked it as a topic in our vPTG etherpad [1], we\u0027ll try to discuss it this Friday so it would be nice if some of you could attend.\n\n[1] https://etherpad.opendev.org/p/nova-bobcat-ptg","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2a9347441471545cb705b41f6da34d62f11d66a0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"9560f972_e41882c5","in_reply_to":"84f9978a_7d72f8fc","updated":"2023-03-29 20:58:39.000000000","message":"*can\u0027t* be moved (sorry)","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"f85e4e680265045ac5b93147e3658ada3531c344","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"84f9978a_7d72f8fc","in_reply_to":"c34bff02_0475f015","updated":"2023-03-29 20:58:12.000000000","message":"\u003e I can try to add a functional test in order to try to test this behaviour, I\u0027ll amend https://opendev.org/openstack/nova/src/branch/master/nova/tests/functional/test_cross_az_attach.py to test cold migrations.\n\nJust done with https://review.opendev.org/c/openstack/nova/+/878948 and as you can see, it works : the instance can be moved to another AZ.","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"2502894218dd7a89d919def064ce7886eff826c9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"6d7c5ad8_fbd384c8","updated":"2023-05-02 16:29:07.000000000","message":"ill respond on the bug and review this again after but this is not a valid change","commit_id":"71674aac4c53a2edaced0e4acc1fca28d68b7b73"}],"nova/conductor/tasks/migrate.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"9023aaf1433976d32d01a9884c0c74ea3ae2daeb","unresolved":true,"context_lines":[{"line_number":293,"context_line":"            # in a different zone when executing the resize."},{"line_number":294,"context_line":"            if not CONF.cinder.cross_az_attach:"},{"line_number":295,"context_line":"                self.request_spec.availability_zone \u003d \\"},{"line_number":296,"context_line":"                    self.instance.availability_zone"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"            selection \u003d self._schedule()"},{"line_number":299,"context_line":"            if not self._is_selected_host_in_source_cell(selection):"}],"source_content_type":"text/x-python","patch_set":4,"id":"256c644d_73652ce6","line":296,"updated":"2023-03-27 08:22:17.000000000","message":"No, you can\u0027t just modify the availability zone like it in the request spec.\n\nIf the instance was created without using a specific AZ, then the instance can be moved to any AZ.\nIf you want to have a default AZ for any instance, then you need to use https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.default_schedule_zone","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":27515,"name":"Florian Engelmann","email":"engelmann@d-g-c.de","username":"engel75"},"change_message_id":"8c1fa2d6f88c581660fb7118d601f0224f3e244a","unresolved":false,"context_lines":[{"line_number":293,"context_line":"            # in a different zone when executing the resize."},{"line_number":294,"context_line":"            if not CONF.cinder.cross_az_attach:"},{"line_number":295,"context_line":"                self.request_spec.availability_zone \u003d \\"},{"line_number":296,"context_line":"                    self.instance.availability_zone"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"            selection \u003d self._schedule()"},{"line_number":299,"context_line":"            if not self._is_selected_host_in_source_cell(selection):"}],"source_content_type":"text/x-python","patch_set":4,"id":"409c91dd_77b0b552","line":296,"in_reply_to":"256c644d_73652ce6","updated":"2023-03-29 11:18:56.000000000","message":"That is true, but for sure the instance should not move to another AZ if CONF.cinder.cross_az_attach is false.","commit_id":"570493c6ed4e43a23d2d244793993a44cf75ecdd"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"76950d5a174294b96c57a5fde7deb101b1dc47b4","unresolved":true,"context_lines":[{"line_number":292,"context_line":"            # If cross_az_attach is False, we cannot migrate the VM to a host"},{"line_number":293,"context_line":"            # in a different zone when executing the resize."},{"line_number":294,"context_line":"            if not CONF.cinder.cross_az_attach:"},{"line_number":295,"context_line":"                self.request_spec.availability_zone \u003d \\"},{"line_number":296,"context_line":"                    self.instance.availability_zone"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"            selection \u003d self._schedule()"}],"source_content_type":"text/x-python","patch_set":6,"id":"b2b03637_f15d6dd2","line":295,"updated":"2023-05-02 16:18:12.000000000","message":"still repushing my implementation concern : no, you shouldn\u0027t touch the RequestSpec AZ field here.","commit_id":"71674aac4c53a2edaced0e4acc1fca28d68b7b73"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"22dd1b74cd0ee8c328fc3d7e0952b3b98a6fd73c","unresolved":true,"context_lines":[{"line_number":292,"context_line":"            # If cross_az_attach is False, we cannot migrate the VM to a host"},{"line_number":293,"context_line":"            # in a different zone when executing the resize."},{"line_number":294,"context_line":"            if not CONF.cinder.cross_az_attach:"},{"line_number":295,"context_line":"                self.request_spec.availability_zone \u003d \\"},{"line_number":296,"context_line":"                    self.instance.availability_zone"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"            selection \u003d self._schedule()"}],"source_content_type":"text/x-python","patch_set":6,"id":"6529736a_0071c266","line":295,"in_reply_to":"4816a0b5_b278fbf6","updated":"2023-05-12 09:32:53.000000000","message":"\u003e Just because you say so? \u003d)\n\u003e \n\u003e Can you provide a more technical explanation on why not? I mean, why would that be wrong? Or, what alternative would be better, and why?\n\u003e \n\n\nSorry, that\u0027s kind of a non-documented design consensus (or a tribal knowledge if you prefer) \nWe, as the Nova community, want to keep the RequestSpec.availability_zone record as an immutable object, that is only set when creating the RequestSpec, so then we know whether the user wanted to pin the instance to a specific AZ or not.\n\n\n\u003e What is your proposal? We see the following two different alternatives so far.\n\u003e \n\u003e 1) Change the request spec as soon as the VM is created, and set the AZ as the selected host\u0027s AZ?\n\u003e \n\u003e 2) the current proposal is implemented using the same reasoning as we have in [1]. I mean, in [1] we use use the Cell of the source host. Therefore, it made sense to do the same for AZ. that is why in the bug report we describe the situation that if different cells were used, this problem would have never be discovered, because of the code at [1].\n\u003e \n\u003e \n\u003e [1] https://github.com/openstack/nova/blob/3d83bb3356e10355437851919e161f258cebf761/nova/conductor/tasks/live_migrate.py#L495\n\n\nMaybe you haven\u0027t seen my proposal before, but I was talking of https://review.opendev.org/c/openstack/nova/+/469675/12/nova/compute/api.py#1173 that was merged.\nSee again my comment https://review.opendev.org/c/openstack/nova/+/864760/comments/4a302ce3_9805e7c6\n\nTBC, lemme explain the problem and what we need to fix : if an user creates an instance with an image and asking to create a volume on that image, then we need to modify the AZ for the related Request if and only if cross_az_attach\u003dFalse\n\nNow, let\u0027s discuss the implementation :\n1/ we know that volumes are created way later in the instance boot by the compute service, but we *do* pass the information of the instance.az to Cinder to tell it to create a volume within that AZ *if* cross_az_attach\u003dFalse :\nhttps://github.com/openstack/nova/blob/b3fdd7ccf01bafb68e37a457f703b79119dbfa86/nova/virt/block_device.py#L427\nhttps://github.com/openstack/nova/blob/b3fdd7ccf01bafb68e37a457f703b79119dbfa86/nova/virt/block_device.py#L53-L78\n\n2/ unfortunately,instance.availability_zone is only trustworthy *if* the instance is pinned to an AZ\n\n3/ we know that at the API level, we\u0027re able to know whether we *will* create a volume based on an image since we have the BDMs and we do check them :\nhttps://github.com/openstack/nova/blob/b3fdd7ccf01bafb68e37a457f703b79119dbfa86/nova/compute/api.py#L1460\nhttps://github.com/openstack/nova/blob/b3fdd7ccf01bafb68e37a457f703b79119dbfa86/nova/compute/api.py#L1866\nhttps://github.com/openstack/nova/blob/b3fdd7ccf01bafb68e37a457f703b79119dbfa86/nova/compute/api.py#L1960-L1965C43\n\n4/ Accordingly, we are able to follow the same logic than in https://github.com/openstack/nova/blob/b3fdd7ccf01bafb68e37a457f703b79119dbfa86/nova/compute/api.py#L1396-L1397 by checking the BDMs and see whether we gonna create a volume. If so, we SHALL pin the AZ exactly like https://github.com/openstack/nova/blob/b3fdd7ccf01bafb68e37a457f703b79119dbfa86/nova/compute/api.py#L1264\n\nUnfortunately, since the user didn\u0027t specify an AZ, Nova doesn\u0027 know which AZ to pin the instance to. Consequently, we have multiple options :\n\n1/ we could return an exception to the user if he didn\u0027t pinned the instance. That said, I really don\u0027t like this UX since the user doesn\u0027t know whether cross_az_attach is False or not\n2/ we could document the fact that cross_az_attach only works with pre-created volumes.\n3/ we could pre-create the volume way earlier at the API level and get its AZ.\n4/ we could augment the RequestSpec to have a field saying \u0027pinned\u0027 or something else that the scheduler would honor on a move operation even if RequestSpec.az is None\n\nAs you see, all those options need to be correctly discussed, so IMHO I\u0027d prefer you to draft a spec so the nova community could address those points so we could find an approved design solution.\n\nHTH.","commit_id":"71674aac4c53a2edaced0e4acc1fca28d68b7b73"},{"author":{"_account_id":28356,"name":"Rafael Weingartner","email":"rafael@apache.org","username":"rafaelweingartner"},"change_message_id":"42ca9703342fa0d926a1336a9a64820b026d4c88","unresolved":true,"context_lines":[{"line_number":292,"context_line":"            # If cross_az_attach is False, we cannot migrate the VM to a host"},{"line_number":293,"context_line":"            # in a different zone when executing the resize."},{"line_number":294,"context_line":"            if not CONF.cinder.cross_az_attach:"},{"line_number":295,"context_line":"                self.request_spec.availability_zone \u003d \\"},{"line_number":296,"context_line":"                    self.instance.availability_zone"},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"            selection \u003d self._schedule()"}],"source_content_type":"text/x-python","patch_set":6,"id":"4816a0b5_b278fbf6","line":295,"in_reply_to":"b2b03637_f15d6dd2","updated":"2023-05-02 16:27:24.000000000","message":"Just because you say so? \u003d)\n\nCan you provide a more technical explanation on why not? I mean, why would that be wrong? Or, what alternative would be better, and why?\n\nWhat is your proposal? We see the following two different alternatives so far.\n\n1) Change the request spec as soon as the VM is created, and set the AZ as the selected host\u0027s AZ?\n\n2) the current proposal is implemented using the same reasoning as we have in [1]. I mean, in [1] we use use the Cell of the source host. Therefore, it made sense to do the same for AZ. that is why in the bug report we describe the situation that if different cells were used, this problem would have never be discovered, because of the code at [1].\n\n\n[1] https://github.com/openstack/nova/blob/3d83bb3356e10355437851919e161f258cebf761/nova/conductor/tasks/live_migrate.py#L495","commit_id":"71674aac4c53a2edaced0e4acc1fca28d68b7b73"}]}
