Fail to filter the list of instances by availability zone
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Medium
|
huanhongda |
Bug Description
After the host is in the Host Aggregates (HA) where the host is modified, the Availability Zone (az) is also changed, but the available_zone in the instances database of the instance on the host does not change.
The recurring steps are as follows:
1. Query the az of the instance by nova-api:
[root@node01 ~]# nova show 82d28856-
| OS-EXT-
| OS-EXT-
2. In the database use sql to query the current instance of az:
MariaDB [nova_cell1]> SELECT display_name, vm_state, availability_zone FROM instances WHERE uuid='82d28856-
+------
| display_name | vm_state | availability_zone |
+------
| vm1 | active | nova |
+------
3. Create HA (name is ha1), set AZ (name is az1), add host node01 to HA ha1:
[root@node01 ~]# nova aggregate-show ha1
+----+-
| Id | Name | Availability Zone | Hosts | Metadata | UUID |
+----+-
| 5 | ha1 | az1 | 'node01' | 'availability_
+----+-
4.Query the az of the instance by nova-api:
[root@node01 ~]# nova show 82d28856-
| OS-EXT-
| OS-EXT-
5.In the database use sql to query the current instance of az:
MariaDB [nova_cell1]> SELECT display_name, vm_state, availability_zone FROM instances WHERE uuid='82d28856-
+------
| display_name | vm_state | availability_zone |
+------
| vm1 | active | nova |
+------
Summary:By comparing steps 1, 4 and 2, 5, it is found that the data obtained by vm1 through nova-api is inconsistent with the data in the instances database table, and the availability_
In addition, you can reproduce the problem through horizon.
Changed in nova: | |
assignee: | nobody → sunjiazz (sunjiazz) |
Matt Riedemann (mriedem) wrote : | #1 |
Matt Riedemann (mriedem) wrote : | #2 |
https:/
Matt Riedemann (mriedem) wrote : | #3 |
Also, what do you mean by "Fail to filter the list of instances by the available zone" as the bug title? Do you mean, because the API says in step 4 that the instance is in AZ az1 that when filtering instances by az1 you expect to see vm1 there, but it's not because the instances table says the instance is in AZ 'nova'?
Brin Zhang (zhangbailin) wrote : | #4 |
Hi sir: This problem we found in the Ocata release , tested in the Rocky release , still exists.
"Fail to filter the list of instances by the available zone" this tittle:
I mean, if the host's HA changes (AZ will also change), then the AZ of all the instances on the host should also change with the host. Then the available_zone in the instances data table should also be updated.
--"because the API says in step 4 that the instance is in AZ az1 that when filtering instances by az1 you expect to see vm1 there, but it's not because the instances table says the instance is in AZ 'nova'?"
Yes, it should be consistent here.
Do you think this tittle needs to be changed? Any suggestions? Thank you.
tags: | added: availability-zones |
Matt Riedemann (mriedem) wrote : | #5 |
Related to Sylvain's spec here: https:/
Which has had some mailing list discussion: http://
Matt Riedemann (mriedem) wrote : | #6 |
I've added the blueprint and this bug to the Stein PTG etherpad for discussion:
Changed in nova: | |
status: | New → Triaged |
Matt Riedemann (mriedem) wrote : | #7 |
Discussed at the Stein PTG:
https:/
We agreed to block AZ renames in the API if the AZ has instances in it as a bug fix, no microversion. People shoudn't have to opt into not breaking themselves. Plus this is an admin API by default.
https:/
Changed in nova: | |
assignee: | sunjiazz (sunjiazz) → nobody |
importance: | Undecided → Medium |
Fix proposed to branch: master
Review: https:/
Changed in nova: | |
assignee: | nobody → huanhongda (hongda) |
status: | Triaged → In Progress |
Denormalized, inconsistent data at its finest... :(
Please see the code comment next to the instances.
https:/
# This always refers to the availability_zone kwarg passed in /servers and
# provided as an API option, not at all related to the host AZ the instance
# belongs to.
availabilit
Apparently, it's meant to be this way :(
summary: |
- Fail to filter the list of instances by the available zone + Fail to filter the list of instances by availability zone |
Change abandoned by Matt Riedemann (<email address hidden>) on branch: master
Review: https:/
Reason: This looks abandoned and https:/
Which release is this against? master (rocky)?