← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2034702] [NEW] The host aggregate cache multiple images errors

 

Public bug reported:

The host aggregate cache reports an error when multiple images are not
sorted during deduplication

* Step-by-step reproduction steps:
Create aggregate 
Create images
Aggregate cache images 

[root@control1 ~]# openstack aggregate create agg1
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| availability_zone | None                                 |
| created_at        | 2023-09-07T12:07:40.073539           |
| deleted_at        | None                                 |
| hosts             | None                                 |
| id                | 6                                    |
| is_deleted        | False                                |
| name              | agg1                                 |
| properties        | None                                 |
| updated_at        | None                                 |
| uuid              | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
+-------------------+--------------------------------------+
[root@control1 ~]# openstack aggregate add host agg1 compute1
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| availability_zone | None                                 |
| created_at        | 2023-09-07T12:07:40.073539           |
| deleted_at        | None                                 |
| hosts             | None                                 |
| id                | 6                                    |
| is_deleted        | False                                |
| name              | agg1                                 |
| properties        | None                                 |
| updated_at        | None                                 |
| uuid              | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
+-------------------+--------------------------------------+
[root@control1 ~]# openstack aggregate set --property availability_zone=nova 6
[root@control1 ~]# openstack aggregate show 6
+-------------------+--------------------------------------+
| Field             | Value                                |
+-------------------+--------------------------------------+
| availability_zone | nova                                 |
| created_at        | 2023-09-07T12:07:50.073539            |
| deleted_at        | None                                 |
| hosts             | compute1                             |
| id                | 6                                    |
| is_deleted        | False                                |
| name              | Host Aggregation                     |
| properties        |                                      |
| updated_at        | None                                 |
| uuid              | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
+-------------------+--------------------------------------+

[root@control1 ~]# openstack image list
+--------------------------------------+------------------------+--------+
| ID                                   | Name                   | Status |
+--------------------------------------+------------------------+--------+
| 389ffe8a-ebf3-4937-86ae-812057264a69 | CentOS 7               | active |
| cc927ebc-8c19-4533-8956-188064e778bc | amphora-x86_64-haproxy | active |
| 3f932c75-03aa-4aeb-adfc-7f6875e986aa | test                   | active |
+--------------------------------------+------------------------+--------+

[root@control1 ~]# openstack aggregate cache image 6 389ffe8a-ebf3-4937-86ae-812057264a69 cc927ebc-8c19-4533-8956-188064e778bc  3f932c75-03aa-4aeb-adfc-7f6875e986aa
BadRequestException: 400: Client Error for url: http://10.0.5.30:8774/v2.1/os-aggregates/6/images, Duplicate images in request

Even though images have no duplicate id, the list order of images has changed after deduplication, and the judgment condition is wrong during comparison.
https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/aggregates.py#L292

** Affects: nova
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2034702

Title:
  The host aggregate cache multiple images errors

Status in OpenStack Compute (nova):
  New

Bug description:
  The host aggregate cache reports an error when multiple images are not
  sorted during deduplication

  * Step-by-step reproduction steps:
  Create aggregate 
  Create images
  Aggregate cache images 

  [root@control1 ~]# openstack aggregate create agg1
  +-------------------+--------------------------------------+
  | Field             | Value                                |
  +-------------------+--------------------------------------+
  | availability_zone | None                                 |
  | created_at        | 2023-09-07T12:07:40.073539           |
  | deleted_at        | None                                 |
  | hosts             | None                                 |
  | id                | 6                                    |
  | is_deleted        | False                                |
  | name              | agg1                                 |
  | properties        | None                                 |
  | updated_at        | None                                 |
  | uuid              | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
  +-------------------+--------------------------------------+
  [root@control1 ~]# openstack aggregate add host agg1 compute1
  +-------------------+--------------------------------------+
  | Field             | Value                                |
  +-------------------+--------------------------------------+
  | availability_zone | None                                 |
  | created_at        | 2023-09-07T12:07:40.073539           |
  | deleted_at        | None                                 |
  | hosts             | None                                 |
  | id                | 6                                    |
  | is_deleted        | False                                |
  | name              | agg1                                 |
  | properties        | None                                 |
  | updated_at        | None                                 |
  | uuid              | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
  +-------------------+--------------------------------------+
  [root@control1 ~]# openstack aggregate set --property availability_zone=nova 6
  [root@control1 ~]# openstack aggregate show 6
  +-------------------+--------------------------------------+
  | Field             | Value                                |
  +-------------------+--------------------------------------+
  | availability_zone | nova                                 |
  | created_at        | 2023-09-07T12:07:50.073539            |
  | deleted_at        | None                                 |
  | hosts             | compute1                             |
  | id                | 6                                    |
  | is_deleted        | False                                |
  | name              | Host Aggregation                     |
  | properties        |                                      |
  | updated_at        | None                                 |
  | uuid              | 21ff4ca8-210d-416f-9736-bf2e45750e2f |
  +-------------------+--------------------------------------+

  [root@control1 ~]# openstack image list
  +--------------------------------------+------------------------+--------+
  | ID                                   | Name                   | Status |
  +--------------------------------------+------------------------+--------+
  | 389ffe8a-ebf3-4937-86ae-812057264a69 | CentOS 7               | active |
  | cc927ebc-8c19-4533-8956-188064e778bc | amphora-x86_64-haproxy | active |
  | 3f932c75-03aa-4aeb-adfc-7f6875e986aa | test                   | active |
  +--------------------------------------+------------------------+--------+

  [root@control1 ~]# openstack aggregate cache image 6 389ffe8a-ebf3-4937-86ae-812057264a69 cc927ebc-8c19-4533-8956-188064e778bc  3f932c75-03aa-4aeb-adfc-7f6875e986aa
  BadRequestException: 400: Client Error for url: http://10.0.5.30:8774/v2.1/os-aggregates/6/images, Duplicate images in request

  Even though images have no duplicate id, the list order of images has changed after deduplication, and the judgment condition is wrong during comparison.
  https://github.com/openstack/nova/blob/master/nova/api/openstack/compute/aggregates.py#L292

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2034702/+subscriptions